Skip to content

Commit 6b3f618

Browse files
committed
build: Improve package workflow
1 parent 3495578 commit 6b3f618

File tree

2 files changed

+99
-19
lines changed

2 files changed

+99
-19
lines changed

.github/workflows/ci.yml

+70-17
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ jobs:
6565
- name: Run package
6666
run: xcodebuild -project sample/iosApp/iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -derivedDataPath sample/build/ios/outputs/
6767

68+
- name: Read version name
69+
id: version_name_step
70+
run: |
71+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
72+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
73+
74+
- name: File name add version
75+
run: mv "sample/build/ios/outputs/Build/Products/Debug-iphonesimulator/Sketch4 Sample.app" "sample/build/ios/outputs/Build/Products/Debug-iphonesimulator/Sketch4 Sample-${{ steps.version_name_step.outputs.version_name }}.app"
76+
6877
- name: Upload APK artifacts
6978
uses: actions/upload-artifact@v4
7079
with:
@@ -157,11 +166,20 @@ jobs:
157166
- name: Run package
158167
run: ./gradlew sample:jsBrowserDistribution
159168

169+
- name: Read version name
170+
id: version_name_step
171+
run: |
172+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
173+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
174+
175+
- name: Compress
176+
run: cd sample/build/dist/js/productionExecutable; zip -r "sketch-sample-js-${{ steps.version_name_step.outputs.version_name }}.zip" *; cd -
177+
160178
- name: Upload APK artifacts
161179
uses: actions/upload-artifact@v4
162180
with:
163181
name: js-browser-files
164-
path: sample/build/dist/js/productionExecutable/*
182+
path: sample/build/dist/js/productionExecutable/*.zip
165183

166184
package-wasm-js:
167185
name: Package wasm js browser
@@ -180,11 +198,20 @@ jobs:
180198
- name: Run package
181199
run: ./gradlew sample:wasmJsBrowserDistribution
182200

201+
- name: Read version name
202+
id: version_name_step
203+
run: |
204+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
205+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
206+
207+
- name: Compress
208+
run: cd sample/build/dist/wasmJs/productionExecutable; zip -r "sketch-sample-wasmJs-${{ steps.version_name_step.outputs.version_name }}.zip" *; cd -
209+
183210
- name: Upload APK artifacts
184211
uses: actions/upload-artifact@v4
185212
with:
186213
name: wasm-js-browser-files
187-
path: sample/build/dist/wasmJs/productionExecutable/*
214+
path: sample/build/dist/wasmJs/productionExecutable/*.zip
188215

189216
deploy-api-docs:
190217
name: Deploy API docs
@@ -268,7 +295,43 @@ jobs:
268295
uses: actions/download-artifact@v4
269296
with:
270297
name: apk-files
271-
path: ./downloaded-apks
298+
path: ./downloaded
299+
300+
- name: Download ios artifacts
301+
uses: actions/download-artifact@v4
302+
with:
303+
name: ios-files
304+
path: ./downloaded
305+
306+
- name: Download deb artifacts
307+
uses: actions/download-artifact@v4
308+
with:
309+
name: deb-files
310+
path: ./downloaded
311+
312+
- name: Download dmg artifacts
313+
uses: actions/download-artifact@v4
314+
with:
315+
name: dmg-files
316+
path: ./downloaded
317+
318+
- name: Download msi artifacts
319+
uses: actions/download-artifact@v4
320+
with:
321+
name: msi-files
322+
path: ./downloaded
323+
324+
- name: Download js-browser artifacts
325+
uses: actions/download-artifact@v4
326+
with:
327+
name: js-browser-files
328+
path: ./downloaded
329+
330+
- name: Download wasm-js-browser artifacts
331+
uses: actions/download-artifact@v4
332+
with:
333+
name: wasm-js-browser-files
334+
path: ./downloaded
272335

273336
- name: Release
274337
uses: softprops/action-gh-release@v2
@@ -277,20 +340,10 @@ jobs:
277340
if: startsWith(github.ref, 'refs/tags/') # Only run on tag push
278341
with:
279342
body: |
280-
Please check the [CHANGELOG.md](https://github.com/panpf/zoomimage/blob/main/CHANGELOG.md) file for updated log
281-
282-
Sample App:
283-
* Android:For the Android platform sample app, please see the attachment.
284-
* Web:https://panpf.github.io/zoomimage/app
285-
* For other platform sample apps, please refer to the document [Run Sample App](https://github.com/panpf/zoomimage?tab=readme-ov-file#run-sample-app) running source code experience
286-
287-
\----------
343+
Please check the [CHANGELOG.md](https://github.com/panpf/zoomimage/blob/main/CHANGELOG.md) file for updated log.
288344
289-
更新日志请查看 [CHANGELOG.md](https://github.com/panpf/zoomimage/blob/main/CHANGELOG_zh.md) 文件
345+
Mobile app, desktop app and web deployable packages, see the Assets attachment.
290346
291-
示例 App:
292-
* Android:Android 平台示例 App 见附件
293-
* Web:https://panpf.github.io/zoomimage/app
294-
* 其它平台示例 App 请参考文档 [运行示例 App](https://github.com/panpf/zoomimage/blob/main/README_zh.md#%E8%BF%90%E8%A1%8C%E7%A4%BA%E4%BE%8B-app) 运行源代码体验
295-
files: ./downloaded-apks/*.apk
347+
Web example:https://panpf.github.io/zoomimage/app.
348+
files: ./downloaded/*
296349
make_latest: true

.github/workflows/package.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ jobs:
4444
- name: Run package
4545
run: xcodebuild -project sample/iosApp/iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -derivedDataPath sample/build/ios/outputs/
4646

47+
- name: Read version name
48+
id: version_name_step
49+
run: |
50+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
51+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
52+
53+
- name: File name add version
54+
run: mv "sample/build/ios/outputs/Build/Products/Debug-iphonesimulator/Sketch4 Sample.app" "sample/build/ios/outputs/Build/Products/Debug-iphonesimulator/Sketch4 Sample-${{ steps.version_name_step.outputs.version_name }}.app"
55+
4756
- name: Upload APK artifacts
4857
uses: actions/upload-artifact@v4
4958
with:
@@ -132,11 +141,20 @@ jobs:
132141
- name: Run package
133142
run: ./gradlew sample:jsBrowserDistribution
134143

144+
- name: Read version name
145+
id: version_name_step
146+
run: |
147+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
148+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
149+
150+
- name: Compress
151+
run: cd sample/build/dist/js/productionExecutable; zip -r "sketch-sample-js-${{ steps.version_name_step.outputs.version_name }}.zip" *; cd -
152+
135153
- name: Upload APK artifacts
136154
uses: actions/upload-artifact@v4
137155
with:
138156
name: js-browser-files
139-
path: sample/build/dist/js/productionExecutable/*
157+
path: sample/build/dist/js/productionExecutable/*.zip
140158

141159
package-wasm-js:
142160
name: Package wasm js browser
@@ -154,8 +172,17 @@ jobs:
154172
- name: Run package
155173
run: ./gradlew sample:wasmJsBrowserDistribution
156174

175+
- name: Read version name
176+
id: version_name_step
177+
run: |
178+
versionName=$(grep '^versionName=' gradle.properties | awk -F'=' '{print $2}')
179+
echo "version_name=$versionName" >> $GITHUB_OUTPUT
180+
181+
- name: Compress
182+
run: cd sample/build/dist/wasmJs/productionExecutable; zip -r "sketch-sample-wasmJs-${{ steps.version_name_step.outputs.version_name }}.zip" *; cd -
183+
157184
- name: Upload APK artifacts
158185
uses: actions/upload-artifact@v4
159186
with:
160187
name: wasm-js-browser-files
161-
path: sample/build/dist/wasmJs/productionExecutable/*
188+
path: sample/build/dist/wasmJs/productionExecutable/*.zip

0 commit comments

Comments
 (0)