ci: I hate apples #6516
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: Dev builds | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
- beta | |
pull_request: | |
branches: | |
- master | |
- beta | |
jobs: | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Java JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: "11" | |
- uses: subosito/[email protected] | |
with: | |
channel: stable | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | |
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
architecture: x64 # optional, x64 or arm64 | |
- name: Install keystore and Firebase keys | |
env: | |
KEYSTORE: ${{ secrets.KEYSTORE }} | |
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} | |
FIREBASE_ANDROID: ${{ secrets.FIREBASE_ANDROID }} | |
run: | | |
echo $KEYSTORE | base64 -di > android/keystore.jks | |
echo $FIREBASE_OPTIONS | base64 --decode > lib/firebase_options.dart | |
echo $FIREBASE_ANDROID | base64 --decode > android/app/google-services.json | |
- name: Build app | |
env: | |
KEYSTOREPASS: ${{ secrets.KEYSTOREPASS }} | |
run: flutter build apk --flavor dev --split-per-abi | |
- name: Uploade artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android-test-artifacts | |
path: "build/app/outputs/flutter-apk/app-*-dev-release.apk" | |
ios: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.0 | |
bundler-cache: true | |
working-directory: ios | |
- name: Setup certs using fastlane | |
working-directory: ios | |
env: | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA: ${{ secrets.SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
run: bundle exec fastlane match appstore | |
- uses: subosito/[email protected] | |
with: | |
channel: stable | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | |
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
architecture: x64 | |
- name: Setup Firebase | |
env: | |
FIREBASE_IOS: ${{ secrets.FIREBASE_IOS }} | |
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} | |
FIREBASE_IOS_SERVICES: ${{ secrets.FIREBASE_IOS_SERVICES }} | |
run: | | |
echo $FIREBASE_IOS | base64 --decode > ios/firebase_app_id_file.json | |
echo $FIREBASE_OPTIONS | base64 --decode > lib/firebase_options.dart | |
echo $FIREBASE_IOS_SERVICES | base64 --decode > ios/runner/GoogleService-Info.plist | |
- name: Build app | |
run: flutter build ipa --export-options-plist=ios/ExportOptions.plist | |
- name: Uploade artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ios-test-artifact | |
path: "build/ios/ipa/*.ipa" |