Skip to content

Deploy to Sonatype

Deploy to Sonatype #61

Workflow file for this run

name: Deploy to Sonatype
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
uses: ./.github/workflows/gradle.yml
deploy:
needs: build
strategy:
matrix:
include:
- target: publishAllPublicationsToSonatypeRepository
os: macos-latest
# FIXME: Our custom gradle plugin does not currently setup platform specific tasks
# - 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@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- 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 }} \
-PGITHUB_PUBLISH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
-PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
-PcentralPortal.username="${{secrets.SONATYPE_USERNAME}}" \
-PcentralPortal.password="${{secrets.SONATYPE_PASSWORD}}"
# This will change Package.swift in Github packages to direct to new maven central KMMBridge zip file
call-kmmbridge-publish:
needs: deploy
permissions:
contents: write
packages: write
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected]
with:
jvmVersion: 17
versionBaseProperty: LIBRARY_VERSION
publishTask: kmmBridgePublish
secrets:
gradle_params: -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" -PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" -PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}"