-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.66 KB
/
native-release.yml
File metadata and controls
89 lines (75 loc) · 2.66 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
name: Native Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
package-native:
name: Package Native (${{ matrix.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: linux-x86_64
rust_target: x86_64-unknown-linux-gnu
archive: prism-linux-x86_64.tar.gz
- os: macos-14
label: macos-aarch64
rust_target: aarch64-apple-darwin
archive: prism-macos-aarch64.tar.gz
- os: windows-latest
label: windows-x86_64
rust_target: x86_64-pc-windows-msvc
archive: prism-windows-x86_64.zip
steps:
- uses: actions/checkout@v4
- name: Install system deps (Linux — rdkafka needs libcurl)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake libcurl4-openssl-dev
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.rust_target }}
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dashboard deps
run: cd dashboard && npm ci
- name: Build dashboard bundle
run: cd dashboard && npm run build
- name: Build Rust binaries
run: cargo build --release --bin prism --bin prism-node --target ${{ matrix.rust_target }}
- name: Assemble package
shell: bash
run: |
mkdir -p package
if [[ "${{ matrix.label }}" == *"windows"* ]]; then
cp target/${{ matrix.rust_target }}/release/prism.exe package/
cp target/${{ matrix.rust_target }}/release/prism-node.exe package/
cd package && 7z a -tzip ../${{ matrix.archive }} . && cd ..
else
cp target/${{ matrix.rust_target }}/release/prism package/
cp target/${{ matrix.rust_target }}/release/prism-node package/
# macOS: ad-hoc sign binaries so users only need to clear quarantine
if [[ "${{ matrix.label }}" == *"macos"* ]]; then
codesign -s - -f package/prism
codesign -s - -f package/prism-node
fi
tar -C package -czf ${{ matrix.archive }} .
fi
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: ${{ matrix.archive }}
overwrite: true
- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
${{ matrix.archive }}