Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 3 additions & 43 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,8 @@ permissions:
jobs:
test:
uses: ./.github/workflows/test.yml
build-native:
name: Build native lib
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install cross-compiler
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Build native lib
run: |
./gradlew \
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-Ppowersync.binaries.cross-arch=true \
:core:cmakeJvmBuild
shell: bash
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}
path: core/build/binaries/desktop/sqlite/
deploy:
needs: [test, build-native]
needs: [test]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -58,14 +25,7 @@ jobs:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Download native binaries
uses: actions/download-artifact@v4
with:
path: core/binaries/desktop
merge-multiple: true
- name: Display downloaded files
run: ls -lR core/binaries/desktop
uses: gradle/actions/setup-gradle@v4
- name: Gradle publish
run: |
./gradlew \
Expand All @@ -75,7 +35,7 @@ jobs:
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
-PcentralPortal.username="${{secrets.SONATYPE_USERNAME}}" \
-PcentralPortal.password="${{secrets.SONATYPE_PASSWORD}}" \
-Ppowersync.binaries.provided="true" \
-Ppowersync.binaries.allPlatforms="true" \
publishAllPublicationsToSonatypeRepository
shell: bash
# This will change Package.swift in Github packages to direct to new maven central KMMBridge zip file
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.0-BETA26

* Support bucket priorities and partial syncs.
* Android: Add ProGuard rules to prevent methods called through JNI from being minified or removed.

## 1.0.0-BETA25

* JVM: Lower minimum supported version from 17 to 8.
Expand Down
26 changes: 13 additions & 13 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,23 @@ val buildCInteropDef by tasks.registering {

val binariesFolder = project.layout.buildDirectory.dir("binaries/desktop")
val downloadPowersyncDesktopBinaries by tasks.registering(Download::class) {
description = "Download PowerSync core extensions for JVM builds and releases"

val coreVersion = libs.versions.powersync.core.get()
val linux_aarch64 = "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v$coreVersion/libpowersync_aarch64.so"
val linux_x64 = "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v$coreVersion/libpowersync_x64.so"
val macos_aarch64 = "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v$coreVersion/libpowersync_aarch64.dylib"
val macos_x64 = "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v$coreVersion/libpowersync_x64.dylib"
val windows_x64 = "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v$coreVersion/powersync_x64.dll"

if (binariesAreProvided) {
val includeAllPlatformsForJvmBuild = project.findProperty("powersync.binaries.allPlatforms") == "true"
val os = OperatingSystem.current()

// The jar we're releasing for JVM clients needs to include the core extension. For local tests, it's enough to only
// download the extension for the OS running the build. For releases, we want to include them all.
// We're not compiling native code for JVM builds here (we're doing that for Android only), so we just have to
// fetch prebuilt binaries from the powersync-sqlite-core repository.
if (includeAllPlatformsForJvmBuild) {
src(listOf(linux_aarch64, linux_x64, macos_aarch64, macos_x64, windows_x64))
} else {
val (aarch64, x64) = when {
Expand All @@ -96,10 +105,9 @@ val downloadPowersyncDesktopBinaries by tasks.registering(Download::class) {
else -> error("Unknown operating system: $os")
}
val arch = System.getProperty("os.arch")
src(when {
crossArch -> listOfNotNull(aarch64, x64)
arch == "aarch64" -> listOfNotNull(aarch64)
arch == "amd64" || arch == "x86_64" -> listOfNotNull(x64)
src(when (arch) {
"aarch64" -> listOfNotNull(aarch64)
"amd64", "x86_64" -> listOfNotNull(x64)
else -> error("Unsupported architecture: $arch")
})
}
Expand Down Expand Up @@ -297,14 +305,6 @@ android {
}
}

val os = OperatingSystem.current()
val binariesAreProvided = project.findProperty("powersync.binaries.provided") == "true"
val crossArch = project.findProperty("powersync.binaries.cross-arch") == "true"

if (binariesAreProvided && crossArch) {
error("powersync.binaries.provided and powersync.binaries.cross-arch must not be both defined.")
}

tasks.named<ProcessResources>(kotlin.jvm().compilations["main"].processResourcesTaskName) {
from(downloadPowersyncDesktopBinaries)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ development=true
RELEASE_SIGNING_ENABLED=true
# Library config
GROUP=com.powersync
LIBRARY_VERSION=1.0.0-BETA25
LIBRARY_VERSION=1.0.0-BETA26
GITHUB_REPO=https://github.com/powersync-ja/powersync-kotlin.git
# POM
POM_URL=https://github.com/powersync-ja/powersync-kotlin/
Expand Down
Loading