-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (55 loc) · 1.61 KB
/
ci.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
on:
push:
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: -D warnings
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --check
- run: cargo clippy
build:
needs: check
strategy:
fail-fast: false
matrix:
platform: [
{ name: linux, os: ubuntu-latest, build: cbundl, artifact: cbundl-linux },
{ name: darwin, os: macos-latest, build: cbundl, artifact: cbundl-darwin },
{ name: win, os: windows-latest, build: cbundl.exe, artifact: cbundl-win.exe },
]
runs-on: ${{ matrix.platform.os }}
timeout-minutes: 15
name: build for ${{ matrix.platform.name }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo build --release
mv target/release/${{ matrix.platform.build }} target/release/${{ matrix.platform.artifact }}
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.platform.name }}
path: target/release/${{ matrix.platform.artifact }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
timeout-minutes: 15
steps:
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
with:
prerelease: true
make_latest: false
fail_on_unmatched_files: true
files: |
./artifact-*/*