-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (104 loc) · 3.19 KB
/
Copy pathbuild.yml
File metadata and controls
129 lines (104 loc) · 3.19 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests with coverage
run: cargo llvm-cov --codecov --output-path codecov.json
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: linux-amd64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: linux-arm64
- target: aarch64-apple-darwin
os: macos-latest
name: macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cargo-zigbuild
run: cargo install cargo-zigbuild
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
ulimit -n 10240 || true
cargo zigbuild --release --target ${{ matrix.target }}
- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/lattice dist/lattice-${{ matrix.name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.name }}
path: dist/*
retention-days: 14
# Update the "dev" pre-release with latest binaries (main branch only)
update-dev-release:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir -p release
find artifacts -type f -name 'lattice-*' -exec cp {} release/ \;
ls -la release/
- name: Update dev release
uses: softprops/action-gh-release@v2
with:
tag_name: dev
name: Development Build
prerelease: true
files: |
release/lattice-*
body: |
**Latest development build from `main` branch.**
Commit: ${{ github.sha }}
Built: ${{ github.event.head_commit.timestamp }}
⚠️ These are unstable development builds. Use tagged releases for production.