Repository navigation
205 lines (160 loc) · 5.77 KB
/
Copy pathlockdown_release.yml
File metadata and controls
205 lines (160 loc) · 5.77 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Lockdown Systems Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build_linux_x64:
name: Build Linux x64
runs-on: ubuntu-x64
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libpulse-dev cmake build-essential
- name: Install Rust
run: |
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/setup-node@v4
with:
node-version-file: "src/node/.nvmrc"
- name: Fetch WebRTC artifact
run: ./bin/fetch-artifact --platform linux-x64 --release
- name: Build RingRTC
run: ./bin/build-desktop --ringrtc-only --release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-linux-x64
path: src/node/build/
retention-days: 1
build_macos:
name: Build macOS (x64 + ARM64)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install protobuf coreutils
- name: Install Rust with cross-compile targets
run: |
rustup toolchain install $(cat rust-toolchain) --profile minimal --target x86_64-apple-darwin,aarch64-apple-darwin
- uses: actions/setup-node@v4
with:
node-version-file: "src/node/.nvmrc"
# Build x64
- name: Fetch WebRTC artifact (x64)
run: ./bin/fetch-artifact --platform mac-x64 --release
- name: Build RingRTC (x64)
run: TARGET_ARCH=x64 OUTPUT_DIR=out ./bin/build-desktop --ringrtc-only --release
# Build ARM64
- name: Fetch WebRTC artifact (ARM64)
run: ./bin/fetch-artifact --platform mac-arm64 --release -o out-arm
- name: Build RingRTC (ARM64)
run: TARGET_ARCH=arm64 OUTPUT_DIR=out-arm ./bin/build-desktop --ringrtc-only --release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-macos
path: src/node/build/
retention-days: 1
build_windows:
name: Build Windows x64
runs-on: windows-x64
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup toolchain install stable --profile minimal
- name: Install protoc
run: choco install protoc
shell: cmd
- uses: actions/setup-node@v4
with:
node-version-file: "src/node/.nvmrc"
- name: Fetch WebRTC artifact
run: sh ./bin/fetch-artifact --platform windows-x64 --release
- name: Build RingRTC
run: sh ./bin/build-desktop --ringrtc-only --release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-windows
path: src/node/build/
retention-days: 1
publish:
name: Publish to npm
needs: [build_linux_x64, build_macos, build_windows]
runs-on: ubuntu-x64
permissions:
contents: write # Needed for creating releases
id-token: write # Needed for npm provenance and trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: "src/node/.nvmrc"
registry-url: "https://registry.npmjs.org/"
# Trusted publishing requires npm 11.5.1+
- name: Update npm for trusted publishing
run: npm install -g npm@latest
# Download all build artifacts
- name: Download Linux x64 build
uses: actions/download-artifact@v4
with:
name: build-linux-x64
path: src/node/build/
- name: Download macOS build
uses: actions/download-artifact@v4
with:
name: build-macos
path: src/node/build/
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: build-windows
path: src/node/build/
- name: List build directory
run: ls -la src/node/build/
# Determine version from package.json
- name: Determine version
id: version
run: |
VERSION=$(jq -r .version src/node/package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Create tarball for GitHub Releases
- name: Create prebuild archive
run: tar czf "ringrtc-desktop-build-v${{ steps.version.outputs.version }}.tar.gz" build
working-directory: src/node
- name: Calculate checksum
id: checksum
run: |
CHECKSUM=$(sha256sum "ringrtc-desktop-build-v${{ steps.version.outputs.version }}.tar.gz" | cut -d ' ' -f 1)
echo "sha256=$CHECKSUM" >> $GITHUB_OUTPUT
echo "Checksum: $CHECKSUM"
working-directory: src/node
# Upload to GitHub Releases
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: src/node/ringrtc-desktop-build-v${{ steps.version.outputs.version }}.tar.gz
generate_release_notes: true
fail_on_unmatched_files: true
# Install and build (skip install scripts - we already have the prebuilt binaries)
- name: Install dependencies
run: npm ci --ignore-scripts
working-directory: src/node
- name: Build TypeScript
run: npm run build
working-directory: src/node
# Update package.json with checksum after build
- name: Update prebuild checksum
run: |
npm pkg set config.prebuildChecksum="${{ steps.checksum.outputs.sha256 }}"
working-directory: src/node
# Publish to npm
- name: Publish to npm
run: npm publish --access public --provenance --tag audiosink
working-directory: src/node