Skip to content

Commit

Permalink
Update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Aug 27, 2024
1 parent 0c9f65c commit d8d865a
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 18 deletions.
60 changes: 51 additions & 9 deletions .github/workflows/KMMBridge-Android-iOS-publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
name: KMMBridge Android and iOS Publish
on:
workflow_dispatch:

jobs:
call-kmmbridge-publish:
permissions:
contents: write
packages: write
uses: touchlab/KMMBridge/.github/workflows/spmbuildpublish.yml@kpg/kmmbridge-1.0
with:
jvmVersion: 17
publishTask: kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository
versionProperty: LIBRARY_VERSION
kmmbridgepublish:
concurrency: "kmmbridgepublish-${{ github.repository }}"
runs-on: ${{ inputs.runsOn }}
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
id: output
run: echo "${{ steps.versionPropertyValue.outputs.propVal }}"

- name: Touchlab Sample Sanity Check (Ignore this for your CI)
uses: touchlab/sample-group-sanity-check@main

- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: 17

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache build tooling
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.konan
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}

- name: Build Main
run: ./gradlew kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} --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
id: update-release-tag
with:
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}
59 changes: 51 additions & 8 deletions .github/workflows/KMMBridge-iOS-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
name: KMMBridge iOS Publish
on:
workflow_dispatch:

jobs:
call-kmmbridge-publish:
permissions:
contents: write
packages: write
uses: touchlab/KMMBridge/.github/workflows/spmbuildpublish.yml@kpg/kmmbridge-1.0
with:
jvmVersion: 17
versionProperty: LIBRARY_VERSION
kmmbridgepublish:
concurrency: "kmmbridgepublish-${{ github.repository }}"
runs-on: ${{ inputs.runsOn }}
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
id: output
run: echo "${{ steps.versionPropertyValue.outputs.propVal }}"

- name: Touchlab Sample Sanity Check (Ignore this for your CI)
uses: touchlab/sample-group-sanity-check@main

- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: 17

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache build tooling
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.konan
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}

- name: Build Main
run: ./gradlew kmmBridgePublish -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} --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
id: update-release-tag
with:
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ kotlin.code.style=official
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4g

LIBRARY_VERSION=0.1.1
LIBRARY_VERSION=0.1.2
GROUP=co.touchlab.kmmbridgespmquickstart

0 comments on commit d8d865a

Please sign in to comment.