-
Notifications
You must be signed in to change notification settings - Fork 27
274 lines (224 loc) · 7.69 KB
/
android-release.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: APM Automatic Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
buildAPK:
runs-on: ubuntu-latest
name: build APK
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: python version_bump.py
run: |
python version_bump.py
- name: Push changes to master
uses: ad-m/github-push-action@master
- name: Get branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: set up JDK 18
uses: actions/setup-java@v3
with:
java-version: 18
distribution: temurin
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Create env file'
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- name: alias yarn.cmd to yarn
run: alias yarn.cmd="yarn"
- name: Get Recent Commit Tag
id: get_commit_tag
run: |
COMMIT_TAG=$(git describe --tags --abbrev=0)
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV
- name: Display Commit Tag
run: |
echo "Commit Tag: $COMMIT_TAG"
- name: Add Build Sign Keys
run: |
git submodule update --init --recursive
echo "${{ secrets.RELEASE_SIGN_PWD }}" >> ./android/gradle.properties
- name: commit
run: |
git config --global user.email [email protected]
git config --global user.name lovegaoshi
git pull origin master
git commit -m "build: release version bump" -a
- name: python fixHTTP
run: |
python fixHTTP.py
- name: WGet Build Sign jks
uses: wei/wget@v1
with:
args: -O ./android/app/noxupload.jks ${{ secrets.REMOTE_KEYFILE_URL }}
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: yarn
- name: clean generated builds
run: rm -rf android/app/build/generated/
- name: codepush to prod
run: |
npm install -g appcenter-cli
yarn codepush --token ${{secrets.CODEPUSH_ACCESS_TOKEN}}
yarn codepush:promote --token ${{secrets.CODEPUSH_ACCESS_TOKEN}}
- name: gradle build APK
run: cd android && chmod +x gradlew && ./gradlew assembleRelease
- name: Release APK
uses: softprops/action-gh-release@v1
with:
name: 'Release ${{env.COMMIT_TAG}}'
tag_name: '${{env.COMMIT_TAG}}'
files: android/app/build/outputs/apk/release/*.apk
generate_release_notes: true
buildAAB:
runs-on: ubuntu-latest
name: build AAB
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: python version_bump.py
run: |
python version_bump.py
- name: Get branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: set up JDK 18
uses: actions/setup-java@v3
with:
java-version: 18
distribution: temurin
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Create env file'
run: |
echo "${{ secrets.ENV_FILE }}" > .env
echo "APPSTORE=true" >> .env
- name: alias yarn.cmd to yarn
run: alias yarn.cmd="yarn"
- name: Get Recent Commit Tag
id: get_commit_tag
run: |
COMMIT_TAG=$(git describe --tags --abbrev=0)
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV
- name: Display Commit Tag
run: |
echo "Commit Tag: $COMMIT_TAG"
- name: Add Build Sign Keys
run: |
git submodule update --init --recursive
echo "${{ secrets.RELEASE_SIGN_PWD }}" >> ./android/gradle.properties
- name: WGet Build Sign jks
uses: wei/wget@v1
with:
args: -O ./android/app/noxupload.jks ${{ secrets.REMOTE_KEYFILE_URL }}
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: yarn
- name: clean generated builds
run: rm -rf android/app/build/generated/
- name: gradle build AAB
run: cd android && chmod +x gradlew && ./gradlew bundleRelease
- uses: actions/upload-artifact@v3
with:
name: outputAAB
path: android/app/build/outputs/bundle/release/*.aab # or path/to/artifact
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.noxplay.noxplayer
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
track: internal
# status: draft
buildIPA:
runs-on: macos-14
name: build IPA
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: set up JDK 18
uses: actions/setup-java@v3
with:
java-version: 18
distribution: temurin
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Create env file'
run: |
echo "${{ secrets.ENV_FILE }}" > .env
echo "APPSTORE=true" >> .env
git submodule update --init --recursive
- name: alias yarn.cmd to yarn
run: alias yarn.cmd="yarn"
- name: Get Recent Commit Tag
id: get_commit_tag
run: |
COMMIT_TAG=$(git describe --tags --abbrev=0)
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV
- name: Display Commit Tag
run: |
echo "Commit Tag: $COMMIT_TAG"
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: yarn
- name: Pod Install
run: cd ios && rm Podfile.lock && pod install --repo-update
- name: build
run: cd ios && xcodebuild -scheme APM -workspace example.xcworkspace -configuration Release clean archive -archivePath "build/APM.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- name: archive to ipa
run: |
cd ios
mkdir build/Payload
mv build/APM.xcarchive/Products/Applications/AzusaPlayer.app build/Payload/AzusaPlayer.app
cd build
zip -r APM.ipa Payload/
- name: Release IPA
uses: softprops/action-gh-release@v1
with:
name: 'Release ${{env.COMMIT_TAG}}'
tag_name: '${{env.COMMIT_TAG}}'
files: ios/build/APM.ipa
generate_release_notes: true