-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.54 KB
/
publish.yaml
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
name: Continuous Integration (CI)
on: [push]
concurrency:
group: "ci-${{ github.ref_name }}"
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- target: x86_64-unknown-linux-gnu
name: amd64
- target: aarch64-unknown-linux-gnu
name: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust with Cross
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
rustup toolchain install stable --profile minimal
rustup target add ${{ matrix.arch.target }}
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.arch.target }}
cache-on-failure: true
- name: Build Binary
run: |
cross build --verbose --locked --release --target ${{ matrix.arch.target }}
mv target/${{ matrix.arch.target }}/release/wg-multizone target/${{ matrix.arch.target }}/release/wg-multizone-${{ matrix.arch.name }}
- name: publish artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
target/${{ matrix.arch.target }}/release/wg-multizone-${{ matrix.arch.name }}