From 200f85e0359a9468473cfc56f4d9e9d48bce8eb1 Mon Sep 17 00:00:00 2001 From: Noah Wiggin Date: Wed, 28 Aug 2024 11:33:30 -0400 Subject: [PATCH] Fix build-and-release github action --- .github/workflows/build-and-release.yml | 26 +++++++------------------ 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index cbed863..c3ee504 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -25,28 +25,16 @@ jobs: - name: Build WebAssembly run: wasm-pack build --target web - - name: Create or update release + - name: Create Release id: create_release + uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - release_info=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ - "https://api.github.com/repos/${{ github.repository }}/releases/latest") - if [ "$(echo "$release_info" | jq -r '.tag_name')" != "latest" ]; then - response=$(curl -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"tag_name": "latest", "name": "Latest Release", "body": "This is the latest release of the WebAssembly module.", "draft": false, "prerelease": false}' \ - "https://api.github.com/repos/${{ github.repository }}/releases") - else - release_id=$(echo "$release_info" | jq -r '.id') - response=$(curl -X PATCH \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"body": "This is the latest release of the WebAssembly module."}' \ - "https://api.github.com/repos/${{ github.repository }}/releases/$release_id") - fi - echo "upload_url=$(echo "$response" | jq -r .upload_url | sed -e 's/{?name,label}//')" >> $GITHUB_OUTPUT + with: + tag_name: v${{ github.run_number }} + release_name: Release ${{ github.run_number }} + draft: false + prerelease: false - name: Upload WebAssembly Module uses: actions/upload-release-asset@v1