ci: use Apple-Actions/import-codesign-certs@v1 #6
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: Release to Dev | |
on: | |
push: | |
branches: | |
- release_to_dev | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Read Flutter SDK version | |
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV | |
shell: bash | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: flutter pub get (dart_flutter_common) | |
run: cd packages/dart_flutter_common && flutter pub get | |
- name: flutter pub get (firebase_common) | |
run: cd packages/firebase_common && flutter pub get | |
- name: flutter pub get (mottai_flutter_app) | |
run: cd packages/mottai_flutter_app && flutter pub get | |
- name: Create dev-dart-define.json from GitHub secret | |
run: cd packages/mottai_flutter_app && echo '${{ secrets.DEV_DART_DEFINE_JSON_STRING }}' > dev-dart-define.json | |
# - name: Decode and install certificate | |
# run: | | |
# echo ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_P12_BASE64_STRING }} | base64 --decode > certificate.p12 | |
# security create-keychain -p "" build.keychain | |
# security import certificate.p12 -k build.keychain -P ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_P12_PASSWORD }} -A | |
# - name: Decode and install provisioning profile | |
# run: | | |
# echo ${{ secrets.PROVISIONING_PROFILE_BASE64_STRING }} | base64 --decode > profile.mobileprovision | |
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
# cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/ | |
# - name: Set keychain settings | |
# run: | | |
# security list-keychains -s build.keychain | |
# security default-keychain -s build.keychain | |
# security unlock-keychain -p "" build.keychain | |
# security set-keychain-settings -lut 3600 build.keychain | |
- name: Decode and install provisioning profile | |
run: | | |
echo ${{ secrets.PROVISIONING_PROFILE_BASE64_STRING }} | base64 --decode > profile.mobileprovision | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/ | |
# 署名をする | |
- name: Import Code-Signing Certificates | |
uses: Apple-Actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_P12_BASE64_STRING }} | |
p12-password: ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_P12_PASSWORD }} | |
- name: Flutter Build IPA | |
run: | | |
cd packages/mottai_flutter_app | |
flutter build ipa --release \ | |
--dart-define-from-file="dev-dart-define.json" \ | |
-t "lib/main.dart" \ | |
--build-name=$(grep 'version:' pubspec.yaml | cut -d ' ' -f 2 | cut -d '+' -f 1) \ | |
--build-number=$GITHUB_RUN_NUMBER \ | |
--export-options-plist="ios/ExportOptions.plist" | |
- name: Validate IPA | |
run: | | |
xcrun altool --validate-app \ | |
-f "./packages/mottai_flutter_app/build/ios/ipa/mottai_dev.ipa" \ | |
-t ios \ | |
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \ | |
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \ | |
--private-key ${{ secrets.DEV_IOS_AUTH_KEY }} | |
- name: Upload IPA to TestFlight | |
run: | | |
xcrun altool --upload-app \ | |
-f "./packages/mottai_flutter_app/build/ios/ipa/mottai_dev.ipa" \ | |
-t ios \ | |
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \ | |
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \ | |
--private-key ${{ secrets.DEV_IOS_AUTH_KEY }} |