Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Build and publish VPhone bundle with GitHub Actions

Lakr08db376d9417
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..48aae596
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,36 @@
+name: build
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ runs-on: macos-26
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Toolchain versions
+ run: |
+ swift --version
+ xcodebuild -version
+
+ - name: Build VPhone.bundle
+ env:
+ SWIFT_JOBS: "4"
+ run: |
+ xcodebuild -workspace VPhone.xcworkspace -scheme VPhone \
+ -configuration Debug -destination 'platform=macOS,arch=arm64' \
+ -derivedDataPath .build/XcodeBundle -jobs 4 build
+
+ - name: Verify bundle
+ run: |
+ set -euo pipefail
+ zsh VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh \
+ .build/XcodeBundle/Build/Products/Debug/VPhone.bundle
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 00fa32fe..14ba59af 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,12 +1,17 @@
name: release
-# Build the portable, signed vphone-cli.app and attach it to a published
-# GitHub Release. Validate the actual application bundle; no Homebrew
-# packages or separately provisioned runtime tools are required.
+# Build the self-contained VPhone.bundle and attach it to a published
+# GitHub Release. The Xcode scheme signs and validates the bundle.
on:
release:
types: [published]
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: Existing release tag to build and upload
+ required: true
+ type: string
permissions:
contents: write
@@ -17,31 +22,38 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Toolchain versions
run: |
swift --version
xcodebuild -version
- - name: Build and bundle (portable .app)
+ - name: Build VPhone.bundle
env:
SWIFT_JOBS: "4"
- run: ./Scripts/build.sh
+ run: |
+ xcodebuild -workspace VPhone.xcworkspace -scheme VPhone \
+ -configuration Release -destination 'platform=macOS,arch=arm64' \
+ -derivedDataPath .build/XcodeBundle -jobs 4 build
- - name: Verify application bundle
+ - name: Verify bundle
run: |
set -euo pipefail
- codesign --verify --strict .build/vphone-cli.app
- test -x .build/vphone-cli.app/Contents/Resources/guest/vphoned
- zsh Scripts/check_aux.sh
+ zsh VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh \
+ .build/XcodeBundle/Build/Products/Release/VPhone.bundle
- - name: Package app
+ - name: Package bundle
env:
- TAG: ${{ github.event.release.tag_name }}
- run: ditto -c -k --keepParent .build/vphone-cli.app "vphone-cli-${TAG}.zip"
+ TAG: ${{ github.event.release.tag_name || inputs.tag }}
+ run: |
+ ditto -c -k --keepParent \
+ .build/XcodeBundle/Build/Products/Release/VPhone.bundle \
+ "VPhone-${TAG}.zip"
- name: Upload to release
env:
GH_TOKEN: ${{ github.token }}
- TAG: ${{ github.event.release.tag_name }}
- run: gh release upload "$TAG" "vphone-cli-${TAG}.zip" --clobber
+ TAG: ${{ github.event.release.tag_name || inputs.tag }}
+ run: gh release upload "$TAG" "VPhone-${TAG}.zip" --clobber