6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 3bed834e
Changed files
.github/workflows/build-ios-stage.yml | 32 ++-------------------- .../workflows/scripts/ios_install_signing_files.sh | 26 ++++++++++++++++++ .../workflows/scripts/ios_update_version_number.sh | 6 ++++ 3 files changed, 35 insertions(+), 29 deletions(-)
Diff
diff --git a/.github/workflows/build-ios-stage.yml b/.github/workflows/build-ios-stage.yml
index ac7cfc60..d358af04 100644
--- a/.github/workflows/build-ios-stage.yml
+++ b/.github/workflows/build-ios-stage.yml
@@ -2,7 +2,7 @@ name: "iOS Stage"
on:
push:
- branches: [ "staging" ]
+ branches: [ "devops/github-actions" ]
jobs:
build:
@@ -33,28 +33,7 @@ jobs:
P12_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
PROVISIONING_PROFILE: ${{ secrets.PROV_PROFILE_STAGE }}
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 "$CERTIFICATE_P12" | base64 --decode -o $CERTIFICATE_PATH
- echo -n "$PROVISIONING_PROFILE" | base64 --decode -o $PP_PATH
-
- # create temporary keychain
- security create-keychain -p "$P12_PASSWORD" $KEYCHAIN_PATH
- security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
- security unlock-keychain -p "$P12_PASSWORD" $KEYCHAIN_PATH
-
- # import certificate to keychain
- security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
- security set-key-partition-list -S apple-tool:,apple: -k "$P12_PASSWORD" $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
+ sh scripts/ios_install_signing_files.sh $CERTIFICATE_P12 $P12_PASSWORD $PROVISIONING_PROFILE
- name: Download dotenv
env:
@@ -66,12 +45,7 @@ jobs:
- name: Update build number
run: |
- cd comwell_key_app
- git=$(sh /etc/profile; which git)
- bundleVersion=$("$git" log --pretty=oneline HEAD^@ |wc -l)
- offsetBuildNumber=$((bundleVersion+4520))
- /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $offsetBuildNumber" "ios/Runner/Info.plist"
- echo "Updated build number in ios/Runner/Info.plist to $offsetBuildNumber"
+ sh scripts/ios_update_version_number.sh
- name: Enabled SPM
run: flutter config --enable-swift-package-manager
diff --git a/.github/workflows/scripts/ios_install_signing_files.sh b/.github/workflows/scripts/ios_install_signing_files.sh
new file mode 100644
index 00000000..d062735d
--- /dev/null
+++ b/.github/workflows/scripts/ios_install_signing_files.sh
@@ -0,0 +1,26 @@
+CERTIFICATE_P12=$1
+P12_PASSWORD=$2
+PROVISIONING_PROFILE=$3
+
+# 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 "$CERTIFICATE_P12" | base64 --decode -o $CERTIFICATE_PATH
+echo -n "$PROVISIONING_PROFILE" | base64 --decode -o $PP_PATH
+
+# create temporary keychain
+security create-keychain -p "$P12_PASSWORD" $KEYCHAIN_PATH
+security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
+security unlock-keychain -p "$P12_PASSWORD" $KEYCHAIN_PATH
+
+# import certificate to keychain
+security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
+security set-key-partition-list -S apple-tool:,apple: -k "$P12_PASSWORD" $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
\ No newline at end of file
diff --git a/.github/workflows/scripts/ios_update_version_number.sh b/.github/workflows/scripts/ios_update_version_number.sh
new file mode 100644
index 00000000..6cba5049
--- /dev/null
+++ b/.github/workflows/scripts/ios_update_version_number.sh
@@ -0,0 +1,6 @@
+cd comwell_key_app
+git=$(sh /etc/profile; which git)
+bundleVersion=$("$git" log --pretty=oneline HEAD^@ |wc -l)
+offsetBuildNumber=$((bundleVersion+4520))
+/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $offsetBuildNumber" "ios/Runner/Info.plist"
+echo "Updated build number in ios/Runner/Info.plist to $offsetBuildNumber"
\ No newline at end of file