Skip to content

Commit 53223d6

Browse files
authored
Merge pull request #2 from journeyapps/build-android
Android Builds
2 parents 40554dc + 9e85c85 commit 53223d6

17 files changed

+790
-28
lines changed

.github/workflows/android.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@ on:
44
name: "android"
55
jobs:
66
build:
7-
name: Building Android on ${{ matrix.os }}
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
include:
12-
- os: ubuntu-latest
7+
name: Building Android
8+
runs-on: ubuntu-latest
139
steps:
1410
- uses: actions/checkout@v3
1511
with:
1612
submodules: true
1713

14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'temurin'
17+
java-version: '17'
18+
1819
- uses: nttld/setup-ndk@v1
1920
with:
20-
ndk-version: r25c
21+
ndk-version: r26
22+
23+
- name: Validate Gradle wrapper
24+
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
2125

2226
- name: Setup
2327
run: |
@@ -32,4 +36,6 @@ jobs:
3236
3337
- name: Build for Android
3438
run: |
35-
cargo ndk -t armeabi-v7a -t arm64-v8a -o ./jniLibs build --release -Zbuild-std -p powersync_loadable
39+
cd android
40+
./gradlew build
41+
ls -lh build/outputs/aar

.github/workflows/ios.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ on:
44
name: "ios"
55
jobs:
66
build:
7-
name: Building iOS on ${{ matrix.os }}
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
include:
12-
- os: macos-latest
7+
name: Building iOS
8+
runs-on: macos-latest
139
steps:
1410
- uses: actions/checkout@v3
1511
with:

.github/workflows/release.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
jobs:
6+
draft_release:
7+
if: github.event_name == 'workflow_dispatch'
8+
name: Create Draft GitHub Release
9+
runs-on: ubuntu-latest
10+
outputs:
11+
tag: ${{ steps.tag.outputs.tag }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set tag name
18+
id: tag
19+
run: |
20+
tag=$(basename "${{ github.ref }}")
21+
echo "tag=$tag" >> $GITHUB_OUTPUT
22+
- name: Create Release
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
GH_REPO: ${{ github.repository }}
26+
run: |
27+
tag="${{ steps.tag.outputs.tag }}"
28+
body="Release $tag"
29+
gh release create --draft "$tag" --title "$tag" --notes "$body"
30+
31+
publish_android:
32+
permissions:
33+
contents: read
34+
packages: write
35+
name: Publish Android
36+
needs: [draft_release]
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
with:
41+
submodules: true
42+
43+
- uses: actions/setup-java@v3
44+
with:
45+
distribution: 'temurin'
46+
java-version: '17'
47+
48+
- uses: nttld/setup-ndk@v1
49+
with:
50+
ndk-version: r26
51+
52+
- name: Setup
53+
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
56+
rustup target add \
57+
aarch64-linux-android \
58+
armv7-linux-androideabi \
59+
x86_64-linux-android \
60+
i686-linux-android
61+
cargo install cargo-ndk
62+
63+
- name: Publish for Android
64+
run: |
65+
cd android
66+
./gradlew publish
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
70+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
71+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
72+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
73+
74+
publish_ios_pod:
75+
name: Publish iOS
76+
needs: [draft_release]
77+
runs-on: macos-latest
78+
steps:
79+
- uses: actions/checkout@v3
80+
with:
81+
submodules: true
82+
83+
- name: Setup
84+
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
87+
rustup target add \
88+
x86_64-apple-darwin \
89+
aarch64-apple-darwin \
90+
aarch64-apple-ios \
91+
aarch64-apple-ios-sim \
92+
x86_64-apple-ios
93+
94+
- name: setup-cocoapods
95+
uses: maxim-lobanov/setup-cocoapods@v1
96+
with:
97+
version: 1.12.1
98+
99+
- name: Build iOS & macOS xcframework
100+
run: |
101+
./build-pod.sh
102+
103+
- name: Lint pod
104+
run: |
105+
pod lib lint
106+
107+
- name: Upload xcframework
108+
env:
109+
GH_TOKEN: ${{ github.token }}
110+
GH_REPO: ${{ github.repository }}
111+
run: |
112+
gh release upload "${{ needs.draft_release.outputs.tag }}" powersync-sqlite-core.xcframework.tar.xz

.github/workflows/valgrind.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
name: "valgrind"
55
jobs:
66
build:
7-
name: Testing on ${{ matrix.os }}
7+
name: Testing with Valgrind on ${{ matrix.os }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
@@ -16,7 +16,7 @@ jobs:
1616
submodules: true
1717

1818
- name: Install valgrind
19-
run: sudo apt install -y valgrind
19+
run: sudo apt update && sudo apt install -y valgrind
2020

2121
- name: Install Cargo Valgrind
2222
run: |

Cargo.lock

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

Cargo.toml

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

2727
[workspace.package]
28-
version = "0.1.3"
28+
version = "0.1.4"
2929
edition = "2021"
3030
authors = ["JourneyApps"]
3131
keywords = ["sqlite", "powersync"]
32-
license = "Private"
32+
license = "Apache-2.0"
3333
homepage = "https://powersync.co"
34-
repository = "https://github.com/journeyapps/powersync-rs"
34+
repository = "https://github.com/journeyapps/powersync-sqlite-core"
3535

3636
[workspace.dependencies]
3737
sqlite_nostd = { path="./sqlite-rs-embedded/sqlite_nostd" }

0 commit comments

Comments
 (0)