-
-
Notifications
You must be signed in to change notification settings - Fork 13
63 lines (55 loc) · 2.01 KB
/
binaries.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
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
env:
BINS: "add unsquashfs replace"
name: binaries
jobs:
# release binaries
release-bins:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-feature=+crt-static"
strategy:
matrix:
targets:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- arm-unknown-linux-musleabi
- mips-unknown-linux-musl
- mipsel-unknown-linux-musl
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@d76c2a93c593483c9892fd8d2538734f73ed8588 # stable
with:
target: ${{ matrix.targets }}
- run: cargo install cargo-quickinstall
- run: cargo quickinstall [email protected] --force
- run: cross build --bins --locked --target ${{ matrix.targets }} --profile=dist
- name: archive
run: |
tar -czvf backhand-${{ matrix.targets }}.tar.gz \
-C target/${{ matrix.targets }}/dist/ $BINS
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: backhand-${{ matrix.targets }}.tar.gz
path: backhand-${{ matrix.targets }}.tar.gz
# check semvar before release!
- name: Check semver
env:
# disable static build for this job
RUSTFLAGS: ""
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: obi1kenobi/cargo-semver-checks-action@e275dda72e250d4df5b564e969e1348d67fefa52 # v2.2
- name: Upload binary to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: backhand-${{ matrix.targets }}.tar.gz
asset_name: backhand-${{ github.ref_name }}-${{ matrix.targets }}.tar.gz
tag: ${{ github.ref }}
overwrite: true