-
-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (64 loc) · 2.01 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
build:
name: Build and publish release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
name: mihoro-x86_64-unknown-linux-gnu.tar.gz
cross: false
strip: true
- target: x86_64-unknown-linux-musl
name: mihoro-x86_64-unknown-linux-musl.tar.gz
cross: true
strip: true
- target: i686-unknown-linux-gnu
name: mihoro-i686-unknown-linux-gnu.tar.gz
cross: true
strip: true
- target: i686-unknown-linux-musl
name: mihoro-i686-unknown-linux-musl.tar.gz
cross: true
strip: true
- target: aarch64-unknown-linux-gnu
name: mihoro-aarch64-unknown-linux-gnu.tar.gz
cross: true
strip: false
- target: aarch64-unknown-linux-musl
name: mihoro-aarch64-unknown-linux-musl.tar.gz
cross: true
strip: false
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Build binaries
uses: ClementTsang/[email protected]
with:
command: build
args: --release --target=${{ matrix.target }}
use-cross: ${{ matrix.cross }}
- name: Strip binaries
run: strip target/${{ matrix.target }}/release/mihoro
if: ${{ matrix.strip }}
- name: Package binaries
run: |
cd target/${{ matrix.target }}/release
tar -czvf ${{ matrix.name }} mihoro
cd -
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.name }}
asset_name: ${{ matrix.name }}
tag: ${{ github.ref }}