Skip to content

Commit f7e0919

Browse files
committed
Build x64 and aarch64 for linux and windows
1 parent 8828f32 commit f7e0919

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

.github/workflows/linux.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ jobs:
1616
with:
1717
toolchain: nightly-2024-05-18
1818
components: rust-src
19-
targets: x86_64-unknown-linux-gnu
2019

21-
- name: Setup
22-
run: |
23-
cargo build -p powersync_loadable --release
24-
mv "target/release/libpowersync.so" "libpowersync_x64.so"
20+
- name: Build binaries
21+
run: bash tool/build_linux.sh x64
2522

2623
- name: Upload binary
2724
uses: svenstaro/upload-release-action@v2
@@ -32,25 +29,8 @@ jobs:
3229
asset_name: libpowersync_x64.so
3330
tag: v0.1.6
3431

35-
build_aarch64:
36-
name: Building Linux aarch64
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v3
40-
with:
41-
submodules: true
42-
43-
- name: Install Rust Nightly
44-
uses: dtolnay/rust-toolchain@stable
45-
with:
46-
toolchain: nightly-2024-05-18
47-
components: rust-src
48-
targets: aarch64-unknown-linux-gnu
49-
50-
- name: Setup
51-
run: |
52-
cargo build -p powersync_loadable --release --target aarch64-unknown-linux-gnu
53-
mv "target/release/libpowersync.so" "libpowersync_aarch64.so"
32+
- name: Build binaries
33+
run: bash tool/build_linux.sh
5434

5535
- name: Upload binary
5636
uses: svenstaro/upload-release-action@v2

.github/workflows/windows.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
targets: x86_64-pc-windows-msvc
2020

2121
- name: Setup
22-
run: |
23-
cargo build -p powersync_loadable --release
24-
mv "target/release/powersync.dll" "powersync_x64.dll"
22+
run: bash tool/build_windows.sh x64
2523

2624
- name: Upload binary
2725
uses: svenstaro/upload-release-action@v2
@@ -31,3 +29,15 @@ jobs:
3129
file: powersync_x64.dll
3230
asset_name: powersync_x64.dll
3331
tag: v0.1.6
32+
33+
- name: Setup
34+
run: bash tool/build_windows.sh
35+
36+
- name: Upload binary
37+
uses: svenstaro/upload-release-action@v2
38+
with:
39+
repo_token: ${{ secrets.GITHUB_TOKEN }}
40+
overwrite: true
41+
file: powersync_aarch64.dll
42+
asset_name: powersync_aarch64.dll
43+
tag: v0.1.6

tool/build_linux.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if [ "$1" = "x64" ]; then
2+
rustup target add target x86_64-unknown-linux-gnu
3+
cargo build -p powersync_loadable --release
4+
mv "target/release/libpowersync.so" "libpowersync_x64.so"
5+
else
6+
rustup target add aarch64-unknown-linux-gnu
7+
cargo build -p powersync_loadable --release
8+
mv "target/release/libpowersync.so" "libpowersync_aarch64.so"
9+
fi

tool/build_windows.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if [ "$1" = "x64" ]; then
2+
rustup target add x86_64-pc-windows-msvc
3+
cargo build -p powersync_loadable --release
4+
mv "target/release/powersync.dll" "powersync_x64.dll"
5+
else
6+
rustup target add aarch64-pc-windows-msvc
7+
cargo build -p powersync_loadable --release
8+
mv "target/release/powersync.dll" "powersync_aarch64.dll"
9+
fi

0 commit comments

Comments
 (0)