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:
14
14
runs :
15
15
using : " composite"
16
16
steps :
17
- - uses : actions/setup-java@v4
17
+ - uses : actions/setup-java@v5
18
18
with :
19
19
distribution : " temurin"
20
- java-version : " 17 "
20
+ java-version : " 25 "
21
21
22
22
- name : Validate Gradle wrapper
23
23
uses : gradle/actions/wrapper-validation@v4
39
39
if : ${{ inputs.sign-publication == '1' }}
40
40
run : |
41
41
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 }}
43
43
ls -lh build/outputs/aar
44
44
find build/repository
45
45
60
60
compression-level : 0 # We're uploading a zip, no need to compress again
61
61
path : android/build/distributions/powersync_android.zip
62
62
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:
179
179
with :
180
180
submodules : true
181
181
182
- - name : Download libs
182
+ - name : Download Linux libraries
183
183
uses : actions/download-artifact@v5
184
184
with :
185
185
name : linux-library
186
- - name : Download libs
186
+ - name : Download macOS libraries
187
187
uses : actions/download-artifact@v5
188
188
with :
189
189
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
191
195
uses : actions/download-artifact@v5
192
196
with :
193
197
name : windows-library
198
+ - name : Download static Android libraries
199
+ uses : actions/download-artifact@v5
200
+ with :
201
+ name : android-static
194
202
195
203
- name : List libraries
196
204
run : ls -al
Original file line number Diff line number Diff line change 1
- import org.gradle.tooling.BuildException
2
1
import java.util.Base64
3
2
import java.util.Properties
4
3
import kotlin.io.path.Path
@@ -54,30 +53,48 @@ fun ndkPath(): String {
54
53
error(" Expected an NDK 28 or later installation in $ndks " )
55
54
}
56
55
57
- val buildRust = tasks.register< Exec >( " buildRust " ) {
56
+ fun Exec. rustCompilation ( project : String , output : String? = null ) {
58
57
group = " build"
59
58
environment(" ANDROID_NDK_HOME" , ndkPath())
60
59
61
60
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" )
81
98
}
82
99
83
100
val prefabAar = tasks.register<Zip >(" prefabAar" ) {
@@ -199,5 +216,5 @@ val zipPublication by tasks.registering(Zip::class) {
199
216
}
200
217
201
218
tasks.named(" build" ) {
202
- dependsOn(prefabAar)
219
+ dependsOn(prefabAar, buildRustStatic )
203
220
}
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =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
4
4
networkTimeout =10000
5
5
validateDistributionUrl =true
6
6
zipStoreBase =GRADLE_USER_HOME
You can’t perform that action at this time.
0 commit comments