Update build.yml
This commit is contained in:
1 parent
f39f87a2f8
commit
cc9034344a
1 file changed
+17
-5
@@ -87,8 +87,18 @@ jobs:
|
|||||||
echo "Download failed after $MAX_RETRIES attempts"
|
echo "Download failed after $MAX_RETRIES attempts"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
- name: Create ISO
|
||||||
|
id: create_iso
|
||||||
run: |
|
run: |
|
||||||
echo "Creating ISO for macOS ${{ github.event.inputs.macos_version }}"
|
echo "Creating ISO for macOS ${{ github.event.inputs.macos_version }}"
|
||||||
|
|
||||||
@@ -98,9 +108,10 @@ jobs:
|
|||||||
SPARSE_IMAGE="$HOME/${ISO_NAME}.sparseimage"
|
SPARSE_IMAGE="$HOME/${ISO_NAME}.sparseimage"
|
||||||
ISO_FILE="${GITHUB_WORKSPACE}/${ISO_NAME}.iso"
|
ISO_FILE="${GITHUB_WORKSPACE}/${ISO_NAME}.iso"
|
||||||
VOLUME_NAME="${ISO_NAME}_installer"
|
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 "ISO will be created at: $ISO_FILE"
|
||||||
echo "Using installer at: ${{ env.installer_path }}"
|
echo "Using installer at: $INSTALLER_PATH"
|
||||||
|
|
||||||
# Create sparse image
|
# Create sparse image
|
||||||
echo "Creating sparse image..."
|
echo "Creating sparse image..."
|
||||||
@@ -108,7 +119,7 @@ jobs:
|
|||||||
|
|
||||||
# Create install media
|
# Create install media
|
||||||
echo "Creating 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
|
# Detach volume
|
||||||
echo "Detaching volume..."
|
echo "Detaching volume..."
|
||||||
@@ -124,12 +135,13 @@ jobs:
|
|||||||
echo "Cleaning up temporary files..."
|
echo "Cleaning up temporary files..."
|
||||||
rm -f "$SPARSE_IMAGE"
|
rm -f "$SPARSE_IMAGE"
|
||||||
|
|
||||||
# Show ISO info
|
# Show ISO info and set output
|
||||||
if [ -f "$ISO_FILE" ]; then
|
if [ -f "$ISO_FILE" ]; then
|
||||||
ISO_SIZE=$(du -h "$ISO_FILE" | cut -f1)
|
ISO_SIZE=$(du -h "$ISO_FILE" | cut -f1)
|
||||||
echo "ISO created successfully!"
|
echo "ISO created successfully!"
|
||||||
echo "ISO file: $ISO_FILE"
|
echo "ISO file: $ISO_FILE"
|
||||||
echo "ISO size: $ISO_SIZE"
|
echo "ISO size: $ISO_SIZE"
|
||||||
|
echo "iso_size=$ISO_SIZE" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "Error: ISO file not created"
|
echo "Error: ISO file not created"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -139,7 +151,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: macOS-${{ github.event.inputs.macos_version }}-${{ steps.fetch_installers.outputs.version }}-ISO
|
name: macOS-${{ github.event.inputs.macos_version }}-${{ steps.fetch_installers.outputs.version }}-ISO
|
||||||
path: *.iso
|
path: "*.iso"
|
||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
@@ -150,6 +162,6 @@ jobs:
|
|||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**macOS Version:** ${{ github.event.inputs.macos_version }}" >> $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 "**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 "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Download the ISO from the artifacts section above." >> $GITHUB_STEP_SUMMARY
|
echo "Download the ISO from the artifacts section above." >> $GITHUB_STEP_SUMMARY
|
||||||
Reference in new issue
Block a user