Skip to content

Commit 0e4e596

Browse files
committed
Merge branch 'main' into sqlite-randomness
2 parents 9a593b5 + 199c67c commit 0e4e596

15 files changed

+149
-27
lines changed

.cargo/config renamed to .cargo/config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ rustflags = [
1818
"-C", "link-arg=-lgcc_eh",
1919
]
2020

21+
[target.aarch64-unknown-linux-gnu]
22+
rustflags = [
23+
"-C", "link-arg=-lgcc_eh",
24+
]
25+
2126

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

.github/workflows/android.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on:
22
push:
3-
pull_request:
3+
tags:
4+
- "*"
45
name: "android"
56
jobs:
67
build:
@@ -13,8 +14,8 @@ jobs:
1314

1415
- uses: actions/setup-java@v3
1516
with:
16-
distribution: 'temurin'
17-
java-version: '17'
17+
distribution: "temurin"
18+
java-version: "17"
1819

1920
- uses: nttld/setup-ndk@v1
2021
with:
@@ -25,8 +26,8 @@ jobs:
2526

2627
- name: Setup
2728
run: |
28-
rustup toolchain install nightly-2023-08-28-x86_64-unknown-linux-gnu
29-
rustup component add rust-src --toolchain nightly-2023-08-28-x86_64-unknown-linux-gnu
29+
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu
30+
rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu
3031
rustup target add \
3132
aarch64-linux-android \
3233
armv7-linux-androideabi \

.github/workflows/ios.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on:
22
push:
3-
pull_request:
3+
tags:
4+
- "*"
45
name: "ios"
56
jobs:
67
build:
@@ -13,8 +14,8 @@ jobs:
1314

1415
- name: Setup
1516
run: |
16-
rustup toolchain install nightly-2023-08-28-x86_64-apple-darwin
17-
rustup component add rust-src --toolchain nightly-2023-08-28-x86_64-apple-darwin
17+
rustup toolchain install nightly-2024-05-18-aarch64-apple-darwin
18+
rustup component add rust-src --toolchain nightly-2024-05-18-aarch64-apple-darwin
1819
rustup target add \
1920
x86_64-apple-darwin \
2021
aarch64-apple-darwin \

.github/workflows/linux.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
name: "linux"
6+
jobs:
7+
build_x86_64:
8+
name: Building Linux x86_64
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
submodules: true
14+
15+
- name: Install Rust Nightly
16+
uses: dtolnay/rust-toolchain@stable
17+
with:
18+
toolchain: nightly-2024-05-18
19+
components: rust-src
20+
21+
- name: Build binaries
22+
run: bash tool/build_linux.sh x64

.github/workflows/release.yml

+54-6
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ jobs:
4242

4343
- uses: actions/setup-java@v3
4444
with:
45-
distribution: 'temurin'
46-
java-version: '17'
45+
distribution: "temurin"
46+
java-version: "17"
4747

4848
- uses: nttld/setup-ndk@v1
4949
with:
5050
ndk-version: r26
5151

5252
- name: Setup
5353
run: |
54-
rustup toolchain install nightly-2023-08-28-x86_64-unknown-linux-gnu
55-
rustup component add rust-src --toolchain nightly-2023-08-28-x86_64-unknown-linux-gnu
54+
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu
55+
rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu
5656
rustup target add \
5757
aarch64-linux-android \
5858
armv7-linux-androideabi \
@@ -82,8 +82,8 @@ jobs:
8282

8383
- name: Setup
8484
run: |
85-
rustup toolchain install nightly-2023-08-28-x86_64-apple-darwin
86-
rustup component add rust-src --toolchain nightly-2023-08-28-x86_64-apple-darwin
85+
rustup toolchain install nightly-2024-05-18-aarch64-apple-darwin
86+
rustup component add rust-src --toolchain nightly-2024-05-18-aarch64-apple-darwin
8787
rustup target add \
8888
x86_64-apple-darwin \
8989
aarch64-apple-darwin \
@@ -110,3 +110,51 @@ jobs:
110110
GH_REPO: ${{ github.repository }}
111111
run: |
112112
gh release upload "${{ needs.draft_release.outputs.tag }}" powersync-sqlite-core.xcframework.tar.xz
113+
114+
publish_linux_x86_64:
115+
name: Publish Linux x86_64
116+
needs: [draft_release]
117+
runs-on: ubuntu-latest
118+
steps:
119+
- uses: actions/checkout@v3
120+
with:
121+
submodules: true
122+
123+
- name: Install Rust Nightly
124+
uses: dtolnay/rust-toolchain@stable
125+
with:
126+
toolchain: nightly-2024-05-18
127+
components: rust-src
128+
129+
- name: Build binaries
130+
run: bash tool/build_linux.sh x64
131+
132+
- name: Upload binary
133+
uses: svenstaro/upload-release-action@v2
134+
with:
135+
repo_token: ${{ secrets.GITHUB_TOKEN }}
136+
overwrite: true
137+
file: libpowersync_x64.so
138+
asset_name: libpowersync_x64.so
139+
tag: ${{ needs.draft_release.outputs.tag }}
140+
141+
publish_windows_x64:
142+
name: Publish Windows x64
143+
needs: [draft_release]
144+
runs-on: windows-latest
145+
steps:
146+
- uses: actions/checkout@v3
147+
with:
148+
submodules: true
149+
150+
- name: Build binary
151+
run: bash tool/build_windows.sh x64
152+
153+
- name: Upload binary x64
154+
uses: svenstaro/upload-release-action@v2
155+
with:
156+
repo_token: ${{ secrets.GITHUB_TOKEN }}
157+
overwrite: true
158+
file: powersync_x64.dll
159+
asset_name: powersync_x64.dll
160+
tag: ${{ needs.draft_release.outputs.tag }}

.github/workflows/windows.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
name: "windows"
6+
jobs:
7+
build_windows:
8+
name: Building Windows
9+
runs-on: windows-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
submodules: true
14+
15+
- name: Build binary
16+
run: bash tool/build_windows.sh x64

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inherits = "release"
2525
lto = false
2626

2727
[workspace.package]
28-
version = "0.1.6"
28+
version = "0.1.7"
2929
edition = "2021"
3030
authors = ["JourneyApps"]
3131
keywords = ["sqlite", "powersync"]

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,23 @@ SELECT powersync_init();
3131

3232
# Building and running
3333

34+
Initialize submodules recursively
35+
36+
```
37+
git submodule update --init --recursive
38+
```
39+
3440
```sh
3541
# Build the shell
36-
cargo build -t powersync_sqlite
42+
cargo build -p powersync_sqlite
3743
./target/debug/powersync_sqlite test.db "select powersync_rs_version()"
3844

3945
# Build the loadable extension
4046
cargo build -p powersync_loadable
41-
sqlite3 ":memory:" ".load ./target/debug/libpowersync" "select powersync_rs_version()"
47+
sqlite3 ":memory:" ".load ./target/debug/libpowersync" "select powersync_rs_version()" #This requires sqlite3 installed
48+
49+
# Build the release loadable extension
50+
cargo build -p powersync_loadable --release
4251

4352
# Build for iOS
4453
./all-ios-loadable.sh

android/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "co.powersync"
10-
version = "0.1.6"
10+
version = "0.1.7"
1111
description = "PowerSync Core SQLite Extension"
1212

1313
repositories {
@@ -44,7 +44,7 @@ android {
4444
namespace = "co.powersync.sqlitecore"
4545

4646
defaultConfig {
47-
minSdk = 24
47+
minSdk = 21
4848
}
4949

5050
sourceSets {

build-pod.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function createXcframework() {
2828
<key>MinimumOSVersion</key>
2929
<string>11.0</string>
3030
<key>CFBundleVersion</key>
31-
<string>0.1.6</string>
31+
<string>0.1.7</string>
3232
<key>CFBundleShortVersionString</key>
33-
<string>0.1.6</string>
33+
<string>0.1.7</string>
3434
</dict>
3535
</plist>
3636
EOF

powersync-sqlite-core.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'powersync-sqlite-core'
3-
s.version = '0.1.6'
3+
s.version = '0.1.7'
44
s.summary = 'PowerSync SQLite Extension'
55
s.description = <<-DESC
66
PowerSync extension for SQLite.

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "nightly-2023-08-28"
2+
channel = "nightly-2024-05-18"

tool/build_linux.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
#Note: aarch64-unknown-linux-gnu has not been tested.
7+
rustup target add aarch64-unknown-linux-gnu
8+
cargo build -p powersync_loadable --release
9+
mv "target/release/libpowersync.so" "libpowersync_aarch64.so"
10+
fi

tool/build_windows.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
#Note: aarch64-pc-windows-msvc has not been tested.
7+
rustup target add aarch64-pc-windows-msvc
8+
cargo build -p powersync_loadable --release
9+
mv "target/release/powersync.dll" "powersync_aarch64.dll"
10+
fi

0 commit comments

Comments
 (0)