Update WorkFlow #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy WIth KMM Bridge Github Workflow | |
on: [push, pull_request] # or any other event | |
# Jobs : https://github.com/touchlab/KMMBridgeGithubWorkflow/blob/main/.github/workflows/faktorybuildautoversion.yml | |
jobs: | |
kmmbridgepublish: | |
concurrency: "kmmbridgepublish-${{ github.repository }}" | |
runs-on: macos-12 | |
steps: | |
- name: Checkout the repo with tags | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- uses: touchlab/[email protected] | |
id: versionBasePropertyValue | |
with: | |
file: ./gradle.properties | |
property: versionBaseProperty | |
- name: Print versionBasePropertyValue | |
id: output | |
run: echo "${{ steps.versionBasePropertyValue.outputs.propVal }}" | |
- name: Touchlab Sample Sanity Check (Ignore this for your CI) | |
uses: touchlab/[email protected] | |
- uses: touchlab/autoversion-nextversion@main | |
id: autoversion | |
with: | |
versionBase: ${{ steps.versionBasePropertyValue.outputs.propVal }} | |
- name: Print Next Version | |
id: outputversion | |
run: echo "${{ steps.autoversion.outputs.nextVersion }}" | |
- uses: touchlab/autoversion-tagmarker@main | |
id: autoversion-tagmarker | |
with: | |
nextVersion: ${{ steps.autoversion.outputs.nextVersion }} | |
- uses: touchlab/autoversion-buildbranch@main | |
id: autoversion-buildbranch | |
with: | |
buildBranch: "build-${{ steps.autoversion.outputs.nextVersion }}" | |
- name: Apply SSH Key | |
if: ${{ env.PODSPEC_SSH_KEY_EXISTS == 'true' }} | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.PODSPEC_SSH_KEY }} | |
- uses: extractions/netrc@v1 | |
with: | |
machine: trunk.cocoapods.org | |
username: ${{ secrets.COCOAPODS_EMAIL }} | |
password: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
- uses: extractions/netrc@v1 | |
with: | |
machine: maven.pkg.github.com | |
username: ${{ secrets.netrcUsername != '' && secrets.netrcUsername || 'cirunner' }} | |
password: ${{ secrets.netrcPassword != '' && secrets.netrcPassword || secrets.GITHUB_TOKEN }} | |
- 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 ${{ env.MODULE }}kmmBridgePublish -PAUTO_VERSION=${{ steps.autoversion.outputs.nextVersion }} -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} ${{ secrets.gradle_params }} --no-daemon --stacktrace --info | |
env: | |
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" | |
- uses: touchlab/autoversion-finishrelease@main | |
id: autoversion-finishrelease | |
with: | |
commitMessage: "KMM SPM package release for ${{ steps.autoversion.outputs.nextVersion }}" | |
tagMessage: "KMM release version ${{ steps.autoversion.outputs.nextVersion }}" | |
tagVersion: ${{ steps.autoversion.outputs.nextVersion }} | |
branchName: "build-${{ steps.autoversion.outputs.nextVersion }}" | |
- uses: touchlab/autoversion-tagmarker@main | |
id: autoversion-tagmarker-cleanup | |
with: | |
nextVersion: ${{ steps.autoversion.outputs.nextVersion }} | |
cleanupMarkers: 'true' | |
- name: Delete branch | |
if: (!true) && (!cancelled()) | |
uses: touchlab/action-delete-branch@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branches: "build-${{ steps.autoversion.outputs.nextVersion }}" | |
env: | |
PODSPEC_SSH_KEY_EXISTS: ${{ secrets.PODSPEC_SSH_KEY != ''}} | |
MODULE: ${{ inputs.module != '' && format('{0}:',inputs.module) || '' }} | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
COCOAPODS_EMAIL: ${{ secrets.COCOAPODS_EMAIL }} | |
PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }} | |
netrcUsername: ${{ secrets.netrcUsername }} | |
netrcPassword: ${{ secrets.netrcPassword }} |