Update build.yml

This commit is contained in:
Tieu Long authored and GitHub committed 2025-10-30 23:17:41 +07:00
1 parent f39f87a2f8
commit cc9034344a
1 file changed
+17 -5
+17 -5
View File
@@ -87,8 +87,18 @@ jobs:
echo "Download failed after $MAX_RETRIES attempts"
exit 1
fi
# Verify installer exists and set path
INSTALLER_PATH="/Applications/Install macOS ${{ github.event.inputs.macos_version }}.app"
if [ ! -d "$INSTALLER_PATH" ]; then
echo "Error: Installer not found at $INSTALLER_PATH"
ls -la /Applications/Install*.app 2>/dev/null || echo "No Install*.app found"
exit 1
fi
echo "Installer found at: $INSTALLER_PATH"
- name: Create ISO
id: create_iso
run: |
echo "Creating ISO for macOS ${{ github.event.inputs.macos_version }}"
@@ -98,9 +108,10 @@ jobs:
SPARSE_IMAGE="$HOME/${ISO_NAME}.sparseimage"
ISO_FILE="${GITHUB_WORKSPACE}/${ISO_NAME}.iso"
VOLUME_NAME="${ISO_NAME}_installer"
INSTALLER_PATH="/Applications/Install macOS ${{ github.event.inputs.macos_version }}.app"
echo "ISO will be created at: $ISO_FILE"
echo "Using installer at: ${{ env.installer_path }}"
echo "Using installer at: $INSTALLER_PATH"
# Create sparse image
echo "Creating sparse image..."
@@ -108,7 +119,7 @@ jobs:
# Create install media
echo "Creating install media..."
sudo "/Applications/Install macOS ${{ github.event.inputs.macos_version }}.app/Contents/Resources/createinstallmedia" --volume "/Volumes/$VOLUME_NAME" --nointeraction
sudo "$INSTALLER_PATH/Contents/Resources/createinstallmedia" --volume "/Volumes/$VOLUME_NAME" --nointeraction
# Detach volume
echo "Detaching volume..."
@@ -124,12 +135,13 @@ jobs:
echo "Cleaning up temporary files..."
rm -f "$SPARSE_IMAGE"
# Show ISO info
# Show ISO info and set output
if [ -f "$ISO_FILE" ]; then
ISO_SIZE=$(du -h "$ISO_FILE" | cut -f1)
echo "ISO created successfully!"
echo "ISO file: $ISO_FILE"
echo "ISO size: $ISO_SIZE"
echo "iso_size=$ISO_SIZE" >> $GITHUB_OUTPUT
else
echo "Error: ISO file not created"
exit 1
@@ -139,7 +151,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: macOS-${{ github.event.inputs.macos_version }}-${{ steps.fetch_installers.outputs.version }}-ISO
path: *.iso
path: "*.iso"
compression-level: 0
- name: Summary
@@ -150,6 +162,6 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "**macOS Version:** ${{ github.event.inputs.macos_version }}" >> $GITHUB_STEP_SUMMARY
echo "**Version Number:** ${{ steps.fetch_installers.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "**ISO Size:** ${{ env.iso_size }}" >> $GITHUB_STEP_SUMMARY
echo "**ISO Size:** ${{ steps.create_iso.outputs.iso_size }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Download the ISO from the artifacts section above." >> $GITHUB_STEP_SUMMARY