Skip to content

Commit c4cd190

Browse files
committed
build: fix
1 parent e7f0b6c commit c4cd190

File tree

4 files changed

+209
-109
lines changed

4 files changed

+209
-109
lines changed

.github/workflows/beta.yml

Lines changed: 89 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,80 @@ jobs:
2121
run: |
2222
brew install cocoapods || true
2323
24-
- name: Build universal with Xcode
24+
- name: Build per-architecture variants
2525
run: |
2626
set -euo pipefail
2727
2828
PROJECT="Micmute.xcodeproj"
2929
SCHEME="Micmute"
3030
CONFIG="Release"
31-
DERIVED="build_output/universal"
32-
33-
# Clean previous builds
34-
rm -rf "$DERIVED"
35-
36-
# Build universal binary directly with Xcode
37-
xcodebuild clean build \
38-
-project "$PROJECT" \
39-
-scheme "$SCHEME" \
40-
-configuration "$CONFIG" \
41-
-derivedDataPath "$DERIVED" \
42-
-arch arm64 \
43-
-arch x86_64 \
44-
CODE_SIGN_IDENTITY="" \
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+
run: |
52+
- name: Re-seal app bundles
53+
54+
PROJECT="Micmute.xcodeproj"
55+
SCHEME="Micmute"
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
64+
65+
chmod +x "$app_path/Contents/MacOS/Micmute" || true
66+
xattr -cr "$app_path" || true
67+
codesign -f --deep -s - "$app_path" || true
68+
}
69+
70+
reseal_variant arm64
71+
reseal_variant x86_64
4572
CODE_SIGNING_REQUIRED=NO \
46-
CODE_SIGNING_ALLOWED=NO \
73+
- name: Verify binaries and bundles
4774
CODE_SIGN_ENTITLEMENTS=""
4875

4976
- name: Verify and re-seal app bundle
50-
run: |
51-
set -euo pipefail
77+
verify_variant() {
78+
local identifier="$1"
79+
local label="$2"
80+
local app_path="build_output/${identifier}/Build/Products/Release/Micmute.app"
5281

53-
APP="build_output/universal/Build/Products/Release/Micmute.app"
82+
echo "=== ${label} binary architecture check ==="
83+
file "$app_path/Contents/MacOS/Micmute"
84+
otool -hv "$app_path/Contents/MacOS/Micmute" || true
5485

55-
# Verify the app exists
56-
if [ ! -d "$APP" ]; then
57-
echo "App bundle not found at $APP" >&2
58-
exit 1
59-
fi
86+
echo "=== ${label} bundle Info.plist check ==="
87+
plutil -p "$app_path/Contents/Info.plist" | egrep 'CFBundleExecutable|CFBundleIdentifier|LSMinimumSystemVersion' || true
88+
89+
echo "=== ${label} code signing verification ==="
90+
codesign -vvv --deep --strict "$app_path" || true
6091

61-
# Ensure executable bits are set
62-
chmod +x "$APP/Contents/MacOS/Micmute" || true
92+
echo "=== ${label} Gatekeeper assessment ==="
93+
spctl --assess --type execute -v "$app_path" || true
94+
}
6395

96+
verify_variant arm64 "arm64"
97+
verify_variant x86_64 "Intel"
6498
# Clear extended attributes that might cause issues
6599
xattr -cr "$APP" || true
66100

@@ -94,40 +128,42 @@ jobs:
94128
RELEASE_DIR_ABS="$(pwd)/$RELEASE_DIR"
95129
mkdir -p "$RELEASE_DIR_ABS"
96130
97-
APP_SOURCE="build_output/universal/Build/Products/Release/Micmute.app"
98-
STAGING="$RELEASE_DIR_ABS/staging-universal"
131+
package_variant() {
132+
local identifier="$1"
133+
local label="$2"
134+
local source="build_output/${identifier}/Build/Products/Release/Micmute.app"
135+
local staging="$RELEASE_DIR_ABS/staging-${label}"
99136
100-
# Clean staging area
101-
rm -rf "$STAGING"
102-
mkdir -p "$STAGING"
137+
rm -rf "$staging"
138+
mkdir -p "$staging"
103139
104-
# Copy app to staging
105-
ditto "$APP_SOURCE" "$STAGING/Micmute.app"
140+
ditto "$source" "$staging/Micmute.app"
106141
107-
# Create zip from staging
108-
pushd "$STAGING" >/dev/null
109-
ditto -c -k --sequesterRsrc --keepParent "Micmute.app" "$RELEASE_DIR_ABS/Micmute-universal.zip"
110-
popd >/dev/null
142+
pushd "$staging" >/dev/null
143+
ditto -c -k --sequesterRsrc --keepParent "Micmute.app" "$RELEASE_DIR_ABS/Micmute-${label}.zip"
144+
popd >/dev/null
111145
112-
# Clean staging
113-
rm -rf "$STAGING"
146+
rm -rf "$staging"
114147
115-
# Verify zip was created
116-
UNIVERSAL_ZIP="$RELEASE_DIR_ABS/Micmute-universal.zip"
117-
if [ ! -f "$UNIVERSAL_ZIP" ]; then
118-
echo "Universal zip not found at $UNIVERSAL_ZIP" >&2
119-
exit 1
120-
fi
148+
local zip_path="$RELEASE_DIR_ABS/Micmute-${label}.zip"
149+
if [ ! -f "$zip_path" ]; then
150+
echo "Zip not found at $zip_path" >&2
151+
exit 1
152+
fi
121153
122-
# Move to workspace root
123-
mv "$UNIVERSAL_ZIP" "$GITHUB_WORKSPACE"/
154+
mv "$zip_path" "$GITHUB_WORKSPACE"/
155+
}
156+
157+
package_variant arm64 arm64
158+
package_variant x86_64 intel
124159
125160
- name: Upload artifact
126161
uses: actions/upload-artifact@v4
127162
with:
128163
name: Micmute
129164
path: |
130-
${{ github.workspace }}/Micmute-universal.zip
165+
${{ github.workspace }}/Micmute-arm64.zip
166+
${{ github.workspace }}/Micmute-intel.zip
131167
132168
release:
133169
needs: build
@@ -154,32 +190,26 @@ jobs:
154190
fi
155191
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
156192
157-
- name: Rename artifact
193+
- name: Rename artifacts
158194
run: |
159-
mv "Micmute-universal.zip" "Micmute-universal-${{ steps.appver.outputs.version }}-preview.zip"
195+
mv "Micmute-arm64.zip" "Micmute-arm64-${{ steps.appver.outputs.version }}-preview.zip"
196+
mv "Micmute-intel.zip" "Micmute-intel-${{ steps.appver.outputs.version }}-preview.zip"
160197
161198
- name: Create Release
162199
uses: softprops/action-gh-release@v2
163200
with:
164201
tag_name: preview
165202
name: ${{ steps.appver.outputs.version }}-preview
166203
files: |
167-
Micmute-universal-${{ steps.appver.outputs.version }}-preview.zip
204+
Micmute-arm64-${{ steps.appver.outputs.version }}-preview.zip
205+
Micmute-intel-${{ steps.appver.outputs.version }}-preview.zip
168206
prerelease: true
169207
make_latest: false
170208
body: |
171-
## Micmute Preview Build
172-
173-
**Version:** ${{ steps.appver.outputs.version }}
174-
175209
### Installation Notes
176210
This is an unsigned build. You may need to:
177211
1. Right-click the app and select "Open" the first time
178212
2. Or remove quarantine in Terminal: `xattr -dr com.apple.quarantine /Applications/Micmute.app`
179213
180-
### Architecture Support
181-
- ✅ Apple Silicon (M1/M2/M3/M4)
182-
- ✅ Intel (x86_64)
183-
184214
env:
185215
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stable.yml

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,39 +47,52 @@ jobs:
4747
build_variant arm64 -arch arm64
4848
build_variant x86_64 -arch x86_64
4949
50-
create_universal_variant() {
51-
local universal_root="build_output/universal/Build/Products/Release"
52-
local universal_app="$universal_root/Micmute.app"
53-
local arm_app="build_output/arm64/Build/Products/Release/Micmute.app"
54-
local intel_app="build_output/x86_64/Build/Products/Release/Micmute.app"
55-
56-
if [ ! -d "$arm_app" ] || [ ! -d "$intel_app" ]; then
57-
echo "Missing architecture build outputs; cannot create universal binary." >&2
50+
- name: Re-seal app bundles
51+
run: |
52+
set -euo pipefail
53+
54+
reseal_variant() {
55+
local identifier="$1"
56+
local app_path="build_output/${identifier}/Build/Products/Release/Micmute.app"
57+
58+
if [ ! -d "$app_path" ]; then
59+
echo "App bundle not found at $app_path" >&2
5860
exit 1
5961
fi
6062
61-
rm -rf "build_output/universal"
62-
mkdir -p "$universal_root"
63+
chmod +x "$app_path/Contents/MacOS/Micmute" || true
64+
xattr -cr "$app_path" || true
65+
codesign -f --deep -s - "$app_path" || true
66+
}
67+
68+
reseal_variant arm64
69+
reseal_variant x86_64
70+
71+
- name: Verify binaries and bundles
72+
run: |
73+
set -euo pipefail
74+
75+
verify_variant() {
76+
local identifier="$1"
77+
local label="$2"
78+
local app_path="build_output/${identifier}/Build/Products/Release/Micmute.app"
6379
64-
ditto "$arm_app" "$universal_app"
80+
echo "=== ${label} binary architecture check ==="
81+
file "$app_path/Contents/MacOS/Micmute"
82+
otool -hv "$app_path/Contents/MacOS/Micmute" || true
6583
66-
while IFS= read -r arm_file; do
67-
local rel="${arm_file#${arm_app}/}"
68-
local intel_file="$intel_app/$rel"
69-
local universal_file="$universal_app/$rel"
84+
echo "=== ${label} bundle Info.plist check ==="
85+
plutil -p "$app_path/Contents/Info.plist" | egrep 'CFBundleExecutable|CFBundleIdentifier|LSMinimumSystemVersion' || true
7086
71-
if [ ! -f "$intel_file" ]; then
72-
continue
73-
fi
87+
echo "=== ${label} code signing verification ==="
88+
codesign -vvv --deep --strict "$app_path" || true
7489
75-
if file "$arm_file" | grep -q "Mach-O"; then
76-
lipo -create "$arm_file" "$intel_file" -output "$universal_file"
77-
codesign --remove-signature "$universal_file" || true
78-
fi
79-
done < <(find "$arm_app" -type f)
90+
echo "=== ${label} Gatekeeper assessment ==="
91+
spctl --assess --type execute -v "$app_path" || true
8092
}
8193
82-
create_universal_variant
94+
verify_variant arm64 "arm64"
95+
verify_variant x86_64 "Intel"
8396
8497
- name: Prepare release bundle
8598
run: |
@@ -107,23 +120,16 @@ jobs:
107120
108121
rm -rf "$staging"
109122
}
110-
111-
package_variant universal universal
112-
113-
UNIVERSAL_ZIP="$RELEASE_DIR_ABS/Micmute-universal.zip"
114-
if [ ! -f "$UNIVERSAL_ZIP" ]; then
115-
echo "Universal zip not found at $UNIVERSAL_ZIP" >&2
116-
exit 1
117-
fi
118-
119-
mv "$UNIVERSAL_ZIP" "$GITHUB_WORKSPACE"/
123+
package_variant arm64 arm64
124+
package_variant x86_64 intel
120125
121126
- name: Upload artifact
122127
uses: actions/upload-artifact@v4
123128
with:
124129
name: Micmute
125130
path: |
126-
${{ github.workspace }}/Micmute-universal.zip
131+
${{ github.workspace }}/Micmute-arm64.zip
132+
${{ github.workspace }}/Micmute-intel.zip
127133
128134
release:
129135
needs: build
@@ -150,17 +156,19 @@ jobs:
150156
fi
151157
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
152158
153-
- name: Rename artifact
159+
- name: Rename artifacts
154160
run: |
155-
mv "Micmute-universal.zip" "Micmute-universal-${{ steps.appver.outputs.version }}.zip"
161+
mv "Micmute-arm64.zip" "Micmute-arm64-${{ steps.appver.outputs.version }}.zip"
162+
mv "Micmute-intel.zip" "Micmute-intel-${{ steps.appver.outputs.version }}.zip"
156163
157164
- name: Create Release
158165
uses: softprops/action-gh-release@v2
159166
with:
160167
tag_name: ${{ steps.appver.outputs.version }}
161168
name: ${{ steps.appver.outputs.version }}
162169
files: |
163-
Micmute-universal-${{ steps.appver.outputs.version }}.zip
170+
Micmute-arm64-${{ steps.appver.outputs.version }}.zip
171+
Micmute-intel-${{ steps.appver.outputs.version }}.zip
164172
make_latest: true
165173
env:
166174
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file not shown.

0 commit comments

Comments
 (0)