From 871b79cfbc9e1c547c2dddb1b624575c617e8369 Mon Sep 17 00:00:00 2001 From: Guillem Castro Date: Fri, 10 Feb 2023 17:46:04 +0100 Subject: [PATCH 1/4] Update rust.yml --- .github/workflows/rust.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 177a5fd..86595dc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,9 +37,14 @@ jobs: - name: Build run: | cargo build --verbose --release - - name: Rename binary + - if: matrix.platform == 'windows-latest' + name: Rename binary run: | - mv target/release/spotify-dl* target/release/spotify-dl.${{ matrix.target }} + mv target/release/spotify-dl.exe target/release/spotify-dl.${{ matrix.target }} + - if: matrix.platform != 'windows-latest' + name: Rename binary + run: | + mv target/release/spotify-dl target/release/spotify-dl.${{ matrix.target }} - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" From e1f93b092ba12337aa6aa09f96f832291930db8b Mon Sep 17 00:00:00 2001 From: Guillem Castro Date: Fri, 10 Feb 2023 18:02:09 +0100 Subject: [PATCH 2/4] Update rust.yml --- .github/workflows/rust.yml | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 86595dc..e7bd004 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,8 +8,23 @@ env: CARGO_TERM_COLOR: always jobs: - build: + create_release: + name: Create release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "latest" + release_name: "Latest build" + + build: runs-on: ${{ matrix.platform }} strategy: @@ -45,12 +60,11 @@ jobs: name: Rename binary run: | mv target/release/spotify-dl target/release/spotify-dl.${{ matrix.target }} - - uses: "marvinpinto/action-automatic-releases@latest" + - name: Upload + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: true - title: "Latest Build" - files: | - LICENSE - target/release/spotify-dl* + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_path: target/release/spotify-dl.${{ matrix.target }} + asset_name: spotify-dl.${{ matrix.target }} From 75c73798cc20a7b3ed5fae24b923587fdaff32bb Mon Sep 17 00:00:00 2001 From: Guillem Castro Date: Fri, 10 Feb 2023 18:03:41 +0100 Subject: [PATCH 3/4] Update and rename rust.yml to release.yml --- .github/workflows/{rust.yml => release.yml} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename .github/workflows/{rust.yml => release.yml} (98%) diff --git a/.github/workflows/rust.yml b/.github/workflows/release.yml similarity index 98% rename from .github/workflows/rust.yml rename to .github/workflows/release.yml index e7bd004..e414f61 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ -name: Rust +name: Release on: push: - branches: [ "master" ] + tags: + - "v*" env: CARGO_TERM_COLOR: always From 333b6fec5a12a44f45fd77e55a239aeec7ae121a Mon Sep 17 00:00:00 2001 From: Guillem Castro Date: Fri, 10 Feb 2023 18:06:10 +0100 Subject: [PATCH 4/4] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e414f61..78a12b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: "latest" - release_name: "Latest build" + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} build: runs-on: ${{ matrix.platform }}