add pvjit to fix missing module xcode issue #1211
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload Provenance | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY: ${{ github.workspace }} | |
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer | |
XCODE_VERSION: '16.0' | |
jobs: | |
build: | |
name: Build and upload Provenance | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: "Provenance-Lite-iOS" | |
sdk: iphoneos | |
scheme: "Provenance-Lite (AppStore) (Release)" | |
APP_NAME: "Provenance Lite" | |
IPA_NAME: "Provenance-Lite-iOS" | |
- target: "Provenance-Lite-tvOS" | |
sdk: appletvos | |
scheme: "Provenance-Lite (AppStore) (Release)" | |
APP_NAME: "Provenance Lite" | |
IPA_NAME: "Provenance-Lite-tvOS" | |
- target: "Provenance-iOS" | |
sdk: iphoneos | |
scheme: "Provenance (AppStore) (Release)" | |
APP_NAME: "Provenance" | |
IPA_NAME: "Provenance-iOS" | |
- target: "Provenance-tvOS" | |
sdk: appletvos | |
scheme: "Provenance (AppStore) (Release)" | |
APP_NAME: "Provenance" | |
IPA_NAME: "Provenance-tvOS" | |
runs-on: 'macos-latest' | |
timeout-minutes: 300 | |
steps: | |
- name: Cache Git checkout | |
uses: actions/cache@v3 | |
with: | |
path: . | |
key: git-checkout-${{ github.sha }} | |
restore-keys: | | |
git-checkout- | |
- name: Checkout code | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Setup Xcode | |
uses: maxim-lobanov/setup-xcode@v1.6.0 | |
with: | |
xcode-version: ${{ env.XCODE_VERSION }} | |
- name: Set Build Number | |
run: | | |
BUILD_NUMBER=$(git rev-list --count HEAD) | |
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV | |
echo "MARKETING_VERSION=$(grep 'MARKETING_VERSION' Build.xcconfig | cut -d'=' -f2 | xargs)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
.build | |
~/Library/Caches/org.swift.swiftpm | |
~/Library/Developer/Xcode/DerivedData | |
key: ${{ runner.os }}-spm-xcode-${{ hashFiles('**/Package.resolved') }}-${{ hashFiles('**/*.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-spm-xcode- | |
- name: Install dependencies | |
run: | | |
brew install ldid | |
brew install xcbeautify | |
- name: Clean Build Directory | |
run: | | |
rm -rf ./build | |
mkdir -p ./build | |
- name: Build Provenance | |
id: build | |
env: | |
MARKETING_VERSION: ${{ env.MARKETING_VERSION }} | |
BUILD_NUMBER: ${{ env.BUILD_NUMBER }} | |
run: | | |
start_time=$(date +%s) | |
xcodebuild -configuration Release \ | |
-workspace Provenance.xcworkspace \ | |
-scheme "${{ matrix.scheme }}" \ | |
-sdk ${{ matrix.sdk }} \ | |
-skipPackagePluginValidation \ | |
-skipMacroValidation \ | |
MARKETING_VERSION="${MARKETING_VERSION}" \ | |
CURRENT_PROJECT_VERSION="${BUILD_NUMBER}" \ | |
archive \ | |
-archivePath ./archive \ | |
CODE_SIGNING_REQUIRED=NO \ | |
AD_HOC_CODE_SIGNING_ALLOWED=YES \ | |
CODE_SIGNING_ALLOWED=NO \ | |
SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY=${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }} \ | |
DEVELOPMENT_TEAM=S32Z3HMYVQ \ | |
ORG_IDENTIFIER=org.provenance-emu \ | |
| xcbeautify | |
end_time=$(date +%s) | |
echo "duration=$((end_time - start_time))" >> $GITHUB_OUTPUT | |
- name: Fakesign app | |
run: | | |
echo "Checking entitlements file..." | |
ls -la "Provenance/" | |
echo "Checking app binary..." | |
ls -la "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/" | |
ldid -S"Provenance/Provenance-AppStore.entitlements" "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }}" || echo "::warning::Fakesign failed but continuing build" | |
- name: Convert to IPA | |
run: | | |
mkdir Payload | |
ls -la "archive.xcarchive/Products/Applications" | |
cp -pR "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app" "Payload/${{ matrix.IPA_NAME }}.app" | |
zip -r "${{ matrix.IPA_NAME }}.ipa" Payload | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3.1.0 | |
with: | |
name: "${{ matrix.IPA_NAME }}-v${{ env.MARKETING_VERSION }}(${{ env.BUILD_NUMBER }}).ipa" | |
path: "${{ matrix.IPA_NAME }}.ipa" | |
if-no-files-found: error | |
retention-days: 90 | |
- name: Record Build Time | |
run: | | |
duration=${{ steps.build.outputs.duration }} | |
minutes=$((duration / 60)) | |
seconds=$((duration % 60)) | |
echo "Build took ${minutes}m ${seconds}s" | |
echo "### Build Time ⏱️" >> $GITHUB_STEP_SUMMARY | |
echo "- Duration: ${minutes}m ${seconds}s" >> $GITHUB_STEP_SUMMARY | |
- name: Build Summary | |
run: | | |
echo "### Build Complete! :rocket:" >> $GITHUB_STEP_SUMMARY | |
echo "- Version: ${{ env.MARKETING_VERSION }} (${{ env.BUILD_NUMBER }})" >> $GITHUB_STEP_SUMMARY | |
echo "- Target: ${{ matrix.target }}" >> $GITHUB_STEP_SUMMARY | |
echo "- Scheme: ${{ matrix.scheme }}" >> $GITHUB_STEP_SUMMARY | |
- name: Update Build Status | |
if: always() | |
run: | | |
if [ "${{ job.status }}" = "success" ]; then | |
echo "✅ Build succeeded for ${{ matrix.target }}" | |
else | |
echo "❌ Build failed for ${{ matrix.target }}" | |
exit 1 | |
fi | |
- name: Notify Discord Build Status | |
if: always() | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
run: | | |
if [ "${{ job.status }}" = "success" ]; then | |
STATUS_COLOR="65280" | |
STATUS="✅ Success" | |
else | |
STATUS_COLOR="16711680" | |
STATUS="❌ Failed" | |
fi | |
curl -H "Content-Type: application/json" -X POST $DISCORD_WEBHOOK \ | |
-d '{ | |
"embeds": [{ | |
"title": "Build ${{ matrix.target }}", | |
"description": "Version ${{ env.MARKETING_VERSION }} (Build ${{ env.BUILD_NUMBER }})\nScheme: ${{ matrix.scheme }}\nBuild Duration: ${{ steps.build.outputs.duration }}s", | |
"color": '"$STATUS_COLOR"', | |
"footer": { | |
"text": "'"$STATUS"'" | |
} | |
}] | |
}' | |
- name: Cleanup | |
if: always() | |
run: | | |
rm -rf .git | |
rm -rf .build |