98 lines
3.4 KiB
YAML
98 lines
3.4 KiB
YAML
# Unsigned release .ipa for sideloading (no Apple Developer account needed to build).
|
|
# The output must be signed on install, e.g. with Sideloadly or AltStore and a free Apple ID.
|
|
# Run it from the Actions tab ("Run workflow"), or push a tag like v1.0.0.
|
|
name: iOS unsigned IPA
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
ipa:
|
|
runs-on: macos-26
|
|
timeout-minutes: 75
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest-stable
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
|
|
- run: npm ci
|
|
|
|
# ios/ is generated from app.json and config plugins (Continuous Native Generation)
|
|
- name: Generate the native project
|
|
run: npx expo prebuild --platform ios --clean
|
|
|
|
- name: Archive without signing
|
|
run: |
|
|
# the project is named after app.json "name" without spaces ("AI Usage" -> AIUsage)
|
|
WORKSPACE=$(ls -d ios/*.xcworkspace | head -1)
|
|
SCHEME=$(basename "$WORKSPACE" .xcworkspace)
|
|
ARCHIVE="$RUNNER_TEMP/App.xcarchive"
|
|
xcodebuild archive \
|
|
-workspace "$WORKSPACE" \
|
|
-scheme "$SCHEME" \
|
|
-configuration Release \
|
|
-destination 'generic/platform=iOS' \
|
|
-archivePath "$ARCHIVE" \
|
|
CODE_SIGNING_ALLOWED=NO \
|
|
CODE_SIGNING_REQUIRED=NO \
|
|
CODE_SIGN_IDENTITY="" \
|
|
| tee "$RUNNER_TEMP/xcodebuild.log" | grep -E "error:|\*\* ARCHIVE" || true
|
|
ls -d "$ARCHIVE"/Products/Applications/*.app
|
|
|
|
- name: Package the .ipa
|
|
run: |
|
|
ARCHIVE="$RUNNER_TEMP/App.xcarchive"
|
|
VERSION=$(node -p "require('./app.json').expo.version")
|
|
APP=$(ls -d "$ARCHIVE"/Products/Applications/*.app | head -1)
|
|
# main Info.plist and executable first: some sideloading tools only scan the head of
|
|
# the archive for the main bundle (see scripts/package-ipa.py)
|
|
python3 scripts/package-ipa.py "$APP" "$RUNNER_TEMP/AIUsage-$VERSION-unsigned.ipa"
|
|
echo "IPA=$RUNNER_TEMP/AIUsage-$VERSION-unsigned.ipa" >> "$GITHUB_ENV"
|
|
ls -lh "$RUNNER_TEMP"/*.ipa
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: AIUsage-unsigned-ipa
|
|
path: ${{ env.IPA }}
|
|
retention-days: 30
|
|
|
|
# a v* tag publishes a GitHub Release; the Android workflow attaches its .apk to the same one
|
|
# release notes = this version's changelog (.github/changes/<tag>.md) + the install guide
|
|
- name: Compose release notes
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
{
|
|
if [ -f ".github/changes/${GITHUB_REF_NAME}.md" ]; then
|
|
cat ".github/changes/${GITHUB_REF_NAME}.md"
|
|
echo
|
|
fi
|
|
cat .github/release-notes.md
|
|
} > "$RUNNER_TEMP/release-notes.md"
|
|
|
|
- name: Attach to the GitHub Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: AI Usage ${{ github.ref_name }}
|
|
body_path: ${{ runner.temp }}/release-notes.md
|
|
files: ${{ env.IPA }}
|
|
|
|
- name: Keep the build log on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: xcodebuild-log
|
|
path: ${{ runner.temp }}/xcodebuild.log
|