feat: migrate iOS release to fastlane for simplified code signing
Some checks failed
CI / Scraper / Test (pull_request) Successful in 9s
CI / Scraper / Lint (pull_request) Successful in 12s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Build (pull_request) Successful in 26s
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Test (pull_request) Has been cancelled
iOS CI / Build (pull_request) Has been cancelled
iOS Release / Release to TestFlight (push) Failing after 3m58s
Some checks failed
CI / Scraper / Test (pull_request) Successful in 9s
CI / Scraper / Lint (pull_request) Successful in 12s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Build (pull_request) Successful in 26s
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Test (pull_request) Has been cancelled
iOS CI / Build (pull_request) Has been cancelled
iOS Release / Release to TestFlight (push) Failing after 3m58s
This commit is contained in:
@@ -28,11 +28,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install just
|
- name: Set up Ruby
|
||||||
run: command -v just || brew install just
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
- name: Set build number from run number
|
ruby-version: '3.2'
|
||||||
run: just ios-set-build-number ${{ gitea.run_number }}
|
bundler-cache: true
|
||||||
|
working-directory: ios/LibNovel
|
||||||
|
|
||||||
- name: Import signing certificate
|
- name: Import signing certificate
|
||||||
env:
|
env:
|
||||||
@@ -45,20 +46,12 @@ jobs:
|
|||||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
echo "$CERTIFICATE_BASE64" | base64 --decode > $RUNNER_TEMP/cert.p12
|
echo "$CERTIFICATE_BASE64" | base64 --decode > $RUNNER_TEMP/cert.p12
|
||||||
echo "DEBUG: p12 file size: $(wc -c < $RUNNER_TEMP/cert.p12) bytes"
|
|
||||||
echo "DEBUG: p12 first bytes (hex): $(xxd $RUNNER_TEMP/cert.p12 | head -2)"
|
|
||||||
echo "DEBUG: import result:"
|
|
||||||
security import $RUNNER_TEMP/cert.p12 \
|
security import $RUNNER_TEMP/cert.p12 \
|
||||||
-P "$CERTIFICATE_PASSWORD" \
|
-P "$CERTIFICATE_PASSWORD" \
|
||||||
-A -t cert -f pkcs12 \
|
-A -t cert -f pkcs12 \
|
||||||
-k $KEYCHAIN_PATH && echo "import OK" || echo "import FAILED exit $?"
|
-k $KEYCHAIN_PATH
|
||||||
security list-keychain -d user -s $KEYCHAIN_PATH $(security list-keychains -d user | tr -d '"' | xargs)
|
security list-keychain -d user -s $KEYCHAIN_PATH $(security list-keychains -d user | tr -d '"' | xargs)
|
||||||
echo "DEBUG: keychain list:"
|
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
security list-keychains -d user
|
|
||||||
echo "DEBUG: all certs in keychain (not just codesigning):"
|
|
||||||
security find-certificate -a $KEYCHAIN_PATH 2>&1 | grep "labl\|subj" || echo "none"
|
|
||||||
echo "DEBUG: signing identities found:"
|
|
||||||
security find-identity -v -p codesigning
|
|
||||||
|
|
||||||
- name: Import provisioning profile
|
- name: Import provisioning profile
|
||||||
env:
|
env:
|
||||||
@@ -70,57 +63,15 @@ jobs:
|
|||||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
|
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
|
||||||
|
|
||||||
- name: Write App Store Connect API key
|
- name: Build and upload to TestFlight
|
||||||
env:
|
env:
|
||||||
ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }}
|
APPLE_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
||||||
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
APPLE_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
|
||||||
run: |
|
APPLE_KEY_CONTENT: ${{ secrets.ASC_PRIVATE_KEY }}
|
||||||
mkdir -p ~/private_keys
|
BUILD_NUMBER: ${{ gitea.run_number }}
|
||||||
echo "$ASC_PRIVATE_KEY" > ~/private_keys/AuthKey_$ASC_KEY_ID.p8
|
PROVISIONING_PROFILE_NAME: LibNovel Distribution
|
||||||
|
working-directory: ios/LibNovel
|
||||||
- name: Inject team ID into ExportOptions.plist
|
run: bundle exec fastlane beta
|
||||||
env:
|
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
||||||
run: |
|
|
||||||
/usr/libexec/PlistBuddy -c \
|
|
||||||
"Set :teamID $APPLE_TEAM_ID" \
|
|
||||||
ios/LibNovel/ExportOptions.plist
|
|
||||||
|
|
||||||
- name: Archive
|
|
||||||
env:
|
|
||||||
USER: runner
|
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
||||||
run: |
|
|
||||||
PROFILE_UUID=$(security cms -D -i $RUNNER_TEMP/profile.mobileprovision | plutil -extract UUID raw -)
|
|
||||||
PROFILE_NAME=$(security cms -D -i $RUNNER_TEMP/profile.mobileprovision | plutil -extract Name raw -)
|
|
||||||
PROFILE_BUNDLE=$(security cms -D -i $RUNNER_TEMP/profile.mobileprovision | plutil -extract Entitlements.application-identifier raw - 2>/dev/null || echo "n/a")
|
|
||||||
PROFILE_TEAM=$(security cms -D -i $RUNNER_TEMP/profile.mobileprovision | plutil -extract TeamIdentifier.0 raw -)
|
|
||||||
PROFILE_EXPIRY=$(security cms -D -i $RUNNER_TEMP/profile.mobileprovision | plutil -extract ExpirationDate raw -)
|
|
||||||
echo "DEBUG: PROFILE_UUID=$PROFILE_UUID"
|
|
||||||
echo "DEBUG: PROFILE_NAME=$PROFILE_NAME"
|
|
||||||
echo "DEBUG: PROFILE_BUNDLE=$PROFILE_BUNDLE"
|
|
||||||
echo "DEBUG: PROFILE_TEAM=$PROFILE_TEAM"
|
|
||||||
echo "DEBUG: PROFILE_EXPIRY=$PROFILE_EXPIRY"
|
|
||||||
echo "DEBUG: APPLE_TEAM_ID=$APPLE_TEAM_ID"
|
|
||||||
echo "DEBUG: profiles dir listing:"
|
|
||||||
ls ~/Library/MobileDevice/Provisioning\ Profiles/
|
|
||||||
just ios-archive "$APPLE_TEAM_ID" "$PROFILE_UUID"
|
|
||||||
|
|
||||||
- name: Export IPA
|
|
||||||
run: just ios-export
|
|
||||||
|
|
||||||
- name: Upload to TestFlight
|
|
||||||
env:
|
|
||||||
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
|
||||||
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
|
|
||||||
run: just ios-upload
|
|
||||||
|
|
||||||
- name: Upload IPA artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: LibNovel-${{ gitea.ref_name }}.ipa
|
|
||||||
path: ${{ env.RUNNER_TEMP }}/ipa/LibNovel.ipa
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- name: Cleanup keychain
|
- name: Cleanup keychain
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
10
ios/LibNovel/.gitignore
vendored
Normal file
10
ios/LibNovel/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Fastlane
|
||||||
|
fastlane/report.xml
|
||||||
|
fastlane/Preview.html
|
||||||
|
fastlane/screenshots/**/*.png
|
||||||
|
fastlane/test_output
|
||||||
|
fastlane/README.md
|
||||||
|
|
||||||
|
# Bundler
|
||||||
|
.bundle
|
||||||
|
vendor/bundle
|
||||||
3
ios/LibNovel/Gemfile
Normal file
3
ios/LibNovel/Gemfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
gem "fastlane"
|
||||||
32
ios/LibNovel/fastlane/Fastfile
Normal file
32
ios/LibNovel/fastlane/Fastfile
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
default_platform(:ios)
|
||||||
|
|
||||||
|
platform :ios do
|
||||||
|
desc "Build and upload to TestFlight"
|
||||||
|
lane :beta do
|
||||||
|
# Generate Xcode project from project.yml
|
||||||
|
sh("xcodegen generate --spec project.yml --project .")
|
||||||
|
|
||||||
|
# Set build number from CI run number (passed as env var)
|
||||||
|
increment_build_number(
|
||||||
|
build_number: ENV["BUILD_NUMBER"] || "1",
|
||||||
|
xcodeproj: "LibNovel.xcodeproj"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Build the app
|
||||||
|
build_app(
|
||||||
|
scheme: "LibNovel",
|
||||||
|
export_method: "app-store",
|
||||||
|
clean: true,
|
||||||
|
export_options: {
|
||||||
|
provisioningProfiles: {
|
||||||
|
"com.kalekber.LibNovel" => ENV["PROVISIONING_PROFILE_NAME"] || "LibNovel Distribution"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Upload to TestFlight
|
||||||
|
upload_to_testflight(
|
||||||
|
skip_waiting_for_build_processing: true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user