aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvsyukov Denis Anatolyevich <[email protected]>2020-03-11 10:54:31 +0300
committerEvsyukov Denis Anatolyevich <[email protected]>2020-03-11 11:30:23 +0300
commit55e12a2b0e5b4164536123b7c92fc52e5c81274c (patch)
treed8acb98d01911ad9f174bf96ff6904a050a42154
parent[~] build workflow (diff)
downloadt-55e12a2b0e5b4164536123b7c92fc52e5c81274c.tar.xz
t-55e12a2b0e5b4164536123b7c92fc52e5c81274c.zip
[~] publish release2.0.1
-rw-r--r--.github/workflows/publish.yml43
1 files changed, 36 insertions, 7 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index caca01b..b876405 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,16 +1,34 @@
+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:
@@ -18,10 +36,21 @@ jobs:
- 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 }} \ No newline at end of file