Skip to content

Commit

Permalink
ci: improve iOS builds
Browse files Browse the repository at this point in the history
Update release.yml

ci: improve iOS builds

Update release.yml
  • Loading branch information
jnelle committed Jun 22, 2024
1 parent 0efc2fe commit 073db0b
Showing 1 changed file with 48 additions and 13 deletions.
61 changes: 48 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,53 @@ jobs:
run: |
/usr/libexec/Plistbuddy -c "Set CFBundleVersion ${{ steps.semver.outputs.next }}" "iosApp/iosApp/Info.plist"
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString ${{ steps.semver.outputs.next }}" "iosApp/iosApp/Info.plist"
- name: iOS Build App
uses: yukiarrr/[email protected]
with:
project-path: iosApp/iosApp.xcodeproj
p12-base64: ${{ secrets.P12_BASE64_KEY }}
code-signing-identity: "iPhone Distribution"
team-id: ${{ secrets.IOS_TEAM_ID }}
certificate-password: ${{ secrets.P12_KEY_PASSWORD }}
workspace-path: Untitled.xcworkspace
export-method: "app-store"
mobileprovision-base64: ${{ secrets.MOBILE_PROVISIONING_B64 }}
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.P12_BASE64_KEY }}
P12_PASSWORD: ${{ secrets.P12_KEY_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.MOBILE_PROVISIONING_B64 }}
KEYCHAIN_PASSWORD: ${{ secrets.P12_KEY_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: build archive
run: |
xcodebuild -scheme "iosApp" \
-workspace Untitled.xcworkspace \
-allowProvisioningUpdates \
-archivePath $RUNNER_TEMP/iosApp.xcarchive \
-sdk iphoneos \
-configuration Release \
-destination generic/platform=iOS \
clean archive
- name: export ipa
env:
EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}
run: |
EXPORT_OPTS_PATH=iosApp/exportOptionsRelease.plist
xcodebuild -exportArchive -archivePath $RUNNER_TEMP/iamgroot.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath build/
- name: Create Release
uses: ncipollo/[email protected]
Expand All @@ -79,8 +115,7 @@ jobs:
name: ${{ steps.semver.outputs.next }}
body: Changelog Contents
token: ${{ github.token }}
artifacts: "composeApp/build/outputs/apk/release/composeApp-release.apk,output.ipa"
artifacts: "composeApp/build/outputs/apk/release/composeApp-release.apk,build/MGPlayer.ipa"
generateReleaseNotes: true
tag: ${{ steps.semver.outputs.next }}
export-options: iosApp/exportOptionsRelease.plist

0 comments on commit 073db0b

Please sign in to comment.