Move macOS installer image creation logic from GitHub workflow file to a dedicated shell script `mkmaciso` for better maintainability and reusability. Changes: - Add support for legacy macOS versions: - 10.7 (Lion) - 10.8 (Mountain Lion) - 10.9 (Mavericks) - 10.10 (Yosemite) - 10.11 (El Capitan) - 10.12 (Sierra) - Simplify workflow to call external script - Enable running `mkmaciso` locally without GitHub Actions
97 lines
3.3 KiB
YAML
97 lines
3.3 KiB
YAML
name: Build macOS Installer ISO/DMG image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
macos_version:
|
|
description: 'Select a macOS version to build'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- 'Tahoe'
|
|
- 'Sequoia'
|
|
- 'Sonoma'
|
|
- 'Ventura'
|
|
- 'Monterey'
|
|
- 'Big Sur'
|
|
- 'Catalina'
|
|
- 'Mojave'
|
|
- 'High Sierra'
|
|
- 'Sierra'
|
|
- 'El Capitan'
|
|
- 'Yosemite'
|
|
- 'Mavericks'
|
|
- 'Mountain Lion'
|
|
- 'Lion'
|
|
image_format:
|
|
description: 'Select image format: iso for virtual machines, dmg for burning to USB drive'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- 'iso'
|
|
- 'dmg'
|
|
|
|
jobs:
|
|
build-installer:
|
|
runs-on: macos-15-intel
|
|
timeout-minutes: 70
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: System Information
|
|
run: |
|
|
echo "Runner OS: $(sw_vers -productName) $(sw_vers -productVersion)"
|
|
echo "Architecture: $(uname -m)"
|
|
echo "Available disk space:"
|
|
df -h
|
|
echo "Memory:"
|
|
top -l 1 | grep PhysMem
|
|
|
|
- name: Create Image
|
|
id: create_image
|
|
run: |
|
|
if [ "${{ github.event.inputs.image_format }}" == "iso" ]; then
|
|
echo "Creating macOS ${{ github.event.inputs.macos_version }} ISO image"
|
|
bash mkmaciso "${{ github.event.inputs.macos_version }}"
|
|
echo "image_name=$(basename *.iso)" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Creating macOS ${{ github.event.inputs.macos_version }} DMG image"
|
|
bash mkmaciso "${{ github.event.inputs.macos_version }}" dmg
|
|
echo "image_name=$(basename *.dmg)" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Upload ISO artifact
|
|
if: github.event.inputs.image_format == 'iso'
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: ${{ steps.create_image.outputs.image_name }}
|
|
path: ./*.iso
|
|
compression-level: 0
|
|
retention-days: 7
|
|
|
|
- name: Upload DMG artifact
|
|
if: github.event.inputs.image_format == 'dmg'
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: ${{ steps.create_image.outputs.image_name }}
|
|
path: ./*.dmg
|
|
compression-level: 0
|
|
retention-days: 7
|
|
|
|
- name: Summary
|
|
run: |
|
|
if [ "${{ github.event.inputs.image_format }}" == "iso" ]; then
|
|
echo "## Successfully built $(basename *.iso)" >> $GITHUB_STEP_SUMMARY
|
|
echo "Note: This ISO is intended for create macOS virtual machine on Proxmox VE, QEMU, VMware, and VirtualBox." >> $GITHUB_STEP_SUMMARY
|
|
else
|
|
echo "## Successfully built $(basename *.dmg)" >> $GITHUB_STEP_SUMMARY
|
|
echo 'Note: This DMG is intended for flash to USB drive using [Rufus](https://rufus.ie/en/#download) (Windows) or dd (Linux)' >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Found this useful? Give it a ⭐ star so others can find it too! https://github.com/LongQT-sea/macos-iso-builder" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "> [!TIP]" >> $GITHUB_STEP_SUMMARY
|
|
echo "> Enable [Cloudflare WARP](https://one.one.one.one/) for faster downloads." >> $GITHUB_STEP_SUMMARY
|