ios build attempt #6 #165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mobile build | |
on: | |
push: | |
branches: | |
- android-build-test | |
- develop | |
jobs: | |
main: | |
name: Mobile build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: npm install UI project | |
working-directory: ./webui | |
run: npm install | |
- name: Build App HTML file from UI project | |
working-directory: ./webui | |
run: npm run build-mobile | |
- name: Decrypt files | |
working-directory: ./.github/secrets | |
run: | | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ../../mobile_flutter/wlanthermo_flutter_app/google-services.json google-services.json.gpg | |
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ../../mobile_flutter/wlanthermo_flutter_app/ios/bell.mp3 bell.mp3.gpg | |
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.SECRET_KEY }}" --output ../../mobile_flutter/wlanthermo_flutter_app/android/key.properties key.properties.gpg | |
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 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.13.4' | |
cache: true | |
architecture: x64 | |
- name: Flutter pug get | |
working-directory: ./mobile_flutter/wlanthermo_flutter_app | |
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 }} | |
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 | |
- name: Build iOS app | |
working-directory: ./mobile_flutter/wlanthermo_flutter_app | |
run: flutter build ipa | |
- name: Build android | |
working-directory: ./mobile_flutter/wlanthermo_flutter_app | |
run: | | |
flutter pub get | |
flutter build apk --release --no-shrink | |
flutter build appbundle --release --no-shrink --build-number 10010 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: android-dev | |
path: | | |
./mobile_flutter/wlanthermo_flutter_app/build/app/outputs/flutter-apk/app-release.apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: android-appbundle | |
path: | | |
./mobile_flutter/wlanthermo_flutter_app/build/app/outputs/bundle/release/app-release.aab |