-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: Setup KMMBridge, test gh action
- Loading branch information
1 parent
223c3b2
commit 84898ed
Showing
15 changed files
with
228 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: iOS Publish | ||
on: | ||
workflow_dispatch: | ||
# push: | ||
# branches: | ||
# - "main" | ||
jobs: | ||
call-kmmbridge-publish: | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected] | ||
with: | ||
jvmVersion: 17 | ||
versionBaseProperty: LIBRARY_VERSION | ||
# secrets: | ||
# PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,18 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Deploy to Sonatype | ||
|
||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
|
||
name: All Publish | ||
on: | ||
workflow_dispatch: | ||
# push: | ||
# branches: | ||
# - "main" | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/gradle.yml | ||
deploy: | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- target: publishIosArm64PublicationToSonatypeRepository | ||
os: macos-latest | ||
- target: publishAndroidDebugPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishAndroidReleasePublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishKotlinMultiplatformPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.konan | ||
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Gradle publish | ||
run: | | ||
./gradlew \ | ||
${{ matrix.target }} \ | ||
closeSonatypeStagingRepository \ | ||
-Psigning.gnupg.passphrase='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}' \ | ||
-Psigning.gnupg.keyName='${{secrets.OSSRH_GPG_SECRET_KEY_ID}}' \ | ||
-PsonatypeUsername='${{secrets.OSSRH_USERNAME}}' \ | ||
-PsonatypePassword='${{secrets.OSSRH_PASSWORD}}' | ||
call-kmmbridge-publish: | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected] | ||
with: | ||
jvmVersion: 17 | ||
versionBaseProperty: LIBRARY_VERSION | ||
publishTask: kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository | ||
# secrets: | ||
# PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Deploy to Sonatype | ||
|
||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/gradle.yml | ||
deploy: | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- target: publishIosArm64PublicationToSonatypeRepository | ||
os: macos-latest | ||
- target: publishAndroidDebugPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishAndroidReleasePublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishKotlinMultiplatformPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.konan | ||
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Gradle publish | ||
run: | | ||
./gradlew \ | ||
${{ matrix.target }} \ | ||
closeSonatypeStagingRepository \ | ||
-Psigning.gnupg.passphrase='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}' \ | ||
-Psigning.gnupg.keyName='${{secrets.OSSRH_GPG_SECRET_KEY_ID}}' \ | ||
-PsonatypeUsername='${{secrets.OSSRH_USERNAME}}' \ | ||
-PsonatypePassword='${{secrets.OSSRH_PASSWORD}}' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// swift-tools-version:5.3 | ||
import PackageDescription | ||
|
||
let packageName = "allshared" | ||
|
||
let package = Package( | ||
name: packageName, | ||
platforms: [ | ||
.iOS(.v13) | ||
], | ||
products: [ | ||
.library( | ||
name: packageName, | ||
targets: [packageName] | ||
), | ||
], | ||
targets: [ | ||
.binaryTarget( | ||
name: packageName, | ||
path: "./allshared/build/XCFrameworks/debug/\(packageName).xcframework" | ||
) | ||
, | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'allshared' | ||
spec.version = '0.1' | ||
spec.homepage = 'https://www.touchlab.co' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = '' | ||
spec.summary = 'PowerSyncKMMBridgetSKIE' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/allshared.framework' | ||
|
||
spec.ios.deployment_target = '13.5' | ||
|
||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => ':allshared', | ||
'PRODUCT_MODULE_NAME' => 'allshared', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build allshared', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
spec.libraries = 'c++', 'sqlite3' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.kmmbridge) | ||
alias(libs.plugins.skie) | ||
alias(libs.plugins.mavenPublishPlugin) | ||
} | ||
|
||
kotlin { | ||
|
||
listOf( | ||
// iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
export(project(":core")) | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(project(":core")) | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "githubPackages" | ||
url = project.uri("https://maven.pkg.github.com/powersync-ja/powersync-kotlin-sdk") | ||
credentials(PasswordCredentials::class) | ||
} | ||
} | ||
} | ||
|
||
kmmbridge { | ||
mavenPublishArtifacts() | ||
spm() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.powersync.allshared"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.