-
Notifications
You must be signed in to change notification settings - Fork 11
42 lines (39 loc) · 1.38 KB
/
release-build-test.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
name: Release build test
on:
push:
branches:
- 'build-test'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
targets:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
runs-on: ${{ matrix.targets.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
run: rustup target add ${{ matrix.targets.target }}
- name: Install musl-tools
if : matrix.targets.target == 'x86_64-unknown-linux-musl'
run: sudo apt install -qq -y musl-tools --no-install-recommends
- name: Build
run: cargo build --release --target ${{ matrix.targets.target }}
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#v}" >> ${GITHUB_ENV}
- name: Archive
run: tar -czf stu-${{ env.RELEASE_VERSION }}-${{ matrix.targets.target }}.tar.gz -C target/${{ matrix.targets.target }}/release stu
- name: Checksum
run: shasum -a 256 stu-${{ env.RELEASE_VERSION }}-${{ matrix.targets.target }}.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.targets.target }}
path: stu-${{ env.RELEASE_VERSION }}-${{ matrix.targets.target }}.tar.gz
if-no-files-found: error