From 198a5b63bf49a6788eb45be9cc664ecce64f5b3b Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 17 Dec 2024 02:59:14 -0500 Subject: [PATCH] Enable xcode build in fastlane beta --- .github/workflows/publish-beta.yml | 47 +++++++++++++++++++++++------- Gemfile | 1 + fastlane/Appfile | 2 +- fastlane/Fastfile | 34 ++++++++++++++++++--- 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index e9b4d8531..185bb9924 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -2,6 +2,20 @@ name: Publish Beta on: workflow_dispatch: + inputs: + upload: + description: Upload the build to TestFlight + type: boolean + default: false + required: true + changelog: + description: Changelog for TestFlight + type: string + notify_testers: + description: Notify TestFlight testers + type: boolean + default: true + required: true jobs: publish: @@ -12,6 +26,20 @@ jobs: - name: Check out Git repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Node.js + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 20 + check-latest: true + cache: npm + + - name: Install Node.js dependencies + run: npm ci --no-audit + + - name: Install Pods + run: | + cd ios && pod install + - name: Setup signing environment env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} @@ -43,18 +71,17 @@ jobs: sudo mkdir -p /Library/MobileDevice/Provisioning\ Profiles cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles sudo cp $PP_PATH /Library/MobileDevice/Provisioning\ Profiles - + + - name: Decode signing profile secrets + run: | + echo "FL_CODE_SIGN_IDENTITY=$(echo ${{ secrets.CODE_SIGN_64 }} | base64 --decode)" >> $GITHUB_ENV + echo "FL_PROVISIONING_PROFILE_SPECIFIER=$(echo ${{ secrets.PROFILE_NAME_64_EXPO }} | base64 --decode)" >> $GITHUB_ENV + - name: Build and publish beta env: APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_KEY_ID_EXPO }} APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_ISSUER_ID }} APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_KEY_CONTENTS_EXPO }} - APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: true - APP_STORE_CONNECT_API_KEY_DURATION: 1200 - APP_STORE_CONNECT_API_KEY_IN_HOUSE: false - run: fastlane beta \ - keyID:"${{ secrets.APP_STORE_KEY_ID_EXPO }}" \ - issuerID:"${{ secrets.APP_STORE_ISSUER_ID }}" \ - keyContents:"${{ secrets.APP_STORE_KEY_CONTENTS_EXPO }}" \ - codeSign64:"${{ secrets.CODE_SIGN_64 }}" \ - profileName64:"${{ secrets.PROFILE_NAME_64_EXPO }}" + PILOT_CHANGELOG: ${{ github.event.inputs.changelog }} + PILOT_NOTIFY_EXTERNAL_TESTERS: ${{ github.event.inputs.notify_testers }} + run: fastlane beta upload:${{ github.event.inputs.upload }} diff --git a/Gemfile b/Gemfile index 7a118b49b..82d1e3049 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ source "https://rubygems.org" gem "fastlane" +gem "cocoapods" diff --git a/fastlane/Appfile b/fastlane/Appfile index 303b3e84f..37312bd46 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,4 +1,4 @@ -app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app +app_identifier("org.jellyfin.expo") # The bundle identifier of your app # apple_id("[[APPLE_ID]]") # Your Apple Developer Portal username diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 831b4c574..1e18218ad 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -20,11 +20,37 @@ end platform :ios do desc "Publish beta to TestFlight" lane :beta do |options| + ensure_env_vars( + env_vars: [ + "APP_STORE_CONNECT_API_KEY_KEY_ID", + "APP_STORE_CONNECT_API_KEY_ISSUER_ID", + "APP_STORE_CONNECT_API_KEY_KEY", + "FL_CODE_SIGN_IDENTITY", + "FL_PROVISIONING_PROFILE_SPECIFIER" + ] + ) + xcodes(version: "15.4") - # FIXME: Build and publish the app - # build_app(scheme: "Jellyfin", - # workspace: "ios/Jellyfin.xcworkspace", - # configuration: "Release") + app_store_connect_api_key( + is_key_content_base64: true, + duration: 1200, + in_house: false + ) + + update_code_signing_settings( + path: "ios/Jellyfin.xcodeproj", + use_automatic_signing: false + ) + + build_app( + scheme: "Jellyfin", + workspace: "ios/Jellyfin.xcworkspace", + configuration: "Release" + ) + + if options[:upload] + upload_to_testflight() + end end end