Skip to content

setting up CI

setting up CI #29

Workflow file for this run

name: build and release
on:
push:
branches: [ "main" ]
jobs:
build:
name: build and release
runs-on: macos-latest
permissions:
contents: write
steps:
- name: checkout source
uses: actions/checkout@v4
- name: set up flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: pubspec.yaml
cache: true
- name: print flutter version
run: flutter --version
- name: get dependencies
run: flutter pub get
- name: test
run: flutter test
- name: restore gradle cache
uses: actions/cache/restore@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: release paperwork
run: |
./gradlew release-paperwork
git push
- name: setup firebase
run: |
echo "${{ secrets.FIREBASE_OPTIONS_DART }}" | base64 -d >> ./lib/firebase_options.dart
echo "${{ secrets.GOOGLE_SERVICE_JSON }}" | base64 -d >> ./android/app/google-services.json
- name: prepare release signing
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" | base64 -d >> ./android/app/chrono-sheet.jks
echo "storeFile=chrono-sheet.jks" >> ./android/key.properties
echo "storePassword=${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" >> ./android/key.properties
echo "keyPassword=${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" >> ./android/key.properties
echo "keyAlias=${{ secrets.RELEASE_KEYSTORE_KEY }}" >> ./android/key.properties
keytool -list -v -keystore ./android/app/chrono-sheet.jks -storepass ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} -storetype PKCS12 -alias chrono-sheet-release
- name: build apk
run: flutter build apk --release
- name: build app bundle
run: flutter build appbundle
- name: save gradle cache
uses: actions/cache/save@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: upload apk
uses: actions/upload-artifact@v4
with:
name: apk
path: build/app/outputs/flutter-apk/app-release.apk
- name: upload aab
uses: actions/upload-artifact@v4
with:
name: aab
path: build/app/outputs/bundle/release/app-release.aab