From 50fe6bc38692593880c93f5ac94936f193362ef7 Mon Sep 17 00:00:00 2001 From: ak5k <42914711+ak5k@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:59:30 +0200 Subject: [PATCH] Refactor release workflow to download and upload artifacts --- .github/workflows/cmake-multi-platform.yml | 60 ++++++++++------------ 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 1aec5c1..878ce2a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -110,36 +110,32 @@ jobs: ./reaper_*.dylib ./reaper_*.so - release: - needs: build - runs-on: ubuntu-latest - steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: true - prerelease: false + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: my-artifact + path: ./artifacts - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: my-artifact - path: ./artifacts - - - name: Upload Release Asset - run: | - for file in ./artifacts/*; do - if [ -f "$file" ]; then - echo "Uploading $file" - curl \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: $(file -b --mime-type $file)" \ - --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}?name=$(basename $file)" - fi - done \ No newline at end of file + - name: Upload Release Assets + run: | + for file in ./artifacts/*; do + if [ -f "$file" ]; then + echo "Uploading $file" + curl \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: $(file -b --mime-type $file)" \ + --data-binary @"$file" \ + "${{ steps.create_release.outputs.upload_url }}?name=$(basename $file)" + fi + done \ No newline at end of file