Skip to content

KMMBridge-Release

KMMBridge-Release #2

name: KMMBridge-Release
on:
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
kmmbridgepublish:
concurrency: "kmmbridgepublish-${{ github.repository }}"
runs-on: macos-latest
steps:
- name: Checkout the repo with tags
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: touchlab/[email protected]
id: versionPropertyValue
with:
file: ./gradle.properties
property: LIBRARY_VERSION
- name: Print versionPropertyValue
run: echo "${{ steps.versionPropertyValue.outputs.propVal }}"
- uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: 17
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Cache build tooling
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.konan
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}
- name: Create or Find Artifact Release
id: devrelease
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ steps.versionPropertyValue.outputs.propVal }}
- name: Build and Publish
run: |
./gradlew \
:openai-client:openai-client-darwin:kmmBridgePublish \
:anthropic-client:anthropic-client-darwin:kmmBridgePublish \
:gemini-client:gemini-client-darwin:kmmBridgePublish \
:ollama-client:ollama-client-darwin:kmmBridgePublish \
:openai-gateway:openai-gateway-darwin:kmmBridgePublish \
-PENABLE_PUBLISHING=true \
-PGITHUB_ARTIFACT_RELEASE_ID=${{ steps.devrelease.outputs.id }} \
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-PGITHUB_REPO=${{ github.repository }} \
--no-configuration-cache --no-daemon --info --stacktrace
env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
- uses: touchlab/ga-update-release-tag@v1
with:
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}