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.
This commit is contained in:
@@ -13,7 +13,10 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [macos-14, macos-13]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -60,7 +63,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.VERSION }}"
|
version="${{ steps.get_version.outputs.VERSION }}"
|
||||||
echo "VERSION=$version" >> "$GITHUB_ENV"
|
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
|
- name: Create cx_Freeze setup script
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -201,8 +211,8 @@ jobs:
|
|||||||
rm -rf "$app_path/Contents/Resources/assets/branding/screenshots"
|
rm -rf "$app_path/Contents/Resources/assets/branding/screenshots"
|
||||||
echo "Removed screenshots folder from .app bundle at $app_path"
|
echo "Removed screenshots folder from .app bundle at $app_path"
|
||||||
fi
|
fi
|
||||||
(cd "$app_parent" && zip -r "${GITHUB_WORKSPACE}/artifacts/${app_base}.zip" "$app_base")
|
(cd "$app_parent" && zip -r "${GITHUB_WORKSPACE}/artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip" "$app_base")
|
||||||
echo "Created: artifacts/${app_base}.zip"
|
echo "Created: artifacts/YTSage-v${version}-${ARCH_SUFFIX}.app.zip"
|
||||||
else
|
else
|
||||||
echo "Warning: .app bundle not found in dist/ or build/"
|
echo "Warning: .app bundle not found in dist/ or build/"
|
||||||
fi
|
fi
|
||||||
@@ -218,8 +228,8 @@ jobs:
|
|||||||
|
|
||||||
if [ -n "$dmg_src" ] && [ -f "$dmg_src" ]; then
|
if [ -n "$dmg_src" ] && [ -f "$dmg_src" ]; then
|
||||||
# Rename the DMG to a consistent name in artifacts
|
# Rename the DMG to a consistent name in artifacts
|
||||||
cp "$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}.dmg"
|
echo "Copied DMG to artifacts from $dmg_src -> artifacts/YTSage-v${version}-${ARCH_SUFFIX}.dmg"
|
||||||
else
|
else
|
||||||
echo "Warning: No DMG found in dist/ or build/"
|
echo "Warning: No DMG found in dist/ or build/"
|
||||||
fi
|
fi
|
||||||
@@ -227,13 +237,15 @@ jobs:
|
|||||||
echo "Final artifacts:"
|
echo "Final artifacts:"
|
||||||
ls -lh artifacts || true
|
ls -lh artifacts || true
|
||||||
|
|
||||||
- name: Create draft release
|
- name: Create/Update draft release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ github.ref_name }}
|
||||||
name: YTSage ${{ github.ref_name }}
|
name: YTSage ${{ github.ref_name }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
append_body: true
|
||||||
|
fail_on_unmatched_files: false
|
||||||
body: |
|
body: |
|
||||||
# YTSage ${{ github.ref_name }}
|
# YTSage ${{ github.ref_name }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user