mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 14:14:55 +00:00
ci(ios): testflight build workflow
- use patched xcode project file, avoid conflict with local dev env - use fastlane match to manage codesigning
This commit is contained in:
10
.github/workflows/build-ios-release.yml
vendored
10
.github/workflows/build-ios-release.yml
vendored
@@ -35,6 +35,14 @@ jobs:
|
||||
distribution: 'zulu'
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Cache clojure deps
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.m2/repository
|
||||
~/.gitlibs
|
||||
key: ${{ runner.os }}-clojure-lib-${{ hashFiles('**/deps.edn') }}
|
||||
|
||||
- name: Setup clojure
|
||||
uses: DeLaGuardo/setup-clojure@3.5
|
||||
with:
|
||||
@@ -65,3 +73,5 @@ jobs:
|
||||
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
|
||||
APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: true
|
||||
SLACK_URL: ${{ secrets.SLACK_URL }}
|
||||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
||||
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
|
||||
|
||||
@@ -18,20 +18,29 @@ default_platform(:ios)
|
||||
platform :ios do
|
||||
desc "Push a new beta build to TestFlight"
|
||||
lane :beta do
|
||||
# Set from env
|
||||
app_store_connect_api_key
|
||||
setup_ci
|
||||
|
||||
increment_build_number(
|
||||
app_store_connect_api_key(
|
||||
key_id: ENV["APP_STORE_CONNECT_API_KEY_KEY_ID"],
|
||||
issuer_id: ENV["APP_STORE_CONNECT_API_KEY_ISSUER_ID"],
|
||||
key_filepath: ENV["APP_STORE_CONNECT_API_KEY_KEY_FILEPATH"],
|
||||
)
|
||||
|
||||
sync_code_signing(type: "appstore", readonly: true)
|
||||
|
||||
build_number = increment_build_number(
|
||||
xcodeproj: "App.xcodeproj",
|
||||
build_number: latest_testflight_build_number + 1,
|
||||
skip_info_plist: true
|
||||
)
|
||||
|
||||
# Ref: https://docs.fastlane.tools/advanced/fastlane/#directory-behavior
|
||||
sh("../../../scripts/patch-xcode-project.sh")
|
||||
|
||||
build_app(
|
||||
workspace: "App.xcworkspace",
|
||||
configuration: "Release",
|
||||
destination: "generic/platform=iOS",
|
||||
scheme: "Logseq"
|
||||
scheme: "Logseq",
|
||||
configuration: "Release",
|
||||
)
|
||||
|
||||
upload_to_testflight(
|
||||
@@ -39,6 +48,6 @@ platform :ios do
|
||||
skip_waiting_for_build_processing: true,
|
||||
)
|
||||
|
||||
slack(message: "App successfully uploaded to TestFlight 🎉!")
|
||||
slack(message: "App Build (#{build_number}) successfully uploaded to TestFlight 🎉!")
|
||||
end
|
||||
end
|
||||
|
||||
13
ios/App/fastlane/Matchfile
Normal file
13
ios/App/fastlane/Matchfile
Normal file
@@ -0,0 +1,13 @@
|
||||
git_url("https://github.com/logseq/certificates.git")
|
||||
|
||||
storage_mode("git")
|
||||
|
||||
type("appstore") # The default type, can be: appstore, adhoc, enterprise or development
|
||||
|
||||
app_identifier(["com.logseq.logseq", "com.logseq.logseq.ShareViewController"])
|
||||
# username("user@fastlane.tools") # Your Apple Developer Portal username
|
||||
|
||||
# For all available options run `fastlane match --help`
|
||||
# Remove the # in the beginning of the line to enable the other options
|
||||
|
||||
# The docs are available on https://docs.fastlane.tools/actions/match
|
||||
47
scripts/patch-xcode-project.sh
Executable file
47
scripts/patch-xcode-project.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script patches the iOS project to use the correct codesigning and provisioning profiles.
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
cd ${SCRIPT_DIR}/../ios/App
|
||||
|
||||
ls -lah App.xcodeproj/project.pbxproj
|
||||
|
||||
FILE="App.xcodeproj/project.pbxproj"
|
||||
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC2FC1FED79650016851F:attributes:TargetAttributes:504EC3031FED79650016851F:ProvisioningStyle Manual' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC2FC1FED79650016851F:attributes:TargetAttributes:5FFF7D6927E343FA00B00DA8:ProvisioningStyle Manual' $FILE
|
||||
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC3171FED79650016851F:buildSettings:CODE_SIGN_STYLE Manual' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3171FED79650016851F:buildSettings:"CODE_SIGN_IDENTITY[sdk=iphoneos*]" String "iPhone Distribution"' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC3171FED79650016851F:buildSettings:DEVELOPMENT_TEAM ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3171FED79650016851F:buildSettings:"DEVELOPMENT_TEAM[sdk=iphoneos*]" String K378MFWK59' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3171FED79650016851F:buildSettings:PROVISIONING_PROFILE_SPECIFIER String ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3171FED79650016851F:buildSettings:"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" String "match AppStore com.logseq.logseq"' $FILE
|
||||
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC3181FED79650016851F:buildSettings:CODE_SIGN_STYLE Manual' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3181FED79650016851F:buildSettings:"CODE_SIGN_IDENTITY[sdk=iphoneos*]" String "iPhone Distribution"' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:504EC3181FED79650016851F:buildSettings:DEVELOPMENT_TEAM ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3181FED79650016851F:buildSettings:"DEVELOPMENT_TEAM[sdk=iphoneos*]" String K378MFWK59' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3181FED79650016851F:buildSettings:PROVISIONING_PROFILE_SPECIFIER String ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:504EC3181FED79650016851F:buildSettings:"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" String "match AppStore com.logseq.logseq"' $FILE
|
||||
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:5FFF7D7627E343FA00B00DA8:buildSettings:CODE_SIGN_STYLE Manual' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7627E343FA00B00DA8:buildSettings:"CODE_SIGN_IDENTITY[sdk=iphoneos*]" String "iPhone Distribution"' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:5FFF7D7627E343FA00B00DA8:buildSettings:DEVELOPMENT_TEAM ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7627E343FA00B00DA8:buildSettings:"DEVELOPMENT_TEAM[sdk=iphoneos*]" String K378MFWK59' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7627E343FA00B00DA8:buildSettings:PROVISIONING_PROFILE_SPECIFIER String ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7627E343FA00B00DA8:buildSettings:"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" String "match AppStore com.logseq.logseq.ShareViewController"' $FILE
|
||||
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:5FFF7D7727E343FA00B00DA8:buildSettings:CODE_SIGN_STYLE Manual' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7727E343FA00B00DA8:buildSettings:"CODE_SIGN_IDENTITY[sdk=iphoneos*]" String "iPhone Distribution"' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Set :objects:5FFF7D7727E343FA00B00DA8:buildSettings:DEVELOPMENT_TEAM ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7727E343FA00B00DA8:buildSettings:"DEVELOPMENT_TEAM[sdk=iphoneos*]" String K378MFWK59' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7727E343FA00B00DA8:buildSettings:PROVISIONING_PROFILE_SPECIFIER String ""' $FILE
|
||||
/usr/libexec/PlistBuddy -c 'Add :objects:5FFF7D7727E343FA00B00DA8:buildSettings:"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" String "match AppStore com.logseq.logseq.ShareViewController"' $FILE
|
||||
|
||||
echo Patch OK!
|
||||
Reference in New Issue
Block a user