@@ -14,10 +14,10 @@ jobs:
1414 timeout-minutes : 15
1515 steps :
1616 - uses : actions/checkout@v6
17- - name : probe icon composer gui
17+ - name : export mac icons with icon composer
1818 shell : bash
1919 run : |
20- set -x
20+ set -euo pipefail
2121 mkdir -p /tmp/icon-gui
2222 cat >/tmp/click.m <<'EOF'
2323 #import <ApplicationServices/ApplicationServices.h>
3333 EOF
3434 clang -framework ApplicationServices /tmp/click.m -o /tmp/click
3535 app="$(find /Applications -path '*Icon Composer.app' -type d | head -n 1)"
36+
3637 open -a "$app" "$PWD/assets/prod/app-icon.icon"
3738 sleep 8
38- osascript <<'APPLESCRIPT' || true
39+ osascript <<'APPLESCRIPT'
3940 tell application "System Events"
4041 tell process "Icon Composer"
4142 set frontmost to true
@@ -46,39 +47,53 @@ jobs:
4647 sleep 5
4748 /tmp/click 503 692
4849 sleep 8
49- osascript <<'APPLESCRIPT' > /tmp/icon-gui/actions.log 2>&1 || true
50- tell application "System Events"
51- tell process "Icon Composer"
52- set frontmost to true
53- click menu item "Export…" of menu 1 of menu bar item "File" of menu bar 1
54- delay 5
55- set exportSheet to sheet 1 of window 1
56- set platformPopup to pop up button "Platform" of group 1 of scroll area 1 of group 1 of exportSheet
57- click platformPopup
58- delay 1
59- key code 125
60- key code 125
61- key code 36
62- delay 2
63- click button 2 of group 1 of exportSheet
64- delay 3
65- set saveSheet to sheet 1 of exportSheet
66- set value of text field "Export As:" of splitter group 1 of saveSheet to "black-macos-1024"
67- keystroke "g" using {command down, shift down}
68- delay 2
69- keystroke "/tmp/icon-gui"
70- key code 36
71- delay 3
72- click button "Export" of splitter group 1 of saveSheet
73- delay 8
50+
51+ export_current() {
52+ osascript - "$1" <<'APPLESCRIPT'
53+ on run argv
54+ set outputName to item 1 of argv
55+ tell application "System Events"
56+ tell process "Icon Composer"
57+ set frontmost to true
58+ click menu item "Export…" of menu 1 of menu bar item "File" of menu bar 1
59+ delay 4
60+ set exportSheet to sheet 1 of window 1
61+ set platformPopup to pop up button "Platform" of group 1 of scroll area 1 of group 1 of exportSheet
62+ click platformPopup
63+ delay 1
64+ key code 125
65+ key code 125
66+ key code 36
67+ delay 2
68+ click button 2 of group 1 of exportSheet
69+ delay 3
70+ set saveSheet to sheet 1 of exportSheet
71+ set value of text field "Export As:" of splitter group 1 of saveSheet to outputName
72+ keystroke "g" using {command down, shift down}
73+ delay 2
74+ keystroke "/tmp/icon-gui"
75+ key code 36
76+ delay 3
77+ click button "Export" of splitter group 1 of saveSheet
78+ delay 8
79+ end tell
7480 end tell
75- end tell
81+ end run
7682 APPLESCRIPT
77- osascript -e 'tell application "System Events" to tell process "Icon Composer" to get entire contents' > /tmp/icon-gui/all.txt 2>&1 || true
78- screencapture -x /tmp/icon-gui/screen.png || true
79- cat /tmp/icon-gui/actions.log /tmp/icon-gui/all.txt
83+ }
84+
85+ export_current black-macos-1024
86+ osascript -e 'tell application "System Events" to tell process "Icon Composer" to keystroke "w" using command down'
87+ open -a "$app" "$PWD/assets/dev/app-icon.icon"
88+ sleep 8
89+ export_current blueprint-macos-1024
90+ osascript -e 'tell application "System Events" to tell process "Icon Composer" to keystroke "w" using command down'
91+ open -a "$app" "$PWD/assets/nightly/app-icon.icon"
92+ sleep 8
93+ export_current nightly-macos-1024
94+
95+ file /tmp/icon-gui/*.png
8096 - uses : actions/upload-artifact@v7
81- if : always()
8297 with :
83- name : icon-gui-probe
84- path : /tmp/icon-gui/
98+ name : mac- icon-exports
99+ path : /tmp/icon-gui/*.png
0 commit comments