Switched to named routes #102
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
on: | |
push: | |
branches: | |
- main | |
name: Flutter | |
jobs: | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" # or: 'beta', 'dev' or 'master' | |
architecture: x64 # optional, x64 or arm64 | |
cache: true | |
cache-key: 'flutter-${{ github.job }}-:os:-:channel:-:version:-:arch:-:hash:' | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
build/ | |
android/.gradle/ | |
key: ${{ runner.os }}-flutter-${{ github.job }}-${{ hashFiles('**/*.gradle*', 'pubspec.lock') }} | |
- run: flutter --version | |
- run: flutter pub global activate flutterfire_cli | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter test | |
- name: save release key | |
env: | |
KEY_FILE_BASE64: ${{ secrets.KEY_FILE_BASE64 }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
run: | | |
echo "$KEY_FILE_BASE64" | base64 -d > "$(pwd)/release.keystore" | |
echo "storeFile=$(pwd)/release.keystore" >> android/key.properties | |
echo "keyAlias=$KEY_ALIAS" >> android/key.properties | |
echo "keyPassword=$KEY_PASSWORD" >> android/key.properties | |
echo "storePassword=$KEY_PASSWORD" >> android/key.properties | |
echo "VERSION_CODE=$GITHUB_RUN_NUMBER" > android/version.properties | |
# - run: flutter build apk --release | |
- run: curl -sL https://firebase.tools | bash | |
- run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json | |
env: | |
FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}} | |
- run: rm lib/firebase_options.dart | |
- run: flutterfire configure -y --platforms=android --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
- run: flutter build appbundle --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: android | |
path: build/app/outputs | |
retention-days: 1 | |
- uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: com.prijindal.habbit_tracker | |
track: internal | |
status: completed | |
releaseFiles: build/app/outputs/bundle/release/app-release.aab | |
mappingFile: build/app/outputs/mapping/release/mapping.txt | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" # or: 'beta', 'dev' or 'master' | |
architecture: x64 # optional, x64 or arm64 | |
cache: true | |
cache-key: 'flutter-${{ github.job }}-:os:-:channel:-:version:-:arch:-:hash:' | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' | |
- run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libwebkit2gtk-4.0-dev | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: build/ | |
key: ${{ runner.os }}-flutter-${{ github.job }}-${{ hashFiles('pubspec.lock') }} | |
- run: flutter --version | |
- run: flutter pub global activate flutterfire_cli | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter test --coverage | |
- uses: codecov/codecov-action@v4 | |
with: | |
flags: app-flutter | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- run: curl -sL https://firebase.tools | bash | |
- run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json | |
env: | |
FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}} | |
- run: rm lib/firebase_options.dart | |
- run: flutterfire configure -y --platforms=web --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
- run: flutter build web --release | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: '${{ secrets.GITHUB_TOKEN }}' | |
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL }}' | |
channelId: live | |
projectId: habbit-tracker-prijindal | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: web | |
path: build/web | |
retention-days: 1 | |
- run: flutter build linux --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: build/linux | |
retention-days: 1 | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" # or: 'beta', 'dev' or 'master' | |
architecture: x64 # optional, x64 or arm64 | |
cache: true | |
cache-key: 'flutter-${{ github.job }}-:os:-:channel:-:version:-:arch:-:hash:' | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: build/ | |
key: ${{ runner.os }}-flutter-${{ github.job }}-${{ hashFiles('pubspec.lock') }} | |
- run: flutter --version | |
- run: flutter pub global activate flutterfire_cli | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter test | |
# - run: curl -sL https://firebase.tools | bash | |
# - run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json | |
# env: | |
# FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}} | |
# - run: rm lib/firebase_options.dart | |
# - run: flutterfire configure -y --platforms=macos,ios --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd | |
# env: | |
# GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
# - run: flutter build macos --release | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# name: macos | |
# path: build/macos | |
# - run: flutter build ios --release --no-codesign | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# name: ios | |
# path: build/ios | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" # or: 'beta', 'dev' or 'master' | |
architecture: x64 # optional, x64 or arm64 | |
cache: true | |
cache-key: 'flutter-${{ github.job }}-:os:-:channel:-:version:-:arch:-:hash:' | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: build/ | |
key: ${{ runner.os }}-flutter-${{ github.job }}-${{ hashFiles('pubspec.lock') }} | |
- run: flutter --version | |
- run: flutter pub global activate flutterfire_cli | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter test | |
# - run: npm install -g firebase-tools | |
# - run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json | |
# env: | |
# FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}} | |
# - run: rm lib/firebase_options.dart | |
# - run: flutterfire configure -y --platforms=windows --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd | |
# env: | |
# GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
- run: flutter build windows --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: build/windows/x64/runner/Release | |
retention-days: 1 |