StikDebug/.github/workflows/build_ipa.yml
umarfatmi05 de3f34292f CI: build this branch, and stop pinning a disappearing Xcode
Build the cellular work on GitHub's macOS runners so it can be compiled and
packaged without a local Mac.

- Trigger the IPA build on the working branches, not just main.
- Use latest-stable instead of a pinned Xcode. The pin (26.0.1) predates the
  PR, which had itself bumped to 26.6.0; pinned versions get dropped from the
  runner images and fail the build for reasons unrelated to the code.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 19:05:20 -04:00

103 lines
3.6 KiB
YAML

name: Build Debug IPA
on:
push:
branches: [ "main", "cellular-fix", "location-persistence" ]
tags: [ "[0-9]*" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
create_release:
description: Create a GitHub release from this ref
required: false
default: false
type: boolean
permissions:
contents: write
jobs:
build:
name: Build IPA
runs-on: macos-latest
env:
UPLOAD_IPA: ${{ vars.UPLOAD_IPA || 'true' }}
steps:
- name: 1. Fetch Source Code
uses: actions/checkout@v6
- name: 2. Configure Xcode Environment
uses: maxim-lobanov/setup-xcode@v1
with:
# Pinned versions vanish from the runner images over time, and this pin
# has already had to be bumped twice. latest-stable avoids a build
# failure that is really just a missing toolchain.
xcode-version: 'latest-stable'
- name: 3. Compile Project Archive
run: |
xcodebuild clean archive \
-project StikDebug.xcodeproj \
-scheme "StikDebug" \
-configuration Debug \
-archivePath build/StikDebug.xcarchive \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
SWIFT_OPTIMIZATION_LEVEL="-Onone" \
IPHONEOS_DEPLOYMENT_TARGET=17.4
- name: 4. Package .app into .ipa
run: |
cp -R build/StikDebug.xcarchive/Products/Applications/StikDebug.app .
mkdir -p Payload
cp -R StikDebug.app Payload/
zip -r StikDebug.ipa Payload
rm -rf Payload StikDebug.app
- name: 5. Name workflow artifact
id: artifact
if: env.UPLOAD_IPA == 'true' && (github.event_name == 'push' || github.event_name == 'pull_request')
run: |
file_name="StikDebug-${GITHUB_SHA::7}.ipa"
cp StikDebug.ipa "$file_name"
echo "file_name=$file_name" >> "$GITHUB_OUTPUT"
- name: 6. Store IPA as Workflow Artifact
if: env.UPLOAD_IPA == 'true' && (github.event_name == 'push' || github.event_name == 'pull_request')
uses: actions/upload-artifact@v7
with:
path: ${{ steps.artifact.outputs.file_name }}
archive: false
retention-days: 90
- name: Read version
id: version
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
run: |
version=$(xcodebuild -project StikDebug.xcodeproj -scheme StikDebug -showBuildSettings | awk -F ' = ' '/ MARKETING_VERSION = / { print $2; exit }')
test -n "$version"
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
test "${GITHUB_REF_NAME#v}" = "$version"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Name release asset
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
run: mv StikDebug.ipa StikDebug-${{ steps.version.outputs.version }}.ipa
- name: Publish release
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
uses: softprops/action-gh-release@v3
with:
name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || steps.version.outputs.version }}
target_commitish: ${{ github.sha }}
files: StikDebug-${{ steps.version.outputs.version }}.ipa
generate_release_notes: true
fail_on_unmatched_files: true