Skip to content

Commit

Permalink
remove custom event for release action
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gdamjan committed Sep 20, 2020
1 parent 570c400 commit 665f86a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Make a release

on:
repository_dispatch:
types: [tag-created]
push:
tags:
- 'v*'

jobs:
release:
Expand All @@ -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 }}

0 comments on commit 665f86a

Please sign in to comment.