Skip to content

Commit 0e0353e

Browse files
committed
Add icon generation to release workflow
Generate DNSSwitcher.icns from icon.png during the release job. Also ignore .icns and .iconset in .gitignore and remove the app iconset in Makefile's clean target.
1 parent 86ba616 commit 0e0353e

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313

14+
- name: Generate icon
15+
run: |
16+
mkdir -p DNSSwitcher.iconset
17+
sips -z 16 16 icon.png --out DNSSwitcher.iconset/icon_16x16.png
18+
sips -z 32 32 icon.png --out DNSSwitcher.iconset/icon_16x16@2x.png
19+
sips -z 32 32 icon.png --out DNSSwitcher.iconset/icon_32x32.png
20+
sips -z 64 64 icon.png --out DNSSwitcher.iconset/icon_32x32@2x.png
21+
sips -z 128 128 icon.png --out DNSSwitcher.iconset/icon_128x128.png
22+
sips -z 256 256 icon.png --out DNSSwitcher.iconset/icon_128x128@2x.png
23+
sips -z 256 256 icon.png --out DNSSwitcher.iconset/icon_256x256.png
24+
sips -z 512 512 icon.png --out DNSSwitcher.iconset/icon_256x256@2x.png
25+
sips -z 512 512 icon.png --out DNSSwitcher.iconset/icon_512x512.png
26+
cp icon.png DNSSwitcher.iconset/icon_512x512@2x.png
27+
iconutil -c icns DNSSwitcher.iconset -o DNSSwitcher.icns
28+
1429
- name: Build app bundle
1530
run: make app
1631

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ DerivedData/
2020
*.app
2121
*.dmg
2222
*.pkg
23+
*.icns
24+
*.iconset
2325

2426
# Release archives
2527
*.zip

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ clean:
3535
swift package clean
3636
rm -rf .build
3737
rm -f $(DMG_NAME)
38+
rm -rf $(APP_NAME).iconset

0 commit comments

Comments
 (0)