Skip to content

Refactor CI build #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@
# 173K, loading works
# Conclusion: -lgcc_eh has no effect when using -Z build-std.

[target.x86_64-unknown-linux-gnu]
[target.'cfg(target_os = "linux")']
rustflags = [
"-C", "link-arg=-lgcc_eh",
]

[target.x86_64-unknown-linux-gnu]
linker = "x86_64-linux-gnu-gcc"

[target.i686-unknown-linux-gnu]
rustflags = [
"-C", "link-arg=-lgcc_eh",
]
linker = "i686-linux-gnu-gcc"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
rustflags = [
"-C", "link-arg=-lgcc_eh",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.riscv64gc-unknown-linux-gnu]
linker = "riscv64-linux-gnu-gcc"

# For iOS and macOS, we need to specify the minimum/target version.
# This must match the versions in the podspec file.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ runs:
uses: actions/upload-artifact@v4
with:
name: android-library
retention-days: 1
retention-days: 14
compression-level: 0 # We're uploading a zip, no need to compress again
path: android/build/distributions/powersync_android.zip
if-no-files-found: error
37 changes: 37 additions & 0 deletions .github/actions/linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Build Linux libraries"
description: "Create artifact for Linux libraries"

runs:
using: "composite"
steps:
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
targets: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu,riscv64gc-unknown-linux-gnu,armv7-unknown-linux-gnueabihf

- name: Install cross-compiling GCC
shell: bash
run: |
sudo apt install -y gcc-aarch64-linux-gnu gcc-riscv64-linux-gnu gcc-arm-linux-gnueabihf gcc-i686-linux-gnu

- name: Build binaries
shell: bash
run: |
./tool/build_linux.sh x64
./tool/build_linux.sh aarch64
./tool/build_linux.sh x86
./tool/build_linux.sh armv7
./tool/build_linux.sh riscv64gc

- uses: actions/upload-artifact@v4
with:
name: linux-library
retention-days: 14
path: |
libpowersync_x64.so
libpowersync_x86.so
libpowersync_aarch64.so
libpowersync_armv7.so
libpowersync_riscv64gc.so
26 changes: 26 additions & 0 deletions .github/actions/macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Build macoS libraries"
description: "Create artifact for macOS libraries"

runs:
using: "composite"
steps:
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
targets: x86_64-apple-darwin,aarch64-apple-darwin

- name: Build binaries
shell: bash
run: |
./tool/build_macos.sh x64
./tool/build_macos.sh aarch64

- uses: actions/upload-artifact@v4
with:
name: macos-library
retention-days: 14
path: |
libpowersync_x64.dylib
libpowersync_aarch64.dylib
29 changes: 29 additions & 0 deletions .github/actions/wasm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Build wasm libraries"
description: "Create artifact for wasm libraries"

runs:
using: "composite"
steps:
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src

- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.10

- name: Build WASM
shell: bash
run: ./tool/build_wasm.sh

- uses: actions/upload-artifact@v4
with:
name: wasm-library
retention-days: 14
path: |
libpowersync-async.wasm
libpowersync.wasm
libpowersync-wasm.a
28 changes: 28 additions & 0 deletions .github/actions/windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Build Windows libraries"
description: "Create artifact for Windows libraries"

runs:
using: "composite"
steps:
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc,i686-pc-windows-msvc

- name: Build binaries
shell: bash
run: |
./tool/build_windows.sh x64
./tool/build_windows.sh aarch64
./tool/build_windows.sh x86

- uses: actions/upload-artifact@v4
with:
name: windows-library
retention-days: 14
path: |
powersync_x64.dll
powersync_aarch64.dll
powersync_x86.dll
45 changes: 45 additions & 0 deletions .github/actions/xcframework/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Build xcframework"
description: "Create artifact with XCFramework for apple targets"

runs:
using: "composite"
steps:
- name: Setup
shell: bash
run: |
rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin
rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin
rustup target add \
x86_64-apple-darwin \
aarch64-apple-darwin \
aarch64-apple-ios \
aarch64-apple-ios-sim \
x86_64-apple-ios

- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.16.2

- name: Set up XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Build iOS & macOS xcframework
shell: bash
run: |
./tool/build_xcframework.sh

- name: Lint pod
shell: bash
run: |
pod lib lint

- uses: actions/upload-artifact@v4
with:
name: xcframework
retention-days: 14
compression: 0 # We're uploading a zip archive, no need to compress agan
path: |
powersync-sqlite-core.xcframework.zip
17 changes: 0 additions & 17 deletions .github/workflows/android.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/ios.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/linux.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/macos.yml

This file was deleted.

Loading
Loading