From 0fd42578e45c8ce7a88e31606b8104674267cb8b Mon Sep 17 00:00:00 2001 From: Nico Vidoni Date: Thu, 14 Nov 2024 14:14:02 +0100 Subject: [PATCH] chore: add build and release example app workflow --- .../example_app_build_and_release.yml | 83 +++++++++++++++++++ .github/workflows/release-please.yml | 65 --------------- 2 files changed, 83 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/example_app_build_and_release.yml diff --git a/.github/workflows/example_app_build_and_release.yml b/.github/workflows/example_app_build_and_release.yml new file mode 100644 index 0000000..54465d1 --- /dev/null +++ b/.github/workflows/example_app_build_and_release.yml @@ -0,0 +1,83 @@ +# The actual build and release of the example app +name: Example app build and release +on: + pull_request_target: + types: + - closed + branches: + - main + +jobs: + release-android-example-app: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'exampleAppRelease:pending') + runs-on: ubuntu-latest + defaults: + run: + working-directory: example + steps: + - uses: actions/checkout@v4 + + # - uses: subosito/flutter-action@v2 + # with: + # channel: stable + # cache: true + + # - uses: actions/setup-java@v4 + # with: + # java-version: "17" + # distribution: "temurin" + # cache: "gradle" + + # - name: Make secret env file accessible for envied generation. + # uses: timheuer/base64-to-file@v1.2 + # with: + # fileName: ".env" + # fileDir: "./example" + # encodedString: ${{ secrets.EXAMPLE_APP_ENV_FILE_PROD_BASE64 }} + + # - name: Write Keystore from base64 encoded secret. + # uses: timheuer/base64-to-file@v1.2 + # with: + # fileName: "sbb_maps_flutter_example_keystore.jks" + # fileDir: "./example/android/app/keys" + # encodedString: ${{ secrets.ANDROID_KEYSTORE_64 }} + + # - run: flutter pub get + # - run: dart run build_runner build --delete-conflicting-outputs + # - run: flutter build appbundle --no-pub + # env: + # SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} + # SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + # SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + + # - name: Create Signing Report + # run: ./gradlew signingReport + # working-directory: ./example/android + + # - name: Upload appbundle as artifact + # uses: actions/upload-artifact@v4 + # with: + # name: app-release.aab + # path: example/build/app/outputs/bundle/release/ + # retention-days: 3 + + # - name: Write Google SA json from base64 encoded secret + # uses: timheuer/base64-to-file@v1.2 + # with: + # fileName: "google_playstore_service_account.json" + # fileDir: "./example/android/app/keys" + # encodedString: ${{ secrets.GOOGLE_PLAYSTORE_SERVICE_ACCOUNT_BASE64 }} + + # - name: Release using Google Play Publisher + # run: ./gradlew publishBundle --artifact-dir ../build/app/outputs/bundle/release/ + # working-directory: ./example/android + + label-cleanup: + needs: release-android-example-app + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - run: gh pr edit --remove-label exampleAppRelease:pending + - run: gh pr edit --add-label exampleAppRelease:released diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ea3e1a7..cc72825 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,68 +20,3 @@ jobs: with: config-file: ci/release-please-config.json manifest-file: ci/.release-please-manifest.json - - # release-android-example-app: - # needs: release-please - # if: ${{ needs.release-please.outputs.release-created }} - # runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: example - # steps: - # - uses: actions/checkout@v4 - - # - uses: subosito/flutter-action@v2 - # with: - # channel: stable - # cache: true - - # - uses: actions/setup-java@v4 - # with: - # java-version: "17" - # distribution: "temurin" - # cache: "gradle" - - # - name: Make secret env file accessible for envied generation. - # uses: timheuer/base64-to-file@v1.2 - # with: - # fileName: ".env" - # fileDir: "./example" - # encodedString: ${{ secrets.EXAMPLE_APP_ENV_FILE_PROD_BASE64 }} - - # - name: Write Keystore from base64 encoded secret. - # uses: timheuer/base64-to-file@v1.2 - # with: - # fileName: "sbb_maps_flutter_example_keystore.jks" - # fileDir: "./example/android/app/keys" - # encodedString: ${{ secrets.ANDROID_KEYSTORE_64 }} - - # - run: flutter pub get - # - run: dart run build_runner build --delete-conflicting-outputs - # - run: flutter build appbundle --no-pub - # env: - # SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} - # SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} - # SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} - - # - name: Create Signing Report - # run: ./gradlew signingReport - # working-directory: ./example/android - - # - name: Upload appbundle as artifact - # uses: actions/upload-artifact@v4 - # with: - # name: app-release.aab - # path: example/build/app/outputs/bundle/release/ - # retention-days: 3 - - # - name: Write Google SA json from base64 encoded secret - # uses: timheuer/base64-to-file@v1.2 - # with: - # fileName: "google_playstore_service_account.json" - # fileDir: "./example/android/app/keys" - # encodedString: ${{ secrets.GOOGLE_PLAYSTORE_SERVICE_ACCOUNT_BASE64 }} - - # - name: Release using Google Play Publisher - # run: ./gradlew publishBundle --artifact-dir ../build/app/outputs/bundle/release/ - # working-directory: ./example/android