summary refs log tree commit diff
path: root/.github/workflows/main.yml
diff options
context:
space:
mode:
authorwlodekm <[email protected]>2024-11-15 10:25:08 +0200
committerwlodekm <[email protected]>2024-11-15 10:25:08 +0200
commitaee318cfe068129fa7fbf9b0edd8c947e8957673 (patch)
treeef7e5abd469f6b27f4e2ed5f9563de268a132e13 /.github/workflows/main.yml
parentfa43d2577d9757870390199c447375b6b634188d (diff)
uh
Diffstat (limited to '.github/workflows/main.yml')
-rw-r--r--.github/workflows/main.yml36
1 files changed, 29 insertions, 7 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 40b0033..c7991e7 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,7 +16,7 @@ jobs:
     - name: Set up Deno
       uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31
       with:
-        deno-version: 'v2.0.6'  # specify the version of Deno you want to use
+        deno-version: 'v2.0.6'
     
     - name: Install modulesdsafdasf
       run: deno install
@@ -27,11 +27,14 @@ jobs:
     - name: Run buildall.sh
       run: ./buildall.sh
 
+    - name: List contents of build/compressed (debugging step)
+      run: ls -R build/compressed
+
     - name: Upload build artifacts
       uses: actions/upload-artifact@v3
       with:
         name: compressed-files
-        path: build/compressed/*  # Upload the files in the build/compressed directory
+        path: build/compressed/*
 
   release:
     needs: build
@@ -41,13 +44,32 @@ jobs:
     - name: Checkout code
       uses: actions/checkout@v3
 
+    - name: List contents of build/compressed (debugging step)
+      run: ls -R build/compressed  # Double-check the files before uploading
+
+    # Step to check if the release already exists
+    - name: Check if release exists
+      id: check_release
+      run: |
+        TAG="${GITHUB_REF##*/}"
+        RELEASE=$(curl -s --header "Authorization: token ${{ secrets.GH_TOKEN }}" \
+          "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG")
+        echo "Release: $RELEASE"
+        if [[ "$RELEASE" != "{}" ]]; then
+          echo "Release already exists for tag $TAG"
+          echo "exists=true" >> $GITHUB_ENV
+        else
+          echo "Release does not exist for tag $TAG"
+          echo "exists=false" >> $GITHUB_ENV
+
+    # Conditional step to create release only if it doesn't exist
     - name: Create GitHub Release
+      if: env.exists == 'false'
       uses: softprops/action-gh-release@v1
       with:
-        files: build/compressed/*  # Upload the files to the GitHub release
-        name: ${{ github.ref }}  # Use the pushed tag as the release version
-        release_name: Release ${{ github.ref }}
+        files: build/compressed/*
+        tag_name: ${{ github.ref }}
+        name: Release ${{ github.ref }}  # Use name instead of release_name
         body: "Automated release for version ${{ github.ref }}"
       env:
-        GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}  # Use the personal access token here
-
+        GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}