Manually create DMG and ZIP artifacts

Remove the separate bdist_dmg build step and instead package the generated .app in-place: create a .app.zip and build a UDZO .dmg using a temporary dmg_stage (copy .app, add Applications symlink, run hdiutil). Also remove the previous fallback that searched for prebuilt DMGs and change missing .app handling to error+exit. Artifacts are written to artifacts/YTSage-v${version}-${ARCH_SUFFIX}.{app.zip,dmg}.
This commit is contained in:
oop7
2026-02-03 16:28:27 +02:00
parent ac11cbd7bb
commit 5d9054154c
+13 -21
View File
@@ -263,12 +263,6 @@ jobs:
exit 1 exit 1
fi fi
- name: Build DMG (bdist_dmg)
shell: bash
run: |
source venv/bin/activate
python setup_cxfreeze.py bdist_dmg
- name: Package and prepare release artifacts (.app.zip and .dmg) - name: Package and prepare release artifacts (.app.zip and .dmg)
shell: bash shell: bash
run: | run: |
@@ -288,26 +282,24 @@ jobs:
if [ -n "$app_path" ] && [ -d "$app_path" ]; then if [ -n "$app_path" ] && [ -d "$app_path" ]; then
app_base="$(basename "$app_path")" app_base="$(basename "$app_path")"
app_parent="$(dirname "$app_path")" app_parent="$(dirname "$app_path")"
# Create ZIP
(cd "$app_parent" && zip -r "${GITHUB_WORKSPACE}/artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip" "$app_base") (cd "$app_parent" && zip -r "${GITHUB_WORKSPACE}/artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip" "$app_base")
echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip" echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip"
else
echo "Warning: .app bundle not found in dist/ or build/"
fi
# Try to find the generated DMG # Create DMG (Manual)
dmg_src="" echo "Creating DMG from $app_path..."
for cand in "dist/YTSage-v${version}.dmg"; do mkdir -p dmg_stage
if [ -f "$cand" ]; then dmg_src="$cand"; break; fi cp -R "$app_path" "dmg_stage/"
done ln -s /Applications "dmg_stage/Applications"
if [ -z "$dmg_src" ]; then
dmg_src=$(ls dist/*.dmg build/*.dmg build/dist/*.dmg 2>/dev/null | head -n1 || true)
fi
if [ -n "$dmg_src" ] && [ -f "$dmg_src" ]; then hdiutil create -volname "YTSage v${version}" -srcfolder "dmg_stage" -ov -format UDZO "artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg"
cp "$dmg_src" "artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg"
echo "Copied DMG to artifacts"
rm -rf dmg_stage
else else
echo "Warning: No DMG found" echo "Error: .app bundle not found in dist/ or build/"
exit 1
fi fi
echo "Final artifacts:" echo "Final artifacts:"