-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (109 loc) · 4.58 KB
/
deploy-with-kmm-bridge.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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 }}