From 5d9054154cdada36329b61321b60002b1350362e Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:28:27 +0200 Subject: [PATCH] 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}. --- .github/workflows/build-macos.yml | 38 ++++++++++++------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 4775823..2237ff8 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -263,12 +263,6 @@ jobs: exit 1 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) shell: bash run: | @@ -288,26 +282,24 @@ jobs: if [ -n "$app_path" ] && [ -d "$app_path" ]; then app_base="$(basename "$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") echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip" + + # Create DMG (Manual) + echo "Creating DMG from $app_path..." + mkdir -p dmg_stage + cp -R "$app_path" "dmg_stage/" + ln -s /Applications "dmg_stage/Applications" + + hdiutil create -volname "YTSage v${version}" -srcfolder "dmg_stage" -ov -format UDZO "artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" + echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" + + rm -rf dmg_stage else - echo "Warning: .app bundle not found in dist/ or build/" - fi - - # Try to find the generated DMG - dmg_src="" - for cand in "dist/YTSage-v${version}.dmg"; do - if [ -f "$cand" ]; then dmg_src="$cand"; break; fi - done - 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 - cp "$dmg_src" "artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" - echo "Copied DMG to artifacts" - else - echo "Warning: No DMG found" + echo "Error: .app bundle not found in dist/ or build/" + exit 1 fi echo "Final artifacts:"