-
Notifications
You must be signed in to change notification settings - Fork 43
57 lines (49 loc) · 1.62 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
name: Build Artifacts
on:
push:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build project
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
executable: target/aarch64-apple-darwin/release/ferrumc
upload_path: target/aarch64-apple-darwin/release/ferrumc
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
executable: target/x86_64-unknown-linux-gnu/release/ferrumc
upload_path: target/x86_64-unknown-linux-gnu/release/ferrumc
- os: windows-latest
target: x86_64-pc-windows-msvc
executable: target/x86_64-pc-windows-msvc/release/ferrumc.exe
upload_path: target/x86_64-pc-windows-msvc/release/ferrumc.exe
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }} --verbose
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts-${{ matrix.os }}
path: ${{ matrix.upload_path }}