Skip to content

Commit 7fd25cb

Browse files
committed
Add github publish action.
1 parent f56dc91 commit 7fd25cb

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

.github/workflows/android-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: android-publish
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
permissions:
8+
contents: read
9+
packages: write
10+
name: Publish Android
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
submodules: true
16+
17+
- uses: actions/setup-java@v3
18+
with:
19+
distribution: 'temurin'
20+
java-version: '17'
21+
22+
- uses: nttld/setup-ndk@v1
23+
with:
24+
ndk-version: r26
25+
26+
- name: Setup
27+
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
30+
rustup target add \
31+
aarch64-linux-android \
32+
armv7-linux-androideabi \
33+
x86_64-linux-android \
34+
i686-linux-android
35+
cargo install cargo-ndk
36+
37+
- name: Publish for Android
38+
run: |
39+
cd android
40+
./gradlew publish
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/android.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ 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:
@@ -24,6 +20,9 @@ jobs:
2420
with:
2521
ndk-version: r26
2622

23+
- name: Validate Gradle wrapper
24+
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
25+
2726
- name: Setup
2827
run: |
2928
rustup toolchain install nightly-2023-08-28-x86_64-unknown-linux-gnu

android/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ publishing {
117117
name = "here"
118118
url = uri("build/here/")
119119
}
120+
121+
maven {
122+
name = "GitHubPackages"
123+
url = uri("https://maven.pkg.github.com/journeyapps/powersync-sqlite-core")
124+
credentials {
125+
username = System.getenv("GITHUB_ACTOR")
126+
password = System.getenv("GITHUB_TOKEN")
127+
}
128+
}
120129
}
121130
}
122131

0 commit comments

Comments
 (0)