Skip to content

[TEST] implement GitHub actions #9

[TEST] implement GitHub actions

[TEST] implement GitHub actions #9

Workflow file for this run

name: Deploy UAT Apps
on:
# push:
# branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# # 3
# workflow_dispatch:
jobs:
build_with_signing:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 12.x
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
FLUTTERADHOCDISTRIBUTION: ${{ secrets.FLUTTERADHOCDISTRIBUTION }}
FLUTTERADHOCBROADCASTUPLOADEXTENSION: ${{ secrets.FLUTTERADHOCBROADCASTUPLOADEXTENSION }}
FLUTTERAPPSTORE: ${{ secrets.FLUTTERAPPSTORE }}
FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION: ${{ secrets.FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
SLACK_URL: ${{ secrets.SLACK_URL }}
FLUTTER_HMS_JSON: ${{ secrets.FLUTTER_HMS_JSON }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH_FLUTTERADHOCDISTRIBUTION=$RUNNER_TEMP/FLUTTERADHOCDISTRIBUTION.mobileprovision
PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION=$RUNNER_TEMP/FLUTTERADHOCBROADCASTUPLOADEXTENSION.mobileprovision
PP_PATH_FLUTTERAPPSTORE=$RUNNER_TEMP/FLUTTERAPPSTORE.mobileprovision
PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION=$RUNNER_TEMP/FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION.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 "$FLUTTERADHOCDISTRIBUTION" | base64 --decode -o $PP_PATH_FLUTTERADHOCDISTRIBUTION
echo -n "$FLUTTERADHOCBROADCASTUPLOADEXTENSION" | base64 --decode -o $PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION
echo -n "$FLUTTERAPPSTORE" | base64 --decode -o $PP_PATH_FLUTTERAPPSTORE
echo -n "$FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION" | base64 --decode -o $PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION
# 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_FLUTTERADHOCDISTRIBUTION ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH_FLUTTERAPPSTORE ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION ~/Library/MobileDevice/Provisioning\ Profiles
# - name: Run Release Script
# run: |
# chmod +x ./release-apps.sh
# ./release-apps.sh
# shell: bash