2828 body="Release $tag"
2929 gh release create --draft "$tag" --title "$tag" --notes "$body"
3030
31- build_android :
32- name : Build Android
31+ libs_linux :
32+ name : Building Linux libraries
33+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
34+ runs-on : ubuntu-latest
35+ steps :
36+ - uses : actions/checkout@v4
37+ with :
38+ submodules : true
39+ - name : Build Android
40+ uses : ./.github/actions/linux
41+
42+ libs_macos :
43+ name : Building macOS libraries
44+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
45+ runs-on : macos-latest
46+ steps :
47+ - uses : actions/checkout@v4
48+ with :
49+ submodules : true
50+ - name : Build macOS
51+ uses : ./.github/actions/macos
52+
53+ libs_windows :
54+ name : Building Windows libraries
55+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
56+ runs-on : windows-latest
57+ steps :
58+ - uses : actions/checkout@v4
59+ with :
60+ submodules : true
61+ - name : Build Windows
62+ uses : ./.github/actions/windows
63+
64+ libs_android :
65+ name : Building Android libraries
66+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
3367 runs-on : ubuntu-latest
3468 steps :
3569 - uses : actions/checkout@v4
@@ -41,12 +75,35 @@ jobs:
4175 gpg-key : ${{ secrets.GPG_PRIVATE_KEY }}
4276 gpg-password : ${{ secrets.GPG_PASSWORD }}
4377
78+ libs_wasm :
79+ name : Basic WASM build
80+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
81+ runs-on : ubuntu-latest
82+ steps :
83+ - uses : actions/checkout@v4
84+ with :
85+ submodules : true
86+
87+ - name : Build wasm
88+ uses : ./.github/actions/wasm
89+
90+ libs_xcframework :
91+ name : Build XCFramework
92+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
93+ runs-on : macos-latest
94+ steps :
95+ - uses : actions/checkout@v4
96+ with :
97+ submodules : true
98+ - name : Build XCFramework
99+ uses : ./.github/actions/xcframework
100+
44101 publish_android :
45102 permissions :
46103 contents : read
47104 packages : write
48105 name : Publish Android
49- needs : [ draft_release, build_android ]
106+ needs : [ draft_release, libs_android ]
50107 runs-on : ubuntu-latest
51108 steps :
52109 - uses : actions/checkout@v4
@@ -64,32 +121,17 @@ jobs:
64121
65122 publish_ios_pod_and_spm_package :
66123 name : Publish iOS
67- needs : [ draft_release ]
124+ needs : [ draft_release, libs_xcframework ]
68125 runs-on : macos-latest
69126 steps :
70- - uses : actions/checkout@v3
127+ - uses : actions/checkout@v4
71128 with :
72129 submodules : true
73130
74- - name : Setup
75- run : |
76- rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin
77- rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin
78- rustup target add \
79- x86_64-apple-darwin \
80- aarch64-apple-darwin \
81- aarch64-apple-ios \
82- aarch64-apple-ios-sim \
83- x86_64-apple-ios
84-
85- - name : setup-cocoapods
86- uses : maxim-lobanov/setup-cocoapods@v1
131+ - name : Download libs
132+ uses : actions/download-artifact@v5
87133 with :
88- version : 1.16.2
89-
90- - name : Build iOS & macOS xcframework
91- run : |
92- ./tool/build_xcframework.sh
134+ name : xcframework
93135
94136 - name : Lint pod
95137 run : |
@@ -130,153 +172,54 @@ jobs:
130172 "fileName": "${{ steps.fileName.outputs.fileName }}"
131173 }
132174
133- publish_linux_x86_64 :
134- name : Publish Linux x86_64
135- needs : [ draft_release ]
175+ publish_desktop :
176+ name : Publish Desktop libraries
177+ needs : [ draft_release, libs_linux, libs_macos, libs_windows ]
136178 runs-on : ubuntu-latest
137- steps :
138- - uses : actions/checkout@v3
139- with :
140- submodules : true
141-
142- - name : Install Rust Nightly
143- uses : dtolnay/rust-toolchain@stable
144- with :
145- toolchain : nightly-2025-04-15
146- components : rust-src
147-
148- - name : Build binaries
149- run : ./tool/build_linux.sh x64
150179
151- - name : Upload binary
152- uses : ./.github/actions/upload
153- with :
154- repo-token : ${{ secrets.GITHUB_TOKEN }}
155- file-name : libpowersync_x64.so
156- tag : ${{ needs.draft_release.outputs.tag }}
157-
158- publish_linux_aarch64 :
159- name : Publish Linux aarch64
160- needs : [ draft_release ]
161- runs-on : ubuntu-arm64
162180 steps :
163- - uses : actions/checkout@v3
164- with :
165- submodules : true
166-
167- - name : Install Rust Nightly
168- uses : dtolnay/rust-toolchain@stable
169- with :
170- toolchain : nightly-2025-04-15
171- components : rust-src
172-
173- - name : Build binaries
174- run : ./tool/build_linux.sh aarch64
175-
176- - name : Upload binary
177- uses : ./.github/actions/upload
178- with :
179- repo-token : ${{ secrets.GITHUB_TOKEN }}
180- file-name : libpowersync_aarch64.so
181- tag : ${{ needs.draft_release.outputs.tag }}
182-
183- publish_windows_x64 :
184- name : Publish Windows x64
185- needs : [ draft_release ]
186- runs-on : windows-latest
187- steps :
188- - uses : actions/checkout@v3
189- with :
190- submodules : true
191-
192- - name : Install Rust Nightly
193- uses : dtolnay/rust-toolchain@stable
194- with :
195- toolchain : nightly-2025-04-15
196- components : rust-src
197-
198- - name : Build binary
199- run : bash tool/build_windows.sh x64
200-
201- - name : Upload binary
202- uses : ./.github/actions/upload
203- with :
204- repo-token : ${{ secrets.GITHUB_TOKEN }}
205- file-name : powersync_x64.dll
206- tag : ${{ needs.draft_release.outputs.tag }}
207-
208- publish_macOS_aarch64 :
209- name : Publish macOS aarch64
210- needs : [ draft_release ]
211- runs-on : macos-latest
212- steps :
213- - uses : actions/checkout@v3
181+ - uses : actions/checkout@v4
214182 with :
215183 submodules : true
216184
217- - name : Install Rust Nightly
218- uses : dtolnay/rust-toolchain@stable
185+ - name : Download libs
186+ uses : actions/download-artifact@v5
219187 with :
220- toolchain : nightly-2025-04-15
221- components : rust-src
222-
223- - name : Build binary
224- run : ./tool/build_macos.sh aarch64
225-
226- - name : Upload binary
227- uses : ./.github/actions/upload
188+ name : linux-library
189+ path : dart/assets
190+ - name : Download libs
191+ uses : actions/download-artifact@v5
228192 with :
229- repo-token : ${{ secrets.GITHUB_TOKEN }}
230- file-name : libpowersync_aarch64.dylib
231- tag : ${{ needs.draft_release.outputs.tag }}
232-
233- publish_macOS_x64 :
234- name : Publish macOS x64
235- needs : [ draft_release ]
236- runs-on : macos-14
237- steps :
238- - uses : actions/checkout@v3
239- with :
240- submodules : true
241-
242- - name : Install Rust Nightly
243- uses : dtolnay/rust-toolchain@stable
193+ name : macos-library
194+ path : dart/assets
195+ - name : Download libs
196+ uses : actions/download-artifact@v5
244197 with :
245- toolchain : nightly-2025-04-15
246- components : rust-src
247-
248- - name : Build binary
249- run : ./tool/build_macos.sh x64
198+ name : windows-library
199+ path : dart/assets
250200
251201 - name : Upload binary
252- uses : ./.github/actions/upload
253- with :
254- repo-token : ${{ secrets.GITHUB_TOKEN }}
255- file-name : libpowersync_x64.dylib
256- tag : ${{ needs.draft_release.outputs.tag }}
202+ env :
203+ GH_TOKEN : ${{ github.token }}
204+ GH_REPO : ${{ github.repository }}
205+ run : |
206+ gh release upload "${{ inputs.tag }}" *.dll
207+ gh release upload "${{ inputs.tag }}" *.dylib
208+ gh release upload "${{ inputs.tag }}" *.so
257209
258210 publish_wasm :
259211 name : Publish WASM builds
260- needs : [ draft_release ]
212+ needs : [ draft_release, libs_wasm ]
261213 runs-on : ubuntu-latest
262214 steps :
263215 - uses : actions/checkout@v4
264216 with :
265217 submodules : true
266218
267- - name : Install Rust Nightly
268- uses : dtolnay/rust-toolchain@stable
219+ - name : Download wasm bundle
220+ uses : actions/download-artifact@v5
269221 with :
270- toolchain : nightly-2025-04-15
271- components : rust-src
272-
273- - name : Setup emsdk
274- uses : mymindstorm/setup-emsdk@v14
275- with :
276- version : 4.0.10
277-
278- - name : Build WASM
279- run : ./tool/build_wasm.sh
222+ name : wasm-library
280223
281224 - name : Upload libpowersync.wasm
282225 uses : ./.github/actions/upload
@@ -308,11 +251,7 @@ jobs:
308251 - draft_release
309252 - publish_android
310253 - publish_ios_pod_and_spm_package
311- - publish_linux_x86_64
312- - publish_linux_aarch64
313- - publish_windows_x64
314- - publish_macOS_aarch64
315- - publish_macOS_x64
254+ - publish_desktop
316255 - publish_wasm
317256 steps :
318257 - name : Create issue
0 commit comments