Skip to content

Commit 56a59bd

Browse files
committed
Refactor macOS DMG workflow by removing gtk-mac-bundler build steps and updating app bundling process. Introduce preparation of macOS bundle metadata while maintaining signing processes for Mach-O binaries and libraries.
1 parent d882f28 commit 56a59bd

File tree

1 file changed

+5
-77
lines changed

1 file changed

+5
-77
lines changed

.github/workflows/macos-dmg.yml

Lines changed: 5 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ jobs:
3737
brew --version
3838
brew list --versions
3939
40-
- name: Build gtk-mac-bundler from source
41-
run: |
42-
git clone https://gitlab.gnome.org/GNOME/gtk-mac-bundler.git
43-
cd gtk-mac-bundler
44-
make
45-
sudo make install
46-
which gtk-mac-bundler
47-
gtk-mac-bundler --version || true
48-
4940
- name: Build blueprint-compiler from git (v0.18.0)
5041
run: |
5142
set -euxo pipefail
@@ -66,69 +57,14 @@ jobs:
6657
meson compile -C build
6758
meson install -C build
6859
69-
- name: Bundle app with gtk-mac-bundler
60+
- name: Prepare macOS bundle metadata
7061
run: |
7162
mkdir -p macos
7263
BREW_PREFIX="$(brew --prefix)"
7364
export BREW_PREFIX
7465
echo "BREW_PREFIX=${BREW_PREFIX}" >> "$GITHUB_ENV"
7566
echo "Detected Homebrew prefix: $BREW_PREFIX"
7667
77-
# Write Info.plist required by gtk-mac-bundler
78-
cat > macos/Info.plist << 'PLIST'
79-
<?xml version="1.0" encoding="UTF-8"?>
80-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
81-
<plist version="1.0">
82-
<dict>
83-
<key>CFBundleIdentifier</key>
84-
<string>io.github.BuddySirJava.SSH-Studio</string>
85-
<key>CFBundleName</key>
86-
<string>SSH Studio</string>
87-
<key>CFBundleExecutable</key>
88-
<string>ssh-studio</string>
89-
<key>CFBundleShortVersionString</key>
90-
<string>1.0.0</string>
91-
<key>CFBundleVersion</key>
92-
<string>1.0.0</string>
93-
<key>CFBundlePackageType</key>
94-
<string>APPL</string>
95-
<key>CFBundleSignature</key>
96-
<string>SSHS</string>
97-
</dict>
98-
</plist>
99-
PLIST
100-
101-
# Bundle description for gtk-mac-bundler
102-
cat > macos/ssh-studio.bundle << 'XML'
103-
<?xml version="1.0"?>
104-
<app-bundle>
105-
<meta>
106-
<prefix>${env:BREW_PREFIX}</prefix>
107-
<destination overwrite="yes">${project}/../build/ssh-studio.bundle</destination>
108-
<gtk>gtk4</gtk>
109-
</meta>
110-
111-
<id>io.github.BuddySirJava.SSH-Studio</id>
112-
<name>SSH Studio</name>
113-
<version>1.0.0</version>
114-
<icon>${project}/../data/media/icon_512.png</icon>
115-
116-
<plist>${env:GITHUB_WORKSPACE}/macos/Info.plist</plist>
117-
118-
<main-binary dest="${bundle}/Contents/MacOS/${name}">${project}/../stage/bin/ssh-studio</main-binary>
119-
120-
<data dest="${bundle}/Contents/Resources/share/io.github.BuddySirJava.SSH-Studio/ssh-studio-resources.gresource">${project}/../stage/share/io.github.BuddySirJava.SSH-Studio/ssh-studio-resources.gresource</data>
121-
<data dest="${bundle}/Contents/Resources/src">${project}/../src</data>
122-
</app-bundle>
123-
XML
124-
125-
- name: Run gtk-mac-bundler
126-
run: |
127-
set -euxo pipefail
128-
BREW_PREFIX="$(brew --prefix)"
129-
export BREW_PREFIX
130-
gtk-mac-bundler macos/ssh-studio.bundle
131-
13268
- name: Build self-contained .app (vendor Python + GTK)
13369
run: |
13470
set -euxo pipefail
@@ -308,8 +244,6 @@ jobs:
308244
- name: List .app contents
309245
run: |
310246
set -euxo pipefail
311-
echo 'gtk-mac-bundler app:' || true
312-
ls -R build/ssh-studio.bundle/SSH\ Studio.app/Contents || true
313247
echo 'self-contained app:' || true
314248
ls -R 'dist/SSH Studio.app/Contents' || true
315249
@@ -321,11 +255,8 @@ jobs:
321255
chmod -R u+rw "$APP"
322256
xattr -cr "$APP" || true
323257
# Sign only Mach-O binaries and libraries to avoid codesign errors on non-bundles
324-
while IFS= read -r -d '' f; do
325-
if file -b "$f" | grep -q "Mach-O"; then
326-
codesign --force --sign - --timestamp=none "$f"
327-
fi
328-
done < <(find "$APP/Contents" -type f -print0)
258+
find "$APP/Contents" -type f \
259+
-exec sh -c 'file -b "$1" | grep -q "Mach-O" && codesign --force --sign - --timestamp=none "$1" || true' _ {} \;
329260
# Finally sign the app wrapper (no --deep)
330261
codesign --force --sign - --timestamp=none "$APP"
331262
codesign --verify --verbose=2 "$APP" || (codesign --display --verbose=5 "$APP"; exit 1)
@@ -365,11 +296,8 @@ jobs:
365296
security import "$RUNNER_TEMP/dev_cert.p12" -k "$KEYCHAIN_PATH" -P "$APPLE_DEVELOPER_CERT_PASSWORD" -A
366297
security list-keychain -d user -s "$KEYCHAIN_PATH" login.keychain-db
367298
# Re-sign Mach-O components, then the app wrapper (no --deep)
368-
while IFS= read -r -d '' f; do
369-
if file -b "$f" | grep -q "Mach-O"; then
370-
codesign --force --options runtime --timestamp --sign "$APPLE_SIGNING_IDENTITY" "$f"
371-
fi
372-
done < <(find "$APP/Contents" -type f -print0)
299+
find "$APP/Contents" -type f \
300+
-exec sh -c 'file -b "$1" | grep -q "Mach-O" && codesign --force --options runtime --timestamp --sign "$APPLE_SIGNING_IDENTITY" "$1" || true' _ {} \;
373301
codesign --force --options runtime --timestamp --sign "$APPLE_SIGNING_IDENTITY" "$APP"
374302
codesign --verify --strict --verbose=2 "$APP"
375303

0 commit comments

Comments
 (0)