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
name: Build Zond
on:
release:
types:
push:
branches:
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/build.yml'
pull_request:
branches:
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/build.yml'
permissions:
contents: write
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run Tests
run: cargo test
- name: Build Release Binary
if: github.event_name == 'release'
run: cargo build --release
- name: Package MacOS Binary
if: matrix.os == 'macos-latest' && github.event_name == 'release'
run: |
cd target/release
zip zond-macos.zip zond
- name: Package Linux Binary
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
run: |
cd target/release
tar -czf zond-linux.tar.gz zond
- name: Build Debian Package
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
run: |
cargo install cargo-deb
cargo deb -p zond-cli
- name: Upload Release Assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
target/release/zond-macos.zip
target/release/zond-linux.tar.gz
target/debian/*.deb