-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (160 loc) · 6.29 KB
/
deploy.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Deploy to central
on:
release:
types:
- published
concurrency:
group: release
cancel-in-progress: true
permissions:
contents: write
jobs:
deploy-android-sdk:
name: Deploy Android SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
TAG=${{ github.event.release.tag_name }}
echo Version: TAG
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build & Deploy
run: chmod +x gradlew && ./gradlew :shared:publishAllPublicationsToMavenCentralRepository :komoju-android-sdk:publishAllPublicationsToMavenCentralRepository --no-configuration-cache --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
SDK_VERSION: ${{ env.SDK_VERSION }}
deploy-android-app:
name: Deploy Android App
needs: deploy-android-sdk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
TAG=${{ github.event.release.tag_name }}
echo Version: TAG
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Setup local.properties
run: |
touch local.properties
echo "TEST_SERVER_URL=${{ secrets.TEST_SERVER_URL }}" >> local.properties
cat local.properties
- name: Build SoundBud!
run: ./gradlew :example-android:assembleDevRelease
- name: Publish SoundBud!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: example-android/build/outputs/apk/dev/release/example-android-dev-release.apk
asset_name: soundBud-release.apk
make_latest: false
env:
SDK_VERSION: ${{ env.SDK_VERSION }}
deploy-ios-sdk:
name: Deploy iOS SDK
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0.0'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
TAG=${{ github.event.release.tag_name }}
echo Version: TAG
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build Shared SDK framework
run: |
chmod +x gradlew && ./gradlew :shared:linkReleaseFrameworkIosArm64 :shared:linkReleaseFrameworkIosSimulatorArm64 --no-configuration-cache --no-daemon
rm -rf ./build/outputs/xcframework/KomojuSharedSDK.xcframework
xcodebuild -create-xcframework \
-framework ./shared/build/bin/iosArm64/releaseFramework/komojuShared.framework \
-framework ./shared/build/bin/iosSimulatorArm64/releaseFramework/komojuShared.framework \
-output ./build/outputs/xcframework/KomojuSharedSDK.xcframework
zip -r KomojuSharedSDK.zip ./build/outputs/xcframework/KomojuSharedSDK.xcframework
- name: Build Shared SDK Swift Wrapper
working-directory: ./komoju-ios-sdk
run: |
# Build & Archive for iOS
xcodebuild archive \
-scheme KomojuSDK \
-configuration Release \
-destination "generic/platform=iOS" \
-archivePath "./build/xcframework/komoju_ios.xcarchive" \
-sdk iphoneos \
ONLY_ACTIVE_ARCH=NO \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# Build & Archive for iOS Simulator
xcodebuild archive \
-scheme KomojuSDK \
-configuration Release \
-destination "generic/platform=iOS Simulator" \
-archivePath "./build/xcframework/komoju_ios_simulators.xcarchive" \
-sdk iphonesimulator \
ONLY_ACTIVE_ARCH=NO \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
rm -rf ./build/outputs/xcframework/KomojuIosSDK.xcframework
xcodebuild -create-xcframework \
-framework ./build/xcframework/komoju_ios.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
-framework ./build/xcframework/komoju_ios_simulators.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
-output ./build/outputs/xcframework/KomojuIosSDK.xcframework
zip -r KomojuIosSDK.zip ./build/outputs/xcframework/KomojuIosSDK.xcframework
- name: Publish Shared SDK Framework!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: KomojuSharedSDK.zip
make_latest: false
- name: Publish iOS SDK Framework!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: komoju-ios-sdk/KomojuIosSDK.zip
make_latest: false