From b675f612cf6be212fb7190a799c5486beff71aaa Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Fri, 27 Dec 2024 15:37:46 -0500 Subject: [PATCH 01/13] github CI/CD scripts update Signed-off-by: Joseph Mattiello --- .github/workflows/attach_build_products.yml | 39 +++- .github/workflows/build.yml | 232 +++++++++++--------- 2 files changed, 161 insertions(+), 110 deletions(-) diff --git a/.github/workflows/attach_build_products.yml b/.github/workflows/attach_build_products.yml index 40e1a969b8..03101f6281 100644 --- a/.github/workflows/attach_build_products.yml +++ b/.github/workflows/attach_build_products.yml @@ -10,6 +10,18 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: + - name: Download workflow artifact data + uses: actions/github-script@v6 + id: artifacts + with: + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + return artifacts.data; + - name: add artifact links to pull request and related issues step uses: tonyhallett/artifacts-url-comments@v1.1.0 env: @@ -19,4 +31,29 @@ jobs: suffix: Have a nice day. format: name addTo: pull - # addTo: pullandissues \ No newline at end of file + + - name: Notify Discord with Download Links + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + run: | + ARTIFACTS_JSON='${{ steps.artifacts.outputs.result }}' + + # Create download links list + DOWNLOAD_LINKS="" + while IFS= read -r artifact; do + name=$(echo $artifact | jq -r '.name') + url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/${{ github.event.workflow_run.id }}/artifacts/$(echo $artifact | jq -r '.id')" + DOWNLOAD_LINKS+="• [${name}](${url})\n" + done < <(echo "$ARTIFACTS_JSON" | jq -c '.artifacts[]') + + curl -H "Content-Type: application/json" -X POST $DISCORD_WEBHOOK \ + -d '{ + "embeds": [{ + "title": "🎮 New Provenance Builds Available", + "description": "New builds are ready for download:\n'"${DOWNLOAD_LINKS}"'", + "color": 5814783, + "footer": { + "text": "Pull Request #${{ github.event.workflow_run.pull_requests[0].number }}" + } + }] + }' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6998c270f5..12dffffef0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ 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: @@ -24,109 +26,94 @@ jobs: strategy: fail-fast: false matrix: - target: - - Provenance-Release - - ProvenanceTV-Release - - "Provenance-XL Release" - - "Provenance-Lite Release" - - Provenance-UnderDevelopment include: - - target: Provenance-Release + - target: "Provenance-Lite-iOS" sdk: iphoneos - scheme: Provenance-Release - APP_NAME: Provenance - IPA_NAME: Provenance - - target: ProvenanceTV-Release - sdk: appletvos - scheme: ProvenanceTV-Release - APP_NAME: Provenance - IPA_NAME: ProvenanceTV - - target: Provenance-Release + scheme: "Provenance-Lite (AppStore) (Release)" + APP_NAME: "Provenance-Lite" + IPA_NAME: "Provenance-Lite-iOS" + + - target: "Provenance-Lite-tvOS" sdk: appletvos - scheme: Provenance-Release - APP_NAME: Provenance - IPA_NAME: Provenance-tvOS - - target: "Provenance-XL Release" - sdk: iphoneos - scheme: "Provenance-XL Release" - APP_NAME: Provenance-XL - IPA_NAME: Provenance-XL - - target: "Provenance-Lite Release" - sdk: iphoneos - scheme: "Provenance-Lite Release" - APP_NAME: Provenance-Lite - IPA_NAME: Provenance-Lite - - target: Provenance-UnderDevelopment + scheme: "Provenance-Lite (AppStore) (Release)" + APP_NAME: "Provenance-Lite" + IPA_NAME: "Provenance-Lite-tvOS" + + - target: "Provenance-iOS" sdk: iphoneos - scheme: Provenance-UnderDevelopment - APP_NAME: Provenance-UnderDevelopment - IPA_NAME: Provenance-UnderDevelopment - # - target: macOS - # sdk: macosx - # scheme: Provenance + 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" + + - target: "Provenance-Catalyst" + sdk: macosx + scheme: "Provenance (AppStore) (Release)" + APP_NAME: "Provenance" + IPA_NAME: "Provenance-Catalyst" + CATALYST_FLAG: "-destination 'platform=macOS,variant=Mac Catalyst'" runs-on: 'macos-latest' timeout-minutes: 300 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - - # - name: Install Xcode - # uses: maxim-lobanov/setup-xcode@v1 - # with: - # xcode-version: ${{ matrix.version }} + fetch-depth: 0 - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: '16.0' - # xcode-select-path: /Applications/Xcode_${{ matrix.version }}.app/Contents/Developer + 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=$(cat Provenance/Provenance-Info.plist | grep -A1 CFBundleShortVersionString | tail -n1 | sed -E 's/.*>([0-9.]+)<.*/\1/')" >> $GITHUB_ENV - uses: actions/cache@v3 with: - path: .build - key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + 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 - - - name: Cache DerivedData - uses: irgaly/xcode-cache@v1 - with: - key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} - restore-keys: xcode-cache-deriveddata-${{ github.workflow }}- - - - name: Install Swift Package Cache run: | - mkdir -p ${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }} - chmod -R u+w ${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }} + brew install ldid + brew install xcbeautify - - name: Activate IDESkipMacroFingerprintValidation + - name: Clean Build Directory run: | - defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES - - # - name: Import Codesign Certificates - # uses: apple-actions/import-codesign-certs@v1 - # with: - # p12-file-base64: ${{ secrets.CERT_P12 }} - # p12-password: ${{ secrets.P12_PASS }} - - #- name: Import Codesign Certificates - # uses: apple-actions/import-codesign-certs@v2 - # with: - # p12-file-base64: ${{ secrets.CERT_P12 }} - # p12-password: ${{ secrets.P12_PASS }} + 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 }} \ + ${{ matrix.CATALYST_FLAG }} \ -skipPackagePluginValidation \ -skipMacroValidation \ + MARKETING_VERSION=${MARKETING_VERSION} \ + CURRENT_PROJECT_VERSION=${BUILD_NUMBER} \ archive \ -archivePath ./archive \ CODE_SIGNING_REQUIRED=NO \ @@ -135,56 +122,83 @@ jobs: SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY=${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }} \ DEVELOPMENT_TEAM=S32Z3HMYVQ \ ORG_IDENTIFIER=org.provenance-emu \ - | xcpretty && exit ${PIPESTATUS[0]} - - # - name: Build Provenance - # run: | - # rm -rf ~/Library/Developer/Xcode/DerivedData/ - # rm ./Provenance.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved - # rm ./Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved - # xcodebuild -workspace Provenance.xcworkspace -scheme Provenance-Release -sdk iphoneos archive -archivePath ./archive CODE_SIGNING_REQUIRED=NO AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGNING_ALLOWED=NO DEVELOPMENT_TEAM=XYZ0123456 ORG_IDENTIFIER=org.provenance-emu | xcpretty && exit ${PIPESTATUS[0]} + | xcbeautify + end_time=$(date +%s) + echo "duration=$((end_time - start_time))" >> $GITHUB_OUTPUT - name: Fakesign app + if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | - #rm -rf archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/Frameworks/*.framework/Frameworks/ ldid -SProvenance/Provenance.entitlements archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }} - name: Convert to IPA + if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | mkdir Payload cp -pR "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app" "Payload/${{ matrix.IPA_NAME }}.app" zip -r "${{ matrix.IPA_NAME }}.ipa" Payload - # - name: Codesign IPA - # uses: mmaetzler/ios-resign-action@d3c2e4cb930bc7edf89894af7af622d3c0d5b571 - # with: - # ipa_path: "${{ matrix.IPA_NAME }}.ipa" - # mobileprovision: ${{ secrets.MOBILEPROVISION }} - # cert_p12: ${{ secrets.CERT_P12 }} - # p12_pass: ${{ secrets.P12_PASS }} - # signing_identity: ${{ secrets.SIGNING_IDENTITY }} + - name: Package Mac Catalyst App + if: ${{ matrix.target == 'Provenance-Catalyst' }} + run: | + cd archive.xcarchive/Products/Applications/ + zip -r "${{ github.workspace }}/${{ matrix.IPA_NAME }}.zip" *.app - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 with: - name: "${{ matrix.IPA_NAME }}.ipa" - path: "${{ matrix.IPA_NAME }}.ipa" - - # - name: Upload IPA to S3 - # if: ${{ github.branch == 'develop' }} - # uses: ebuckthal/s3-upload-artifact@v7 - # with: - # bucket: 'sh-sysops' - # key: ${AWS_SECRET_ACCESS_KEY} - # path: 'Provenance.ipa' - - # - name: Upload IPA to App Center - # uses: wzieba/AppCenter-Github-Action@v1 - # if: ${{ github.branch == 'develop' }} - # with: - # appName: wzieba/Sample-App - # token: ${{secrets.APP_CENTER_TOKEN}} - # group: Testers - # file: Provenance.ipa - # notifyTesters: true - # debug: false + name: "${{ matrix.IPA_NAME }}-v${{ env.MARKETING_VERSION }}(${{ env.BUILD_NUMBER }})${{ matrix.target == 'Provenance-Catalyst' && '.zip' || '.ipa' }}" + path: "${{ matrix.IPA_NAME }}${{ matrix.target == 'Provenance-Catalyst' && '.zip' || '.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"'" + } + }] + }' From 8311609ac09a68a9f9ece3b3d99750152a3382e7 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 16:11:21 -0500 Subject: [PATCH 02/13] Update melonDS refs Signed-off-by: Joseph Mattiello --- .../melonDS/PVMelonDS.xcodeproj/project.pbxproj | 16 ++++++++-------- Cores/melonDS/melonds-libretro | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cores/melonDS/PVMelonDS.xcodeproj/project.pbxproj b/Cores/melonDS/PVMelonDS.xcodeproj/project.pbxproj index 9a0a2816d9..88604be96b 100644 --- a/Cores/melonDS/PVMelonDS.xcodeproj/project.pbxproj +++ b/Cores/melonDS/PVMelonDS.xcodeproj/project.pbxproj @@ -5545,7 +5545,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = NO; INFOPLIST_FILE = "${SRCROOT}/PVMelonDS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -5562,7 +5562,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 15.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; }; @@ -5706,7 +5706,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = NO; INFOPLIST_FILE = "${SRCROOT}/PVMelonDS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -5724,7 +5724,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 16.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; }; @@ -5822,7 +5822,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = NO; INFOPLIST_FILE = "${SRCROOT}/PVMelonDS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -5839,7 +5839,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 15.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; @@ -5859,7 +5859,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = NO; INFOPLIST_FILE = "${SRCROOT}/PVMelonDS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -5877,7 +5877,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 16.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; diff --git a/Cores/melonDS/melonds-libretro b/Cores/melonDS/melonds-libretro index 597067cde7..a3c57f0668 160000 --- a/Cores/melonDS/melonds-libretro +++ b/Cores/melonDS/melonds-libretro @@ -1 +1 @@ -Subproject commit 597067cde77ae5a0a214e57e4997da0e271220ce +Subproject commit a3c57f066870c18d3104895f52a1fe08794e2cdc From 46ccc0b1de05ba2819b23e6e53c216ecea51ba79 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 17:18:25 -0500 Subject: [PATCH 03/13] change melonds submodule ref Signed-off-by: Joseph Mattiello --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index cb86f2fa6f..87a0b40e57 100644 --- a/.gitmodules +++ b/.gitmodules @@ -162,7 +162,7 @@ url = https://github.com/libretro/beetle-supergrafx-libretro.git [submodule "Cores/melonDS/melonds-libretro"] path = Cores/melonDS/melonds-libretro - url = https://github.com/libretro/melonDS.git + url = https://github.com/JesseTG/melonds-ds.git [submodule "Cores/PPSSPP/libretro_ppsspp"] path = Cores/PPSSPP/libretro_ppsspp url = https://github.com/hrydgard/ppsspp.git From 7d14a5f687d2d29936067b264117d1d331b49ac1 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 18:45:39 -0500 Subject: [PATCH 04/13] fix appsign step Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12dffffef0..3205120846 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,7 @@ jobs: - name: Fakesign app if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | - ldid -SProvenance/Provenance.entitlements archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }} + ldid -S"Provenance/Provenance-AppStore.entitlements" "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }}" - name: Convert to IPA if: ${{ matrix.target != 'Provenance-Catalyst' }} From e00a574161f593192e39704b039d03be47c589fc Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 19:12:43 -0500 Subject: [PATCH 05/13] build.yml debug fakesign step Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3205120846..f6e5b1b61c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,11 @@ jobs: - name: Fakesign app if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | - ldid -S"Provenance/Provenance-AppStore.entitlements" "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }}" + 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 if: ${{ matrix.target != 'Provenance-Catalyst' }} From 26da5d327acceca8a74196c69295613f174ed39a Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 19:29:06 -0500 Subject: [PATCH 06/13] fix marketing version step Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6e5b1b61c..2545237c4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,7 @@ jobs: run: | BUILD_NUMBER=$(git rev-list --count HEAD) echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV - echo "MARKETING_VERSION=$(cat Provenance/Provenance-Info.plist | grep -A1 CFBundleShortVersionString | tail -n1 | sed -E 's/.*>([0-9.]+)<.*/\1/')" >> $GITHUB_ENV + echo "MARKETING_VERSION=$(grep 'MARKETING_VERSION' Build.xcconfig | cut -d'=' -f2 | xargs)" >> $GITHUB_ENV - uses: actions/cache@v3 with: @@ -112,8 +112,8 @@ jobs: ${{ matrix.CATALYST_FLAG }} \ -skipPackagePluginValidation \ -skipMacroValidation \ - MARKETING_VERSION=${MARKETING_VERSION} \ - CURRENT_PROJECT_VERSION=${BUILD_NUMBER} \ + MARKETING_VERSION="${MARKETING_VERSION}" \ + CURRENT_PROJECT_VERSION="${BUILD_NUMBER}" \ archive \ -archivePath ./archive \ CODE_SIGNING_REQUIRED=NO \ From 030c4c14c69d20094022918714a2b3bdb1329c64 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 20:21:27 -0500 Subject: [PATCH 07/13] PVLookup fix PVLogging dep Signed-off-by: Joseph Mattiello --- PVLookup/Package.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PVLookup/Package.swift b/PVLookup/Package.swift index 8a06070afc..fe2712a82f 100644 --- a/PVLookup/Package.swift +++ b/PVLookup/Package.swift @@ -81,6 +81,7 @@ let package = Package( .target( name: "PVSQLiteDatabase", dependencies: [ + "PVLogging", .product(name: "SQLite", package: "sqlite.swift"), .product(name: "ZIPFoundation", package: "ZIPFoundation") ] @@ -93,6 +94,7 @@ let package = Package( .target( name: "TheGamesDB", dependencies: [ + "PVLogging", "PVSQLiteDatabase", .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), // .product(name: "OpenAPIAsyncHTTPClient", package: "swift-openapi-async-http-client"), @@ -113,6 +115,7 @@ let package = Package( .target( name: "libretrodb", dependencies: [ + "PVLogging", "PVSQLiteDatabase", "PVLookupTypes", "PVPrimitives", @@ -134,6 +137,7 @@ let package = Package( .target( name: "OpenVGDB", dependencies: [ + "PVLogging", "PVSQLiteDatabase", "Lighter", "PVLookupTypes", @@ -157,6 +161,7 @@ let package = Package( .target( name: "ShiraGame", dependencies: [ + "PVLogging", "ROMMetadataProvider", "PVSQLiteDatabase", "PVLookupTypes", @@ -177,7 +182,7 @@ let package = Package( .target( name: "ROMMetadataProvider", - dependencies: ["PVLookupTypes"] + dependencies: ["PVLookupTypes", "PVLogging"] ), @@ -186,6 +191,7 @@ let package = Package( .target( name: "PVLookupTypes", dependencies: [ + "PVLogging", "PVPrimitives", ] ), @@ -194,12 +200,12 @@ let package = Package( .testTarget( name: "PVLookupTests", - dependencies: ["PVLookup"] + dependencies: ["PVLookup", "PVLogging"] ), .testTarget( name: "TheGamesDBTests", - dependencies: ["TheGamesDB", "PVLookup"] + dependencies: ["TheGamesDB", "PVLookup", "PVLogging"] ), ], swiftLanguageModes: [.v5, .v6], From 86a6b03e4a95807c06c808f8bdcb634d69ad7d7b Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sat, 28 Dec 2024 22:36:00 -0500 Subject: [PATCH 08/13] github ci remove catalyst Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2545237c4e..94ff13f1d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,13 +51,6 @@ jobs: APP_NAME: "Provenance" IPA_NAME: "Provenance-tvOS" - - target: "Provenance-Catalyst" - sdk: macosx - scheme: "Provenance (AppStore) (Release)" - APP_NAME: "Provenance" - IPA_NAME: "Provenance-Catalyst" - CATALYST_FLAG: "-destination 'platform=macOS,variant=Mac Catalyst'" - runs-on: 'macos-latest' timeout-minutes: 300 steps: @@ -109,7 +102,6 @@ jobs: -workspace Provenance.xcworkspace \ -scheme "${{ matrix.scheme }}" \ -sdk ${{ matrix.sdk }} \ - ${{ matrix.CATALYST_FLAG }} \ -skipPackagePluginValidation \ -skipMacroValidation \ MARKETING_VERSION="${MARKETING_VERSION}" \ @@ -127,7 +119,6 @@ jobs: echo "duration=$((end_time - start_time))" >> $GITHUB_OUTPUT - name: Fakesign app - if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | echo "Checking entitlements file..." ls -la "Provenance/" @@ -136,23 +127,16 @@ jobs: 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 - if: ${{ matrix.target != 'Provenance-Catalyst' }} run: | mkdir Payload cp -pR "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app" "Payload/${{ matrix.IPA_NAME }}.app" zip -r "${{ matrix.IPA_NAME }}.ipa" Payload - - name: Package Mac Catalyst App - if: ${{ matrix.target == 'Provenance-Catalyst' }} - run: | - cd archive.xcarchive/Products/Applications/ - zip -r "${{ github.workspace }}/${{ matrix.IPA_NAME }}.zip" *.app - - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 with: - name: "${{ matrix.IPA_NAME }}-v${{ env.MARKETING_VERSION }}(${{ env.BUILD_NUMBER }})${{ matrix.target == 'Provenance-Catalyst' && '.zip' || '.ipa' }}" - path: "${{ matrix.IPA_NAME }}${{ matrix.target == 'Provenance-Catalyst' && '.zip' || '.ipa' }}" + 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 From 7e03425bebe54d4be75812f814d85562c6ee76dd Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Sun, 29 Dec 2024 14:28:40 -0500 Subject: [PATCH 09/13] fix tvOS pasteboard code Signed-off-by: Joseph Mattiello --- PVUI/Sources/PVSwiftUI/Consoles/BiosRowView.swift | 2 ++ .../SystemSettings/SystemsSettingsTableViewController.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PVUI/Sources/PVSwiftUI/Consoles/BiosRowView.swift b/PVUI/Sources/PVSwiftUI/Consoles/BiosRowView.swift index 6fd21baf1a..d2f15e4c19 100644 --- a/PVUI/Sources/PVSwiftUI/Consoles/BiosRowView.swift +++ b/PVUI/Sources/PVSwiftUI/Consoles/BiosRowView.swift @@ -57,8 +57,10 @@ struct BiosRowView: SwiftUI.View { /// Action to copy MD5 to clipboard private func copyMD5() { + #if !os(tvOS) UIPasteboard.general.string = bios.expectedMD5 showMD5Alert = true + #endif } /// Action to delete BIOS diff --git a/PVUI/Sources/PVUIBase/Settings/SystemSettings/SystemsSettingsTableViewController.swift b/PVUI/Sources/PVUIBase/Settings/SystemSettings/SystemsSettingsTableViewController.swift index fe4196eea7..3f47b8b287 100644 --- a/PVUI/Sources/PVUIBase/Settings/SystemSettings/SystemsSettingsTableViewController.swift +++ b/PVUI/Sources/PVUIBase/Settings/SystemSettings/SystemsSettingsTableViewController.swift @@ -108,7 +108,7 @@ public final class SystemsSettingsTableViewController: QuickTableViewController cell.backgroundView?.backgroundColor = backgroundColor }, action: { _ in -#if os(iOS) +#if !os(tvOS) UIPasteboard.general.string = bios.expectedMD5.uppercased() let alert = UIAlertController(title: nil, message: "MD5 copied to clipboard.", preferredStyle: .alert) self.present(alert, animated: true) From 2b64e42a9458200767ca66833e61c1cde52d011d Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:38:22 -0500 Subject: [PATCH 10/13] ls the archive after build Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94ff13f1d7..c69831e9f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,6 +129,7 @@ jobs: - 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 From 4ebb1a785b04dd33925c21987b54c17fca0590b5 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:39:37 -0500 Subject: [PATCH 11/13] =?UTF-8?q?cicd=20change=20Provence-Lite=20to=20?= =?UTF-8?q?=E2=80=9CProvenance=20Lite=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c69831e9f6..9245ec2205 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,13 +30,13 @@ jobs: - target: "Provenance-Lite-iOS" sdk: iphoneos scheme: "Provenance-Lite (AppStore) (Release)" - APP_NAME: "Provenance-Lite" + APP_NAME: "Provenance Lite" IPA_NAME: "Provenance-Lite-iOS" - target: "Provenance-Lite-tvOS" sdk: appletvos scheme: "Provenance-Lite (AppStore) (Release)" - APP_NAME: "Provenance-Lite" + APP_NAME: "Provenance Lite" IPA_NAME: "Provenance-Lite-tvOS" - target: "Provenance-iOS" From dfebbeea666456b5eeb2b671645fcad93c46c33c Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:44:17 -0500 Subject: [PATCH 12/13] cancle attach if already running Signed-off-by: Joseph Mattiello --- .github/workflows/attach_build_products.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/attach_build_products.yml b/.github/workflows/attach_build_products.yml index 03101f6281..4be924e01e 100644 --- a/.github/workflows/attach_build_products.yml +++ b/.github/workflows/attach_build_products.yml @@ -1,8 +1,14 @@ -name: Add artifact links to pull request and related issues +name: Attach Build Products + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + on: workflow_run: - workflows: [Build and Upload Provenance] - types: [completed] + workflows: ["Build and Upload Provenance"] + types: + - completed jobs: artifacts-url-comments: From 8acc799491dcc3d721ba77f25913083aaa2e6fce Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:50:10 -0500 Subject: [PATCH 13/13] ci/cd cache git, use v4 Signed-off-by: Joseph Mattiello --- .github/workflows/build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9245ec2205..d1433a625c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,8 +54,17 @@ jobs: 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 - uses: actions/checkout@v3 + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -191,3 +200,9 @@ jobs: } }] }' + + - name: Cleanup + if: always() + run: | + rm -rf .git + rm -rf .build