Release 1.8.0 #71 #204
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: CI | |
on: | |
push: | |
branches: | |
- '*' | |
- '!gh-pages' | |
pull_request: | |
branches: | |
- '*' | |
- '!gh-pages' | |
jobs: | |
test-ios: | |
runs-on: macos-14 | |
defaults: | |
run: | |
working-directory: "./example" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "./.tool-versions" | |
# Xcode_16.2.app is available, but it does not have any simulator pre-installed. | |
# So it is not really usable. | |
# Let's use Xcode_16.1.app instead. | |
- run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer | |
- uses: subosito/flutter-action@v2 | |
with: | |
# This has to be kept in sync with .tool-versions | |
flutter-version: '3.27.1' | |
channel: 'stable' | |
# This action takes 1m30s to finish. Enable cache to make it shorter. | |
cache: true | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter analyze --no-fatal-infos | |
- run: dart format --set-exit-if-changed lib | |
- run: flutter build ipa --no-codesign | |
test-android: | |
runs-on: macos-14 | |
defaults: | |
run: | |
working-directory: "./example" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "./.tool-versions" | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java | |
- name: Set java version | |
run: | | |
echo "JAVA_HOME=$JAVA_HOME_21_arm64" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v2 | |
with: | |
# This has to be kept in sync with .tool-versions | |
flutter-version: '3.27.1' | |
channel: 'stable' | |
# This action takes 1m30s to finish. Enable cache to make it shorter. | |
cache: true | |
- run: echo "$ANDROID_HOME/tools/bin" >> $GITHUB_PATH | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter analyze --no-fatal-infos | |
- run: dart format --set-exit-if-changed lib | |
- run: flutter build apk --debug | |
deploy-docs: | |
runs-on: ubuntu-24.04 | |
needs: ["test-ios", "test-android"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
# This has to be kept in sync with .tool-versions | |
flutter-version: '3.27.1' | |
channel: 'stable' | |
# This action takes 1m30s to finish. Enable cache to make it shorter. | |
cache: true | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter analyze --no-fatal-infos | |
- run: dart format --set-exit-if-changed lib | |
# Install the latest dartdoc to avoid a bug | |
# See DEVELOPER.md | |
- run: flutter pub global activate dartdoc | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- run: flutter pub global run dartdoc | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- name: Deploy docs to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./doc/api | |
deploy-ios: | |
runs-on: macos-14 | |
needs: ["test-ios"] | |
# We cannot build in PRs because secrets are not available in PRs. | |
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }} | |
defaults: | |
run: | |
working-directory: "./example" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "./.tool-versions" | |
# Xcode_16.2.app is available, but it does not have any simulator pre-installed. | |
# So it is not really usable. | |
# Let's use Xcode_16.1.app instead. | |
- run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer | |
- run: npm install -g appcenter-cli | |
- uses: subosito/flutter-action@v2 | |
with: | |
# This has to be kept in sync with .tool-versions | |
flutter-version: '3.27.1' | |
channel: 'stable' | |
# This action takes 1m30s to finish. Enable cache to make it shorter. | |
cache: true | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter analyze --no-fatal-infos | |
- run: dart format --set-exit-if-changed lib | |
- name: Prepare certificate and provisioning profile | |
env: | |
IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} | |
IOS_CERTIFICATE_BASE64: ${{ secrets.IOS_CERTIFICATE_BASE64 }} | |
IOS_PROVISIONING_PROFILE_BASE64: ${{ secrets.IOS_PROVISIONING_PROFILE_BASE64 }} | |
IOS_KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }} | |
run: | | |
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 "$IOS_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$IOS_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
# create temporary keychain | |
security create-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$IOS_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$IOS_KEYCHAIN_PASSWORD" $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 .ipa | |
run: | | |
BUILD_NUMBER=$(date +%s) | |
flutter build ipa --export-options-plist ./exportOptions.plist --build-number $BUILD_NUMBER | |
- name: Distribute to App Center | |
env: | |
APPCENTER_ACCESS_TOKEN: ${{ secrets.IOS_APPCENTER_ACCESS_TOKEN }} | |
run: appcenter distribute release --debug --silent --file "./build/ios/ipa/Authgear Flutter.ipa" --store "App Store Connect Users" --app "Oursky/Authgear-Demo-Flutter-iOS" --release-notes "no release notes" | |
deploy-android: | |
runs-on: macos-14 | |
needs: ["test-android"] | |
# We cannot build in PRs because secrets are not available in PRs. | |
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }} | |
defaults: | |
run: | |
working-directory: "./example" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "./.tool-versions" | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java | |
- name: Set java version | |
run: | | |
echo "JAVA_HOME=$JAVA_HOME_21_arm64" >> $GITHUB_ENV | |
- run: npm install -g appcenter-cli | |
- uses: subosito/flutter-action@v2 | |
with: | |
# This has to be kept in sync with .tool-versions | |
flutter-version: '3.27.1' | |
channel: 'stable' | |
# This action takes 1m30s to finish. Enable cache to make it shorter. | |
cache: true | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter analyze --no-fatal-infos | |
- run: dart format --set-exit-if-changed lib | |
- name: Prepare key store | |
env: | |
ANDROID_KEY_STORE_BASE64: ${{ secrets.ANDROID_KEY_STORE_BASE64 }} | |
run: | | |
KEY_STORE_PATH=./android/app/keystore.jks | |
echo -n "$ANDROID_KEY_STORE_BASE64" | base64 --decode -o "$KEY_STORE_PATH" | |
- name: Build .apk | |
env: | |
STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
run: | | |
BUILD_NUMBER=$(date +%s) | |
flutter build apk --build-number $BUILD_NUMBER -P STORE_PASSWORD="$STORE_PASSWORD" -P KEY_PASSWORD="$KEY_PASSWORD" -P KEY_ALIAS="$KEY_ALIAS" | |
- name: Distribute to App Center | |
env: | |
APPCENTER_ACCESS_TOKEN: ${{ secrets.ANDROID_APPCENTER_ACCESS_TOKEN }} | |
run: appcenter distribute release --debug --silent --file "./build/app/outputs/flutter-apk/app-release.apk" --group "Collaborators" --app "Oursky/Authgear-Demo-Flutter-Android" |