-
Notifications
You must be signed in to change notification settings - Fork 27
99 lines (82 loc) · 2.56 KB
/
build.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
jobs:
frontend:
name: Build frontend assets
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: rustup target add wasm32-unknown-unknown
- uses: jetli/[email protected]
with:
version: 'latest'
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
frontend/target/
key: frontend-${{ hashFiles('frontend/Cargo.toml') }}
restore-keys: frontend-
- name: Build frontend
run: trunk build
working-directory: frontend
- uses: actions/upload-artifact@v4
with:
name: frontend-build-${{ github.sha }}
path: frontend/dist
build:
name: Binaries for ${{ matrix.name }}
needs: frontend
runs-on: ubuntu-24.04
strategy:
matrix:
name:
- linux-x86-64-gnu
- linux-armv7-gnu
- linux-arm64-gnu
- linux-x86-64-musl
- linux-arm64-musl
include:
- name: linux-x86-64-gnu
target: x86_64-unknown-linux-gnu
platform: ~
- name: linux-armv7-gnu
target: armv7-unknown-linux-gnueabihf
platform: ~
- name: linux-arm64-gnu
target: aarch64-unknown-linux-gnu
platform: ~
- name: linux-x86-64-musl
target: x86_64-unknown-linux-musl
platform: amd64
- name: linux-arm64-musl
target: aarch64-unknown-linux-musl
platform: arm64
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: actions/download-artifact@v4
with:
name: frontend-build-${{ github.sha }}
path: frontend/dist
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
backend/target/
key: backend-${{ matrix.name }}-${{ hashFiles('backend/Cargo.toml') }}
restore-keys: backend-${{ matrix.name }}-
- run: cargo install cross --git https://github.com/cross-rs/cross || true
- name: Cross build
run: cross build --release --locked --target ${{ matrix.target }} --manifest-path backend/Cargo.toml