Skip to content

Commit 9373c07

Browse files
authored
Refactor CI build (#121)
This refactors the CI build with the goal of making non-released branches easier to test and to re-use build logic between the test and the release workflow.
1 parent 466906d commit 9373c07

File tree

22 files changed

+553
-400
lines changed

22 files changed

+553
-400
lines changed

.cargo/config.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,25 @@
1717
# 173K, loading works
1818
# Conclusion: -lgcc_eh has no effect when using -Z build-std.
1919

20-
[target.x86_64-unknown-linux-gnu]
20+
[target.'cfg(target_os = "linux")']
2121
rustflags = [
2222
"-C", "link-arg=-lgcc_eh",
2323
]
2424

25+
[target.x86_64-unknown-linux-gnu]
26+
linker = "x86_64-linux-gnu-gcc"
27+
2528
[target.i686-unknown-linux-gnu]
26-
rustflags = [
27-
"-C", "link-arg=-lgcc_eh",
28-
]
29+
linker = "i686-linux-gnu-gcc"
2930

3031
[target.aarch64-unknown-linux-gnu]
3132
linker = "aarch64-linux-gnu-gcc"
32-
rustflags = [
33-
"-C", "link-arg=-lgcc_eh",
34-
]
3533

34+
[target.armv7-unknown-linux-gnueabihf]
35+
linker = "arm-linux-gnueabihf-gcc"
36+
37+
[target.riscv64gc-unknown-linux-gnu]
38+
linker = "riscv64-linux-gnu-gcc"
3639

3740
# For iOS and macOS, we need to specify the minimum/target version.
3841
# This must match the versions in the podspec file.

.github/actions/android/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ runs:
5656
uses: actions/upload-artifact@v4
5757
with:
5858
name: android-library
59-
retention-days: 1
59+
retention-days: 14
6060
compression-level: 0 # We're uploading a zip, no need to compress again
6161
path: android/build/distributions/powersync_android.zip
6262
if-no-files-found: error

.github/actions/linux/action.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Build Linux libraries"
2+
description: "Create artifact for Linux libraries"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install Rust Nightly
8+
uses: dtolnay/rust-toolchain@stable
9+
with:
10+
toolchain: nightly-2025-04-15
11+
components: rust-src
12+
targets: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu,riscv64gc-unknown-linux-gnu,armv7-unknown-linux-gnueabihf
13+
14+
- name: Install cross-compiling GCC
15+
shell: bash
16+
run: |
17+
sudo apt install -y gcc-aarch64-linux-gnu gcc-riscv64-linux-gnu gcc-arm-linux-gnueabihf gcc-i686-linux-gnu
18+
19+
- name: Build binaries
20+
shell: bash
21+
run: |
22+
./tool/build_linux.sh x64
23+
./tool/build_linux.sh aarch64
24+
./tool/build_linux.sh x86
25+
./tool/build_linux.sh armv7
26+
./tool/build_linux.sh riscv64gc
27+
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: linux-library
31+
retention-days: 14
32+
path: |
33+
libpowersync_x64.so
34+
libpowersync_x86.so
35+
libpowersync_aarch64.so
36+
libpowersync_armv7.so
37+
libpowersync_riscv64gc.so

.github/actions/macos/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Build macoS libraries"
2+
description: "Create artifact for macOS libraries"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install Rust Nightly
8+
uses: dtolnay/rust-toolchain@stable
9+
with:
10+
toolchain: nightly-2025-04-15
11+
components: rust-src
12+
targets: x86_64-apple-darwin,aarch64-apple-darwin
13+
14+
- name: Build binaries
15+
shell: bash
16+
run: |
17+
./tool/build_macos.sh x64
18+
./tool/build_macos.sh aarch64
19+
20+
- uses: actions/upload-artifact@v4
21+
with:
22+
name: macos-library
23+
retention-days: 14
24+
path: |
25+
libpowersync_x64.dylib
26+
libpowersync_aarch64.dylib

.github/actions/wasm/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Build wasm libraries"
2+
description: "Create artifact for wasm libraries"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install Rust Nightly
8+
uses: dtolnay/rust-toolchain@stable
9+
with:
10+
toolchain: nightly-2025-04-15
11+
components: rust-src
12+
13+
- name: Setup emsdk
14+
uses: mymindstorm/setup-emsdk@v14
15+
with:
16+
version: 4.0.10
17+
18+
- name: Build WASM
19+
shell: bash
20+
run: ./tool/build_wasm.sh
21+
22+
- uses: actions/upload-artifact@v4
23+
with:
24+
name: wasm-library
25+
retention-days: 14
26+
path: |
27+
libpowersync-async.wasm
28+
libpowersync.wasm
29+
libpowersync-wasm.a

.github/actions/windows/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Build Windows libraries"
2+
description: "Create artifact for Windows libraries"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install Rust Nightly
8+
uses: dtolnay/rust-toolchain@stable
9+
with:
10+
toolchain: nightly-2025-04-15
11+
components: rust-src
12+
targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc,i686-pc-windows-msvc
13+
14+
- name: Build binaries
15+
shell: bash
16+
run: |
17+
./tool/build_windows.sh x64
18+
./tool/build_windows.sh aarch64
19+
./tool/build_windows.sh x86
20+
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: windows-library
24+
retention-days: 14
25+
path: |
26+
powersync_x64.dll
27+
powersync_aarch64.dll
28+
powersync_x86.dll
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Build xcframework"
2+
description: "Create artifact with XCFramework for apple targets"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Setup
8+
shell: bash
9+
run: |
10+
rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin
11+
rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin
12+
rustup target add \
13+
x86_64-apple-darwin \
14+
aarch64-apple-darwin \
15+
aarch64-apple-ios \
16+
aarch64-apple-ios-sim \
17+
x86_64-apple-ios
18+
19+
- name: setup-cocoapods
20+
uses: maxim-lobanov/setup-cocoapods@v1
21+
with:
22+
version: 1.16.2
23+
24+
- name: Set up XCode
25+
uses: maxim-lobanov/setup-xcode@v1
26+
with:
27+
xcode-version: latest-stable
28+
29+
- name: Build iOS & macOS xcframework
30+
shell: bash
31+
run: |
32+
./tool/build_xcframework.sh
33+
34+
- name: Lint pod
35+
shell: bash
36+
run: |
37+
pod lib lint
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: xcframework
42+
retention-days: 14
43+
compression: 0 # We're uploading a zip archive, no need to compress agan
44+
path: |
45+
powersync-sqlite-core.xcframework.zip

.github/workflows/android.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ios.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/linux.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)