Fixed linting issues #85
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@v3 | |
- 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@v3 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
- name: Cache | |
uses: actions/cache@v3 | |
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: 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 | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
- run: flutter build appbundle --release | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
- 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 | |
- name: Cache | |
uses: actions/cache@v3 | |
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@v3 | |
with: | |
flags: app-flutter | |
- 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: 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 | |
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@v3 | |
with: | |
name: web | |
path: build/web | |
retention-days: 1 | |
- run: flutter build linux --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux | |
path: build/linux | |
retention-days: 1 | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
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: 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 | |
# env: | |
# GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | |
# - run: flutter build macos --release | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: macos | |
# path: build/macos | |
# - run: flutter build ios --release --no-codesign | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: ios | |
# path: build/ios | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
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: flutter build windows --release | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: windows | |
# path: build/windows | |
# retention-days: 1 |