88jobs :
99 build :
1010 runs-on : macos-latest
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ arch : [arm64, x86_64]
1115 steps :
1216 - name : Checkout repository
1317 uses : actions/checkout@v4
@@ -21,80 +25,73 @@ jobs:
2125 run : |
2226 brew install cocoapods || true
2327
24- - name : Build per-architecture variants
28+ - name : Determine architecture label
29+ id : arch_label
30+ run : |
31+ if [ "${{ matrix.arch }}" = "x86_64" ]; then
32+ echo "label=intel" >> "$GITHUB_OUTPUT"
33+ else
34+ echo "label=arm64" >> "$GITHUB_OUTPUT"
35+ fi
36+
37+ - name : Build ${{ matrix.arch }} variant
2538 run : |
2639 set -euo pipefail
2740
2841 PROJECT="Micmute.xcodeproj"
2942 SCHEME="Micmute"
3043 CONFIG="Release"
31-
32- build_variant() {
33- local identifier="$1"
34- local arch_flag="$2"
35-
36- rm -rf "build_output/${identifier}"
37- xcodebuild clean build \
38- -project "$PROJECT" \
39- -scheme "$SCHEME" \
40- -configuration "$CONFIG" \
41- -derivedDataPath "build_output/${identifier}" \
42- -arch "$arch_flag" \
43- CODE_SIGN_IDENTITY="" \
44- CODE_SIGNING_REQUIRED=NO \
45- CODE_SIGNING_ALLOWED=NO \
46- CODE_SIGN_ENTITLEMENTS=""
47- }
48-
49- build_variant arm64 arm64
50- build_variant x86_64 x86_64
51-
52- - name : Re-seal app bundles
44+ ARCH="${{ matrix.arch }}"
45+ DERIVED="build_output/${ARCH}"
46+
47+ rm -rf "$DERIVED"
48+ xcodebuild clean build \
49+ -project "$PROJECT" \
50+ -scheme "$SCHEME" \
51+ -configuration "$CONFIG" \
52+ -derivedDataPath "$DERIVED" \
53+ -arch "$ARCH" \
54+ CODE_SIGN_IDENTITY="" \
55+ CODE_SIGNING_REQUIRED=NO \
56+ CODE_SIGNING_ALLOWED=NO \
57+ CODE_SIGN_ENTITLEMENTS=""
58+
59+ - name : Re-seal app bundle
5360 run : |
5461 set -euo pipefail
5562
56- reseal_variant() {
57- local identifier="$1"
58- local app_path="build_output/${identifier}/Build/Products/Release/Micmute.app"
59-
60- if [ ! -d "$app_path" ]; then
61- echo "App bundle not found at $app_path" >&2
62- exit 1
63- fi
63+ ARCH="${{ matrix.arch }}"
64+ APP_PATH="build_output/${ARCH}/Build/Products/Release/Micmute.app"
6465
65- chmod +x "$app_path/Contents/MacOS/Micmute" || true
66- xattr -cr "$app_path" || true
67- codesign -f --deep -s - "$app_path" || true
68- }
66+ if [ ! -d "$APP_PATH" ]; then
67+ echo "App bundle not found at $APP_PATH" >&2
68+ exit 1
69+ fi
6970
70- reseal_variant arm64
71- reseal_variant x86_64
71+ chmod +x "$APP_PATH/Contents/MacOS/Micmute" || true
72+ xattr -cr "$APP_PATH" || true
73+ codesign -f --deep -s - "$APP_PATH" || true
7274
73- - name : Verify binaries and bundles
75+ - name : Verify binary and bundle
7476 run : |
7577 set -euo pipefail
7678
77- verify_variant() {
78- local identifier="$1"
79- local label="$2"
80- local app_path="build_output/${identifier}/Build/Products/Release/Micmute.app"
81-
82- echo "=== ${label} binary architecture check ==="
83- file "$app_path/Contents/MacOS/Micmute"
84- otool -hv "$app_path/Contents/MacOS/Micmute" || true
79+ ARCH="${{ matrix.arch }}"
80+ ARCH_LABEL="${{ steps.arch_label.outputs.label }}"
81+ APP_PATH="build_output/${ARCH}/Build/Products/Release/Micmute.app"
8582
86- echo "=== ${label} bundle Info.plist check ==="
87- plutil -p "$app_path/Contents/Info.plist" | egrep 'CFBundleExecutable|CFBundleIdentifier|LSMinimumSystemVersion' || true
83+ echo "=== ${ARCH_LABEL} binary architecture check ==="
84+ file "$APP_PATH/Contents/MacOS/Micmute"
85+ otool -hv "$APP_PATH/Contents/MacOS/Micmute" || true
8886
89- echo "=== ${label} code signing verification ==="
90- codesign -vvv --deep --strict "$app_path" || true
87+ echo "=== ${ARCH_LABEL} bundle Info.plist check ==="
88+ plutil -p "$APP_PATH/Contents/Info.plist" | egrep 'CFBundleExecutable|CFBundleIdentifier|LSMinimumSystemVersion' || true
9189
92- echo "=== ${label} Gatekeeper assessment ==="
93- spctl --assess --type execute -v "$app_path" || true
94- }
90+ echo "=== ${ARCH_LABEL} code signing verification ==="
91+ codesign -vvv --deep --strict "$APP_PATH" || true
9592
96- verify_variant arm64 "arm64 "
97- verify_variant x86_64 "Intel"
93+ echo "=== ${ARCH_LABEL} Gatekeeper assessment === "
94+ spctl --assess --type execute -v "$APP_PATH" || true
9895
9996 - name : Prepare release bundle
10097 run : |
@@ -104,42 +101,35 @@ jobs:
104101 RELEASE_DIR_ABS="$(pwd)/$RELEASE_DIR"
105102 mkdir -p "$RELEASE_DIR_ABS"
106103
107- package_variant() {
108- local identifier="$1"
109- local label="$2"
110- local source="build_output/${identifier}/Build/Products/Release/Micmute.app"
111- local staging="$RELEASE_DIR_ABS/staging-${label}"
112-
113- rm -rf "$staging"
114- mkdir -p "$staging"
104+ ARCH="${{ matrix.arch }}"
105+ ARCH_LABEL="${{ steps.arch_label.outputs.label }}"
106+ SOURCE="build_output/${ARCH}/Build/Products/Release/Micmute.app"
107+ STAGING="$RELEASE_DIR_ABS/staging-${ARCH_LABEL}"
115108
116- ditto "$source" "$staging/Micmute.app"
109+ rm -rf "$STAGING"
110+ mkdir -p "$STAGING"
117111
118- pushd "$staging" >/dev/null
119- ditto -c -k --sequesterRsrc --keepParent "Micmute.app" "$RELEASE_DIR_ABS/Micmute-${label}.zip"
120- popd >/dev/null
112+ ditto "$SOURCE" "$STAGING/Micmute.app"
121113
122- rm -rf "$staging"
114+ pushd "$STAGING" >/dev/null
115+ ditto -c -k --sequesterRsrc --keepParent "Micmute.app" "$RELEASE_DIR_ABS/Micmute-${ARCH_LABEL}.zip"
116+ popd >/dev/null
123117
124- local zip_path="$RELEASE_DIR_ABS/Micmute-${label}.zip"
125- if [ ! -f "$zip_path" ]; then
126- echo "Zip not found at $zip_path" >&2
127- exit 1
128- fi
118+ rm -rf "$STAGING"
129119
130- mv "$zip_path" "$GITHUB_WORKSPACE"/
131- }
120+ ZIP_PATH="$RELEASE_DIR_ABS/Micmute-${ARCH_LABEL}.zip"
121+ if [ ! -f "$ZIP_PATH" ]; then
122+ echo "Zip not found at $ZIP_PATH" >&2
123+ exit 1
124+ fi
132125
133- package_variant arm64 arm64
134- package_variant x86_64 intel
126+ mv "$ZIP_PATH" "$GITHUB_WORKSPACE"/
135127
136128 - name : Upload artifact
137129 uses : actions/upload-artifact@v4
138130 with :
139- name : Micmute
140- path : |
141- ${{ github.workspace }}/Micmute-arm64.zip
142- ${{ github.workspace }}/Micmute-intel.zip
131+ name : Micmute-${{ steps.arch_label.outputs.label }}
132+ path : ${{ github.workspace }}/Micmute-${{ steps.arch_label.outputs.label }}.zip
143133
144134 release :
145135 needs : build
@@ -150,11 +140,12 @@ jobs:
150140 - name : Checkout code
151141 uses : actions/checkout@v4
152142
153- - name : Download artifact
143+ - name : Download artifacts
154144 uses : actions/download-artifact@v4
155145 with :
156- name : Micmute
146+ pattern : Micmute-*
157147 path : .
148+ merge-multiple : true
158149
159150 - name : Read app version from Xcode settings
160151 id : appver
@@ -168,17 +159,20 @@ jobs:
168159
169160 - name : Rename artifacts
170161 run : |
171- mv "Micmute-arm64.zip" "Micmute-arm64-${{ steps.appver.outputs.version }}-preview.zip"
172- mv "Micmute-intel.zip" "Micmute-intel-${{ steps.appver.outputs.version }}-preview.zip"
162+ VERSION="${{ steps.appver.outputs.version }}"
163+ for zip in Micmute-*.zip; do
164+ arch="${zip#Micmute-}"
165+ arch="${arch%.zip}"
166+ mv "$zip" "Micmute-${arch}-${VERSION}-preview.zip"
167+ done
173168
174169 - name : Create Release
175170 uses : softprops/action-gh-release@v2
176171 with :
177172 tag_name : preview
178173 name : ${{ steps.appver.outputs.version }}-preview
179174 files : |
180- Micmute-arm64-${{ steps.appver.outputs.version }}-preview.zip
181- Micmute-intel-${{ steps.appver.outputs.version }}-preview.zip
175+ Micmute-*-${{ steps.appver.outputs.version }}-preview.zip
182176 prerelease : true
183177 make_latest : false
184178 body : |
0 commit comments