-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evsyukov Denis Anatolyevich
committed
Mar 11, 2020
1 parent
da6d83d
commit 55e12a2
Showing
1 changed file
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,56 @@ | ||
name: Publish release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
name: Publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
build: | ||
name: Publish | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
config: | ||
- { | ||
os: ubuntu-latest, | ||
artifact_name: t, | ||
asset_name: t-linux-amd64, | ||
strip: true | ||
} | ||
- { | ||
os: windows-latest, | ||
artifact_name: t.exe, | ||
asset_name: t-windows-amd64, | ||
strip: false | ||
} | ||
- { | ||
os: macos-latest, | ||
artifact_name: t, | ||
asset_name: t-macos-amd64, | ||
strip: true | ||
} | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --release | ||
- name: Compress binaries | ||
uses: svenstaro/upx-action@v1-release | ||
with: | ||
file: target/release/${{ matrix.config.artifact_name }} | ||
args: '-9' | ||
strip: ${{ matrix.config.strip }} | ||
- name: Install macOS dependencies | ||
if: matrix.config.os == 'macos-latest' | ||
run: brew install p7zip | ||
- name: Zip binary file | ||
run: 7z a ./${{ matrix.config.asset_name }}.zip ./target/release/${{ matrix.config.artifact_name }} | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.TOKEN }} | ||
file: target/release/t | ||
asset_name: t-${{ runner.os }} | ||
file: ./${{ matrix.config.asset_name }}.zip | ||
asset_name: ${{ matrix.config.asset_name }}.zip | ||
tag: ${{ github.ref }} |