-
Notifications
You must be signed in to change notification settings - Fork 216
67 lines (57 loc) · 2.31 KB
/
Copy pathcreate_swift_package.yml
File metadata and controls
67 lines (57 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Based on: https://github.com/touchlab/KMMBridgeSPMQuickStart/blob/main/.github/workflows/Base-Publish.yml
# Publishes the release XCFrameworks to a GitHub Release.
# For debugging Kotlin from Xcode, build a debug XCFramework locally with
# `./gradlew <module>:spmDevBuild` instead.
name: Base-Publish
on:
workflow_call:
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@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Retrieve Version
id: versionPropertyValue
run: |
VERSION=$(grep -E '^store[[:space:]]*=' gradle/libs.versions.toml | head -1 | cut -d'"' -f2)
echo "propVal=$VERSION" >> $GITHUB_OUTPUT
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: Create or Find Artifact Release
id: devrelease
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ steps.versionPropertyValue.outputs.propVal }}"
- name: Build and Publish
run: |
./gradlew kmmBridgePublish \
-PNATIVE_BUILD_TYPE=RELEASE \
-PGITHUB_ARTIFACT_RELEASE_ID=${{ steps.devrelease.outputs.id }} \
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-PGITHUB_REPO=${{ github.repository }} \
-PENABLE_PUBLISHING=true \
--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 }}