Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_PATH: "vendor/bundle"
128 changes: 45 additions & 83 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,33 @@ on:
jobs:
test-ios:
runs-on: macos-14
defaults:
run:
working-directory: "./example"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ruby/setup-ruby@v1
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
bundler-cache: true
- run: sudo xcode-select -s /Applications/Xcode_16.2.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
- run: make example-flutter-pub-get
- run: make example-flutter-test
- run: make example-flutter-analyze
- run: make example-dart-format
- run: make example-pod-install
- run: make example-build-unsigned-ios-app

test-android:
runs-on: macos-14
defaults:
run:
working-directory: "./example"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ruby/setup-ruby@v1
with:
node-version-file: "./.tool-versions"
bundler-cache: true
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java
- name: Set java version
run: |
Expand All @@ -60,11 +52,12 @@ jobs:
# 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: make example-flutter-pub-get
- run: make example-flutter-test
- run: make example-flutter-analyze
- run: make example-dart-format
- run: flutter build apk --debug
working-directory: ./example

deploy-docs:
runs-on: ubuntu-24.04
Expand All @@ -78,89 +71,58 @@ jobs:
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: make sdk-flutter-pub-get
- run: make sdk-flutter-test
- run: make sdk-flutter-analyze
- run: make sdk-dart-format
# 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' }}
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' && 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"
if: ${{ github.repository == 'authgear/authgear-sdk-flutter' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ruby/setup-ruby@v1
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
bundler-cache: true
- run: sudo xcode-select -s /Applications/Xcode_16.2.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
- 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"
- run: make example-flutter-pub-get
- run: make example-flutter-test
- run: make example-flutter-analyze
- run: make example-dart-format
- uses: authgear/gh-actions-install-apple-certificate-and-provisioning-profile@v1
with:
certificate_base64: ${{ secrets.IOS_CERTIFICATE_BASE64 }}
certificate_password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
provisioning_profile_base64: ${{ secrets.IOS_PROVISIONING_PROFILE_BASE64 }}
- uses: authgear/gh-actions-create-fastlane-api-key-json-file@v1
with:
api_key_id: ${{ secrets.IOS_API_KEY_ID }}
api_key_issuer: ${{ secrets.IOS_API_KEY_ISSUER }}
api_key_base64: ${{ secrets.IOS_API_KEY_BASE64 }}
output_path: ./build/fastlane-api-key.json
- run: make example-pod-install
- run: make example-build-ios-app
- name: Upload to TestFlight
if: ${{ github.ref == 'refs/heads/main' }}
run: make example-upload-ios-app

deploy-android:
runs-on: macos-14
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*.iws
.idea/

# xcode
xcuserdata/
xcshareddata/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
Expand All @@ -27,3 +31,8 @@
.dart_tool/
.packages
build/

# fastlane
/vendor/
/fastlane/README.md
/fastlane/report.xml
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flutter 3.27.1-stable
nodejs 20.18.1
ruby 3.3.6
ruby 3.3.7
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org'

gem "cocoapods", "1.16.0"
gem "cocoapods", "~> 1.16"
gem "fastlane", "~> 2.227"
Loading
Loading