-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1000 Bytes
/
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
name: Build Rust
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
config: [ debug, release ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v2
name: Rust Cache
with:
prefix-key: ${{ hashFiles('**/Cargo.lock') }}-rust-${{ matrix.config }}
- name: Build
run: cargo ${{ matrix.config == 'release' && 'build --release' || 'build' }}
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.config }}-artifacts
path: target/${{ matrix.config }}/${{ github.event.repository.name }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}