-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 1.99 KB
/
publish-binaries.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
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
72
73
74
name: publish-binaries
on:
release:
types: [released, prereleased]
permissions: write-all
jobs:
build:
name: ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.os }}
if: ${{ !startsWith(github.ref_name, 'v') }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: pathfinder
name: pathfinder-linux-x86_64-gnu.tar.gz
- os_name: Linux-aarch64-gnu
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
bin: pathfinder
name: pathfinder-linux-aarch64-gnu.tar.gz
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: pathfinder
name: pathfinder-apple-darwin-aarch64.tar.gz
steps:
- name: checkout
uses: actions/checkout@v4
- name: init cache
uses: Swatinem/rust-cache@v2
- name: setup toolchain
run: rustup toolchain install stable --profile minimal
- name: set version
run: cargo install cargo-edit && cargo set-version $VERSION
env:
VERSION: ${{ github.ref_name }}
- name: run build
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: "stable"
args: "--locked --release"
strip: true
- name: package
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
else
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
fi
cd -
- name: upload artifacts
uses: softprops/action-gh-release@v2
with:
files: "pathfinder-*"