From cb079e6fea6e4e455a3b1d40533eff49b114a5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Arteiro?= Date: Wed, 18 Oct 2023 15:48:52 +0100 Subject: [PATCH] chore: Starting out Android deploy. --- .github/workflows/build.yml | 4 +-- .github/workflows/deploy_android.yml | 41 ++++++++++++++++++++++++++++ .github/workflows/deploy_web.yml | 7 +++-- 3 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy_android.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bf839d..fb99369 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,11 +13,11 @@ jobs: steps: - uses: actions/checkout@v3 - # Installing Flutter because it's easier to generate .lcov files for test coverage - name: Install Flutter uses: subosito/flutter-action@v2 with: - channel: 'stable' + flutter-version: "3.13.5" + channel: "stable" - name: Install dependencies run: flutter pub get diff --git a/.github/workflows/deploy_android.yml b/.github/workflows/deploy_android.yml new file mode 100644 index 0000000..6abb11f --- /dev/null +++ b/.github/workflows/deploy_android.yml @@ -0,0 +1,41 @@ +name: Deploy Android (Google Play Store) +on: + # Only trigger, when the "build" workflow succeeded (only works in the Master Branch) + workflow_run: + workflows: ["Build & Test"] + types: + - completed + + # Only trigger, when pushing into the `main` branch + push: + branches: [main] + +permissions: + contents: write + +jobs: + build-and-deploy_android: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # Needed to base64 decode the upload keystore + - name: ⚙️ Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: "12.x" + cache: 'gradle' + id: java + + # Needed to run Flutter-based commands + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: "3.13.5" + channel: "stable" + + - name: Install dependencies + run: flutter pub get diff --git a/.github/workflows/deploy_web.yml b/.github/workflows/deploy_web.yml index af7db60..116ebac 100644 --- a/.github/workflows/deploy_web.yml +++ b/.github/workflows/deploy_web.yml @@ -1,8 +1,8 @@ name: Deploy Web (GitHub Pages) on: - # Only trigger, when the "build" workflow succeeded + # Only trigger, when the "build" workflow succeeded (only works in the Master Branch) workflow_run: - workflows: ["CI build"] + workflows: ["Build & Test"] types: - completed @@ -14,7 +14,7 @@ permissions: contents: write jobs: - build-and-deploy: + build-and-deploy_web: runs-on: ubuntu-latest steps: @@ -24,6 +24,7 @@ jobs: - name: Install Flutter uses: subosito/flutter-action@v2 with: + flutter-version: "3.13.5" channel: "stable" - name: Install dependencies