diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index c854043..6aa3380 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -34,6 +34,7 @@ jobs: gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ../../mobile_flutter/wlanthermo_flutter_app/android/app/keystore.jks keystore.jks.gpg gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output WLANThermo_Distribution_Certificate.p12 WLANThermo_Distribution_Certificate.p12.gpg gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ~/Library/MobileDevice/Provisioning\ Profiles/WLANThermo_Provisioning_Ad_Hoc.mobileprovision WLANThermo_Provisioning_Ad_Hoc.mobileprovision.gpg + gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ../../mobile_flutter/wlanthermo_flutter_app/GoogleService-Info.plist GoogleService-Info.plist.gpg - uses: actions/setup-java@v2 with: @@ -51,45 +52,19 @@ jobs: run: | flutter pub get - # - 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 }} - P12_PASSWORD: ${{ secrets.APPSTORE_CERT_PASSWORD }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.MOBILEPROVISION_BASE64 }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + - name: Prepare iOS provisioning + working-directory: ./.github/secrets 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 --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 -P "" -A -t agg -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 + 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 - name: Build iOS app working-directory: ./mobile_flutter/wlanthermo_flutter_app - run: flutter build ipa + run: flutter build ipa --release --export-options-plist=GoogleService-Info.plist.plist - name: Build android working-directory: ./mobile_flutter/wlanthermo_flutter_app