Skip to content

A native macOS app for managing virtual iPhones - browse, create, and boot iOS research VMs from a single window.

Swift

ci: Add release workflow with build-time version stamping

zqxwce8618de6e01c2
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..eaca75a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,61 @@
+name: Release
+
+# Build the app and attach it to a GitHub release whenever a version tag is pushed.
+# Tag with the semver, e.g.: git tag v1.0.0 && git push origin v1.0.0
+on:
+ push:
+ tags: ['v*']
+
+permissions:
+ contents: write # create the release and upload the asset
+
+jobs:
+ build:
+ runs-on: macos-15
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Toolchain info
+ run: swift --version && xcodebuild -version
+
+ # Read the tag via env (never inline untrusted input in a shell), and validate
+ # it is a clean semver so downstream steps can interpolate it safely.
+ - name: Version from tag
+ id: v
+ env:
+ REF_NAME: ${{ github.ref_name }}
+ run: |
+ version="${REF_NAME#v}"
+ if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
+ echo "::error::Tag '$REF_NAME' is not a valid version (expected vMAJOR.MINOR.PATCH)"
+ exit 1
+ fi
+ echo "version=$version" >> "$GITHUB_OUTPUT"
+
+ - name: Build & bundle
+ env:
+ VPHONE_WS_VERSION: ${{ steps.v.outputs.version }}
+ run: ./scripts/bundle.sh
+
+ - name: Verify stamped version
+ env:
+ VERSION: ${{ steps.v.outputs.version }}
+ run: |
+ got=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" \
+ .build/vphone-ws.app/Contents/Info.plist)
+ echo "bundled CFBundleShortVersionString = $got"
+ [ "$got" = "$VERSION" ] || { echo "version mismatch"; exit 1; }
+
+ - name: Package .app
+ env:
+ VERSION: ${{ steps.v.outputs.version }}
+ run: |
+ ditto -c -k --sequesterRsrc --keepParent \
+ .build/vphone-ws.app "vphone-ws-$VERSION.zip"
+
+ - name: Publish release
+ uses: softprops/action-gh-release@v2
+ with:
+ files: vphone-ws-${{ steps.v.outputs.version }}.zip
+ fail_on_unmatched_files: true
+ generate_release_notes: true
diff --git a/Resources/Info.plist b/Resources/Info.plist
index 6ac2a59..fb00f1f 100644
--- a/Resources/Info.plist
+++ b/Resources/Info.plist
@@ -12,5 +12,6 @@
<key>CFBundleVersion</key><string>1</string>
<key>LSMinimumSystemVersion</key><string>15.0</string>
<key>NSHighResolutionCapable</key><true/>
+ <key>NSHumanReadableCopyright</key><string>© 2026 zqxwce · MIT License</string>
</dict>
</plist>
diff --git a/scripts/bundle.sh b/scripts/bundle.sh
index 0ae0729..d33b945 100755
--- a/scripts/bundle.sh
+++ b/scripts/bundle.sh
@@ -8,4 +8,12 @@ mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp Resources/Info.plist "$APP/Contents/Info.plist"
cp Resources/AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
cp .build/release/vphone-ws "$APP/Contents/MacOS/vphone-ws"
+
+# Stamp the release version (from the git tag, passed by CI) so the About panel
+# shows it. Dev builds leave VPHONE_WS_VERSION unset and keep the plist default.
+if [[ -n "${VPHONE_WS_VERSION:-}" ]]; then
+ /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${VPHONE_WS_VERSION}" "$APP/Contents/Info.plist"
+ /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${VPHONE_WS_VERSION}" "$APP/Contents/Info.plist"
+ echo "stamped version ${VPHONE_WS_VERSION}"
+fi
echo "built $APP"