Skip to content

Fix Acknowledge Message #81

Fix Acknowledge Message

Fix Acknowledge Message #81

name: Deploy WIth KMM Bridge Github Workflow
on:
push:
branches:
- main
# 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 }}"
- 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 }}"
- 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 podPublishReleaseXCFramework
- name: Zip XCFramework
run: |
cd /Users/runner/work/janus-message-sdk/janus-message-sdk/shared/build/cocoapods/publish/release/
zip -r ${{ github.workspace }}/JanusMessageSdk.xcframework.zip JanusMessageSDK.xcframework
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: JanusMessageSdk.xcframework
path: ${{ github.workspace }}/JanusMessageSdk.xcframework.zip
- name: Create Tag
if: github.ref == 'refs/heads/main'
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git tag -a ${{ steps.autoversion.outputs.nextVersion }} -m "Release version ${{ steps.autoversion.outputs.nextVersion }}"
git push origin ${{ steps.autoversion.outputs.nextVersion }}
- name: Create Release
if: github.ref == 'refs/heads/main'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.autoversion.outputs.nextVersion }}
release_name: Release version ${{ steps.autoversion.outputs.nextVersion }}
body: Updates for ${{ steps.autoversion.outputs.nextVersion }}
- name: Attach Artifact to Release
if: github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/JanusMessageSdk.xcframework.zip
asset_name: JanusMessageSdk.xcframework.zip
asset_content_type: application/zip
- name: Push to CocoaPods
if: github.ref == 'refs/heads/main'
run: ./gradlew pushRemotePodspec
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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }}
netrcUsername: ${{ secrets.netrcUsername }}
netrcPassword: ${{ secrets.netrcPassword }}