- Shared Xcode scheme for headless xcodebuild - build.yml: build unsigned IPA on push/PR, upload artifact - release.yml: on v* tags (or manual dispatch), publish Release with IPA
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Build IPA
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: build-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build unsigned IPA
|
|
runs-on: macos-15
|
|
timeout-minutes: 45
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Select Xcode
|
|
run: |
|
|
# Prefer newest installed Xcode
|
|
ls /Applications | grep -i Xcode || true
|
|
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
|
xcodebuild -version
|
|
xcodebuild -showsdks | grep iphoneos || true
|
|
|
|
- name: Resolve packages
|
|
run: |
|
|
xcodebuild -project "Pocket Poster.xcodeproj" \
|
|
-scheme "Pocket Poster" \
|
|
-resolvePackageDependencies
|
|
|
|
- name: Build IPA
|
|
run: |
|
|
chmod +x ./ipabuild.sh
|
|
./ipabuild.sh
|
|
|
|
- name: Prepare artifact
|
|
run: |
|
|
VERSION=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' \
|
|
"build/DerivedDataApp/Build/Products/Release-iphoneos/Pocket Poster.app/Info.plist" 2>/dev/null \
|
|
|| grep -m1 'MARKETING_VERSION' "Pocket Poster.xcodeproj/project.pbxproj" | sed 's/[^0-9.]//g')
|
|
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
|
test -f "build/Pocket_Poster.ipa" || cp "build/Pocket Poster.ipa" "build/Pocket_Poster.ipa"
|
|
cp "build/Pocket_Poster.ipa" "build/Pocket_Poster_${VERSION}.ipa"
|
|
ls -lh build/*.ipa
|
|
|
|
- name: Upload IPA (artifact)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Pocket_Poster-${{ env.VERSION }}
|
|
path: |
|
|
build/Pocket_Poster.ipa
|
|
build/Pocket_Poster_*.ipa
|
|
if-no-files-found: error
|
|
retention-days: 30
|