Skip to content

Commit

Permalink
[~] publish release
Browse files Browse the repository at this point in the history
  • 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.
43 changes: 36 additions & 7 deletions .github/workflows/publish.yml
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 }}

0 comments on commit 55e12a2

Please sign in to comment.