File tree Expand file tree Collapse file tree 4 files changed +70
-29
lines changed Expand file tree Collapse file tree 4 files changed +70
-29
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ inputs:
1414runs :
1515 using : " composite"
1616 steps :
17- - uses : actions/setup-java@v4
17+ - uses : actions/setup-java@v5
1818 with :
1919 distribution : " temurin"
20- java-version : " 17 "
20+ java-version : " 25 "
2121
2222 - name : Validate Gradle wrapper
2323 uses : gradle/actions/wrapper-validation@v4
3939 if : ${{ inputs.sign-publication == '1' }}
4040 run : |
4141 cd android
42- ./gradlew build zipPublication -PgpgKey=${{ inputs.gpg-key }} -PgpgPassword=${{ inputs.gpg-password }}
42+ ./gradlew build zipPublication -PgpgKey=${{ inputs.gpg-key }} -PgpgPassword=${{ inputs.gpg-password }}
4343 ls -lh build/outputs/aar
4444 find build/repository
4545
6060 compression-level : 0 # We're uploading a zip, no need to compress again
6161 path : android/build/distributions/powersync_android.zip
6262 if-no-files-found : error
63+
64+ - name : Copy static libraries
65+ shell : bash
66+ run : |
67+ cp target/aarch64-linux-android/release/libpowersync.a libpowersync_aarch64.android.a
68+ cp target/armv7-linux-androideabi/release/libpowersync.a libpowersync_armv7.android.a
69+ cp target/i686-linux-android/release/libpowersync.a libpowersync_x86.android.a
70+ cp target/x86_64-linux-android/release/libpowersync.a libpowersync_x64.android.a
71+
72+ - name : Upload static libraries
73+ uses : actions/upload-artifact@v4
74+ with :
75+ name : android-static
76+ retention-days : 14
77+ path : |
78+ *.a
Original file line number Diff line number Diff line change @@ -179,18 +179,26 @@ jobs:
179179 with :
180180 submodules : true
181181
182- - name : Download libs
182+ - name : Download Linux libraries
183183 uses : actions/download-artifact@v5
184184 with :
185185 name : linux-library
186- - name : Download libs
186+ - name : Download macOS libraries
187187 uses : actions/download-artifact@v5
188188 with :
189189 name : macos-library
190- - name : Download libs
190+ - name : Download Windows libraries
191+ uses : actions/download-artifact@v5
192+ with :
193+ name : windows-library
194+ - name : Download Windows libraries
191195 uses : actions/download-artifact@v5
192196 with :
193197 name : windows-library
198+ - name : Download static Android libraries
199+ uses : actions/download-artifact@v5
200+ with :
201+ name : android-static
194202
195203 - name : List libraries
196204 run : ls -al
Original file line number Diff line number Diff line change 1- import org.gradle.tooling.BuildException
21import java.util.Base64
32import java.util.Properties
43import kotlin.io.path.Path
@@ -54,30 +53,48 @@ fun ndkPath(): String {
5453 error(" Expected an NDK 28 or later installation in $ndks " )
5554}
5655
57- val buildRust = tasks.register< Exec >( " buildRust " ) {
56+ fun Exec. rustCompilation ( project : String , output : String? = null ) {
5857 group = " build"
5958 environment(" ANDROID_NDK_HOME" , ndkPath())
6059
6160 workingDir(" .." )
62- commandLine(
63- " cargo" ,
64- " ndk" ,
65- " -t" ,
66- " armeabi-v7a" ,
67- " -t" ,
68- " arm64-v8a" ,
69- " -t" ,
70- " x86" ,
71- " -t" ,
72- " x86_64" ,
73- " -o" ,
74- " ./android/build/intermediates/jniLibs" ,
75- " build" ,
76- " --release" ,
77- " -Zbuild-std" ,
78- " -p" ,
79- " powersync_loadable"
80- )
61+ val args = buildList<String > {
62+ this + = listOf (
63+ " cargo" ,
64+ " ndk" ,
65+ " -t" ,
66+ " armeabi-v7a" ,
67+ " -t" ,
68+ " arm64-v8a" ,
69+ " -t" ,
70+ " x86" ,
71+ " -t" ,
72+ " x86_64" ,
73+ )
74+
75+ output?.let {
76+ this + = " -o"
77+ this + = it
78+ }
79+
80+ this + = listOf (
81+ " build" ,
82+ " --release" ,
83+ " -Zbuild-std" ,
84+ " -p" ,
85+ project,
86+ )
87+ }
88+
89+ commandLine(args)
90+ }
91+
92+ val buildRust = tasks.register<Exec >(" buildRust" ) {
93+ rustCompilation(" powersync_loadable" , " ./android/build/intermediates/jniLibs" )
94+ }
95+
96+ val buildRustStatic = tasks.register<Exec >(" buildRustStatic" ) {
97+ rustCompilation(" powersync_static" )
8198}
8299
83100val prefabAar = tasks.register<Zip >(" prefabAar" ) {
@@ -199,5 +216,5 @@ val zipPublication by tasks.registering(Zip::class) {
199216}
200217
201218tasks.named(" build" ) {
202- dependsOn(prefabAar)
219+ dependsOn(prefabAar, buildRustStatic )
203220}
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.14.2 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-9.1.0 -bin.zip
44networkTimeout =10000
55validateDistributionUrl =true
66zipStoreBase =GRADLE_USER_HOME
You can’t perform that action at this time.
0 commit comments