Skip to content

Commit d8d865a

Browse files
committed
Update build workflow
1 parent 0c9f65c commit d8d865a

File tree

3 files changed

+103
-18
lines changed

3 files changed

+103
-18
lines changed
Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,55 @@
11
name: KMMBridge Android and iOS Publish
22
on:
33
workflow_dispatch:
4+
45
jobs:
5-
call-kmmbridge-publish:
6-
permissions:
7-
contents: write
8-
packages: write
9-
uses: touchlab/KMMBridge/.github/workflows/spmbuildpublish.yml@kpg/kmmbridge-1.0
10-
with:
11-
jvmVersion: 17
12-
publishTask: kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository
13-
versionProperty: LIBRARY_VERSION
6+
kmmbridgepublish:
7+
concurrency: "kmmbridgepublish-${{ github.repository }}"
8+
runs-on: ${{ inputs.runsOn }}
9+
steps:
10+
- name: Checkout the repo with tags
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
fetch-tags: true
15+
16+
- uses: touchlab/read-property@0.1
17+
id: versionPropertyValue
18+
with:
19+
file: ./gradle.properties
20+
property: LIBRARY_VERSION
21+
22+
- name: Print versionPropertyValue
23+
id: output
24+
run: echo "${{ steps.versionPropertyValue.outputs.propVal }}"
25+
26+
- name: Touchlab Sample Sanity Check (Ignore this for your CI)
27+
uses: touchlab/sample-group-sanity-check@main
28+
29+
- uses: actions/setup-java@v2
30+
with:
31+
distribution: "adopt"
32+
java-version: 17
33+
34+
- name: Validate Gradle Wrapper
35+
uses: gradle/wrapper-validation-action@v1
36+
37+
- name: Cache build tooling
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.gradle/caches
42+
~/.konan
43+
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}
44+
45+
- name: Build Main
46+
run: ./gradlew kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} --no-daemon --info --stacktrace
47+
env:
48+
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
49+
50+
- uses: touchlab/ga-update-release-tag@v1
51+
id: update-release-tag
52+
with:
53+
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
54+
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
55+
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}
Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,55 @@
11
name: KMMBridge iOS Publish
22
on:
33
workflow_dispatch:
4+
45
jobs:
5-
call-kmmbridge-publish:
6-
permissions:
7-
contents: write
8-
packages: write
9-
uses: touchlab/KMMBridge/.github/workflows/spmbuildpublish.yml@kpg/kmmbridge-1.0
10-
with:
11-
jvmVersion: 17
12-
versionProperty: LIBRARY_VERSION
6+
kmmbridgepublish:
7+
concurrency: "kmmbridgepublish-${{ github.repository }}"
8+
runs-on: ${{ inputs.runsOn }}
9+
steps:
10+
- name: Checkout the repo with tags
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
fetch-tags: true
15+
16+
- uses: touchlab/read-property@0.1
17+
id: versionPropertyValue
18+
with:
19+
file: ./gradle.properties
20+
property: LIBRARY_VERSION
21+
22+
- name: Print versionPropertyValue
23+
id: output
24+
run: echo "${{ steps.versionPropertyValue.outputs.propVal }}"
25+
26+
- name: Touchlab Sample Sanity Check (Ignore this for your CI)
27+
uses: touchlab/sample-group-sanity-check@main
28+
29+
- uses: actions/setup-java@v2
30+
with:
31+
distribution: "adopt"
32+
java-version: 17
33+
34+
- name: Validate Gradle Wrapper
35+
uses: gradle/wrapper-validation-action@v1
36+
37+
- name: Cache build tooling
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.gradle/caches
42+
~/.konan
43+
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}
44+
45+
- name: Build Main
46+
run: ./gradlew kmmBridgePublish -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} --no-daemon --info --stacktrace
47+
env:
48+
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
49+
50+
- uses: touchlab/ga-update-release-tag@v1
51+
id: update-release-tag
52+
with:
53+
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
54+
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
55+
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ kotlin.code.style=official
22
android.useAndroidX=true
33
org.gradle.jvmargs=-Xmx4g
44

5-
LIBRARY_VERSION=0.1.1
5+
LIBRARY_VERSION=0.1.2
66
GROUP=co.touchlab.kmmbridgespmquickstart

0 commit comments

Comments
 (0)