From 87d21c9a9db4406fc3b744a7c8fe179d63900627 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 1 Sep 2025 18:45:57 +0300 Subject: [PATCH] Add macOS version matrix and arch-specific artifacts The build workflow now runs on both macos-14 and macos-13 using a matrix strategy. Artifact names for .app and .dmg files now include architecture suffixes (arm64/x64), and additional environment variables are set for architecture detection. The release step is updated to append to the draft release and handle unmatched files gracefully. --- .github/workflows/build-macos.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 72c4b55..abb9881 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -13,7 +13,10 @@ env: jobs: build-macos: - runs-on: macos-latest + strategy: + matrix: + os: [macos-14, macos-13] + runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -60,7 +63,14 @@ jobs: run: | version="${{ steps.get_version.outputs.VERSION }}" echo "VERSION=$version" >> "$GITHUB_ENV" - echo "Prepared build variables for version: $version" + arch="$(uname -m)" # arm64 or x86_64 + echo "ARCH=$arch" >> "$GITHUB_ENV" + if [ "$arch" = "arm64" ]; then + echo "ARCH_SUFFIX=arm64" >> "$GITHUB_ENV" + else + echo "ARCH_SUFFIX=x64" >> "$GITHUB_ENV" + fi + echo "Prepared build variables for version: $version on $(uname -a)" - name: Create cx_Freeze setup script shell: bash @@ -201,8 +211,8 @@ jobs: rm -rf "$app_path/Contents/Resources/assets/branding/screenshots" echo "Removed screenshots folder from .app bundle at $app_path" fi - (cd "$app_parent" && zip -r "${GITHUB_WORKSPACE}/artifacts/${app_base}.zip" "$app_base") - echo "Created: artifacts/${app_base}.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" else echo "Warning: .app bundle not found in dist/ or build/" fi @@ -218,8 +228,8 @@ jobs: if [ -n "$dmg_src" ] && [ -f "$dmg_src" ]; then # Rename the DMG to a consistent name in artifacts - cp "$dmg_src" "artifacts/YTSage-v${version}.dmg" - echo "Copied DMG to artifacts from $dmg_src -> artifacts/YTSage-v${version}.dmg" + cp "$dmg_src" "artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" + echo "Copied DMG to artifacts from $dmg_src -> artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg" else echo "Warning: No DMG found in dist/ or build/" fi @@ -227,13 +237,15 @@ jobs: echo "Final artifacts:" ls -lh artifacts || true - - name: Create draft release + - name: Create/Update draft release uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.ref_name }} name: YTSage ${{ github.ref_name }} draft: true prerelease: false + append_body: true + fail_on_unmatched_files: false body: | # YTSage ${{ github.ref_name }}