From 665f86af451dcfb05ae2389fa0cb4e08d90f5cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Sun, 20 Sep 2020 03:21:23 +0200 Subject: [PATCH] remove custom event for release action instead, trigger on all tags beginning with v* like v0.10.0 or v0.12.0, etc also add asset_name to the release action, and make and upload a fixed zip release file use 7zip on windows --- .github/workflows/release.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2baa847..a7fcdf1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ name: Make a release on: - repository_dispatch: - types: [tag-created] + push: + tags: + - 'v*' jobs: release: @@ -14,26 +15,30 @@ jobs: - os: ubuntu-latest artifact_name: http-server asset_name: http-server-$tag-linux-amd64.zip + zipcmd: zip -j - os: macos-latest artifact_name: http-server asset_name: http-server-$tag-macos-amd64.zip + zipcmd: zip -j - os: windows-latest artifact_name: http-server.exe asset_name: http-server-$tag-windows.zip + zipcmd: 7z a -tzip steps: - uses: actions/checkout@v2 - name: Build project run: cargo build --release --locked - - name: Pre-release + - name: Post-build release preparation run: | strip target/release/${{ matrix.artifact_name }} - zip ${{ matrix.asset_name }} -j target/release/${{ matrix.artifact_name }} + ${{ matrix.zipcmd}} release.zip target/release/${{ matrix.artifact_name }} - name: Upload binary to release - uses: svenstaro/upload-release-action@v1-release + uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.asset_name }} - tag: ${{ github.event.client_payload.new_version }} + file: release.zip + asset_name: ${{ matrix.asset_name }} + tag: ${{ github.ref }}