diff --git a/.github/workflows/deploy1.yml b/.github/workflows/deploy1.yml index 02fffb84..51eef18a 100644 --- a/.github/workflows/deploy1.yml +++ b/.github/workflows/deploy1.yml @@ -1,63 +1,82 @@ name: Android Build & Deploy on: - workflow_dispatch: + workflow_dispatch: jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up ruby env - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7.2 - bundler-cache: true - - - name: Run tests - run: bundle exec fastlane android test - - - name: Decode Service Account Key JSON File - uses: timheuer/base64-to-file@v1 - id: service_account_json_file - with: - fileName: "serviceAccount.json" - encodedString: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} - - - name: Decode Keystore File - uses: timheuer/base64-to-file@v1 - id: android_keystore - with: - fileName: "android_keystore.keystore" - encodedString: ${{ secrets.KEYSTORE_FILE }} - - - name: Define version code with offset - env: - RUN_NUMBER: ${{ github.run_number }} - INITIAL_VERSION_CODE: 27 - run: | - VERSION_CODE=$((INITIAL_VERSION_CODE + RUN_NUMBER)) - echo "version_code=$VERSION_CODE" >> $GITHUB_ENV - - - name: Update version code - uses: chkfung/android-version-actions@v1.1 - with: - gradlePath: android/app/build.gradle - versionCode: ${{ env.version_code }} - - - name: Build & deploy Android release - run: bundle exec fastlane android deploy - env: - KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }} - STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS}} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }} - - - name: Upload build artifacts - uses: actions/upload-artifact@v2 - with: - name: assets - path: | - ${{ github.workspace }}/app/build/outputs/bundle/release \ No newline at end of file + deploy: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + + # Set up Flutter. + - name: Clone Flutter repository with master channel + uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d + with: + channel: master + - run: flutter doctor -v + + # Checkout gallery code and get packages. + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + - uses: actions/checkout@v2 + with: + # flutter-version: 2.14 + channel: 'stable' + cache: true + cache-key: flutter # optional, change this to force refresh cache + cache-path: ${{ runner.tool_cache }}/flutter + - run: flutter pub get + + - name: Set up ruby env + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.2 + bundler-cache: true + + # - name: Run tests + # run: bundle exec fastlane android test + + - name: Decode Service Account Key JSON File + uses: timheuer/base64-to-file@v1 + id: service_account_json_file + with: + fileName: "serviceAccount.json" + encodedString: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} + + - name: Decode Keystore File + uses: timheuer/base64-to-file@v1 + id: android_keystore + with: + fileName: "android_keystore.keystore" + encodedString: ${{ secrets.KEYSTORE_FILE }} + + - name: Define version code with offset + env: + RUN_NUMBER: ${{ github.run_number }} + INITIAL_VERSION_CODE: 27 + run: | + VERSION_CODE=$((INITIAL_VERSION_CODE + RUN_NUMBER)) + echo "version_code=$VERSION_CODE" >> $GITHUB_ENV + + - name: Update version code + uses: chkfung/android-version-actions@v1.1 + with: + gradlePath: android/app/build.gradle + versionCode: ${{ env.version_code }} + + - name: Build & deploy Android release + run: bundle exec fastlane android deploy + env: + KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }} + STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS}} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: assets + path: | + ${{ github.workspace }}/app/build/outputs/bundle/release \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/deploy_web_app.yml similarity index 99% rename from .github/workflows/test.yml rename to .github/workflows/deploy_web_app.yml index e70aea79..32311654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/deploy_web_app.yml @@ -3,7 +3,7 @@ # separate terms of service, privacy policy, and support # documentation. -name: Test+Deploy +name: Test + Deploy Web App on: push: