Skip to content

Commit 9cbadd5

Browse files
committed
ci: add GitHub Release with zip on tag push
- Package app as .zip for Homebrew Cask compatibility - Auto-create GitHub Release with gh CLI on v* tags - Upload zip as both artifact and release asset
1 parent 04ac2ec commit 9cbadd5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Build
33
on:
44
push:
55
branches: [main]
6+
tags: ["v*"]
67
pull_request:
78
branches: [main]
89
workflow_dispatch:
@@ -27,12 +28,25 @@ jobs:
2728
CODE_SIGNING_ALLOWED=NO
2829
2930
- name: Export app
31+
if: startsWith(github.ref, 'refs/tags/v')
3032
run: |
3133
cp -R "${{ runner.temp }}/NetworkStatusBar.xcarchive/Products/Applications/NetworkStatusBar.app" \
3234
"${{ runner.temp }}/NetworkStatusBar.app"
35+
cd "${{ runner.temp }}" && zip -r NetworkStatusBar.zip NetworkStatusBar.app
3336
3437
- name: Upload artifact
38+
if: startsWith(github.ref, 'refs/tags/v')
3539
uses: actions/upload-artifact@v4
3640
with:
3741
name: NetworkStatusBar
38-
path: ${{ runner.temp }}/NetworkStatusBar.app
42+
path: ${{ runner.temp }}/NetworkStatusBar.zip
43+
44+
- name: Create GitHub Release
45+
if: startsWith(github.ref, 'refs/tags/v')
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
gh release create "${{ github.ref_name }}" \
50+
"${{ runner.temp }}/NetworkStatusBar.zip" \
51+
--title "${{ github.ref_name }}" \
52+
--generate-notes

0 commit comments

Comments
 (0)