Skip to content

Commit

Permalink
ios build attempt #3
Browse files Browse the repository at this point in the history
  • Loading branch information
GniN committed Dec 10, 2023
1 parent 1d69862 commit d19ca5a
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,40 @@ jobs:
run: |
flutter pub get
- name: Prepare iOS provisioning
working-directory: ./.github/secrets
# - name: Prepare iOS provisioning
# working-directory: ./.github/secrets
# run: |
# security create-keychain -p "" build.keychain >/dev/null 2>&1
# security import WLANThermo_Distribution_Certificate.p12 -t agg -k ~/Library/Keychains/build.keychain -P "" -A >/dev/null 2>&1
# security list-keychains -s ~/Library/Keychains/build.keychain >/dev/null 2>&1
# security default-keychain -s ~/Library/Keychains/build.keychain >/dev/null 2>&1
# security unlock-keychain -p "" ~/Library/Keychains/build.keychain >/dev/null 2>&1
# security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/build.keychain >/dev/null 2>&1
# Install the Apple certificate and provisioning profile

- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPSTORE_CERT_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.MOBILEPROVISION_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
security create-keychain -p "" build.keychain >/dev/null 2>&1
security import WLANThermo_Distribution_Certificate.p12 -t agg -k ~/Library/Keychains/build.keychain -P "" -A >/dev/null 2>&1
security list-keychains -s ~/Library/Keychains/build.keychain >/dev/null 2>&1
security default-keychain -s ~/Library/Keychains/build.keychain >/dev/null 2>&1
security unlock-keychain -p "" ~/Library/Keychains/build.keychain >/dev/null 2>&1
security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/build.keychain >/dev/null 2>&1
# 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 --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $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 -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 iOS app
working-directory: ./mobile_flutter/wlanthermo_flutter_app
Expand Down

0 comments on commit d19ca5a

Please sign in to comment.