CI #63
This file contains hidden or 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: CI & Testing | |
| on: | |
| workflow_run: | |
| workflows: ["Compress Media"] | |
| types: | |
| - completed | |
| jobs: | |
| test-and-deploy-internal: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: "stable" | |
| - name: Create .env file | |
| run: | | |
| cat << EOF > .env | |
| HACKAI_API_KEY=${{ secrets.HACKAI_API_KEY }} | |
| MAP_BUILDER_MODE=${{ secrets.MAP_BUILDER_MODE }} | |
| EOF | |
| - name: Install Dependencies | |
| run: flutter pub get | |
| - name: Error Check & Tests | |
| run: | | |
| flutter analyze | |
| flutter test --coverage | |
| - name: Decode Android Secrets | |
| if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' | |
| run: | | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > upload-keystore.jks | |
| cat << EOF > android/key.properties | |
| storePassword=${{ secrets.STORE_PASSWORD }} | |
| keyPassword=${{ secrets.KEY_PASSWORD }} | |
| keyAlias=${{ secrets.KEY_ALIAS }} | |
| storeFile=../upload-keystore.jks | |
| EOF | |
| - name: Build Android AAB | |
| if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' | |
| run: flutter build appbundle --release | |
| - name: Upload to Google Play | |
| if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
| packageName: io.grimoji.game | |
| releaseFiles: build/app/outputs/bundle/release/app-release.aab | |
| tracks: internal | |
| status: completed |