From 8164481b3e00928c78d25f946eadce675f0da0a2 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Thu, 19 Dec 2024 14:39:12 +0100 Subject: [PATCH 01/34] Add .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file From dce8102905fe2cc5617944b83076af18dca4777f Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Thu, 19 Dec 2024 14:50:10 +0100 Subject: [PATCH 02/34] Add universal-cloud-detect-changes.yml workflow --- .../universal-cloud-detect-changes.yml | 56 +++++++++++++++++++ README.md | 27 ++++----- 2 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/universal-cloud-detect-changes.yml diff --git a/.github/workflows/universal-cloud-detect-changes.yml b/.github/workflows/universal-cloud-detect-changes.yml new file mode 100644 index 0000000..5520ffc --- /dev/null +++ b/.github/workflows/universal-cloud-detect-changes.yml @@ -0,0 +1,56 @@ +name: Detect Changes + +# This workflow is a central decision point in the KMP project CI/CD pipeline that determines +# which platform-specific workflows should run based on changed files. +# +# The following project structure is assumed: Android app in `androidApp/` path and iOS app in `iosApp/` path +# relative to the repository root. +# +# It produces two outputs: +# - `iosFiles`: Will be set to 'true' if any files affecting iOS build were changed +# - `androidFiles`: Will be set to `true` if any files affecting Android build were changed +# +# Usage: +# 1. Call this workflow first in your trigger workflows +# 2. Use the outputs to conditionally run platform-specific workflows +# +# Example: +# jobs: +# changes: +# uses: ./.github/workflows/util_detect_changes.yml +# ios-build: +# needs: changes +# if: ${{ needs.changes.outputs.iosFiles == 'true' }} +# uses: ./.github/workflows/build_ios.yml + +on: + workflow_call: + outputs: + iosFiles: + description: "Whether files affecting iOS build changed (all files except those in androidApp/)" + value: ${{ jobs.detect-changes.outputs.iosFiles }} + androidFiles: + description: "Whether files affecting Android build changed (all files except those in iosApp/)" + value: ${{ jobs.detect-changes.outputs.androidFiles }} + +jobs: + detect-changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + # Matches all files which can affect iOS build if changed + iosFiles: ${{ steps.file-changes.outputs.iosFiles }} + # Matches all files which can affect Android build if changed + androidFiles: ${{ steps.file-changes.outputs.androidFiles }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect Changes + uses: dorny/paths-filter@v3 + id: file-changes + with: + filters: | + iosFiles: + - "!(androidApp/**)" + androidFiles: + - "!(iosApp/**)" diff --git a/README.md b/README.md index 674f02c..3f8cf3c 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,20 @@ All the available reusable workflows are listed in the following table. ### Available workflows -|Platform |Runner |Action |File |Description | -|:--------------|:-----------|:-------|:------------------------------------------------------------------------------------|:---------------------------------------------------------------------| -|Universal |Cloud |Backup |[`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) |Backups currently checked out ref to a remote repository. | -|Universal |Self-hosted |Backup |[`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) |Backups currently checked out ref to a remote repository. | -|iOS |Self-hosted |Test |[`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) |Lints and tests the PR. | -|iOS |Self-hosted |Build |[`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) |Creates enterprise release build and submits the build to Futured App Store Connect. | -|iOS |Self-hosted |Release |[`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) |Creates release build and submits it to App Store Connect. | -|iOS |Cloud |Test |[`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) |Lints and tests the PR. | -|iOS |Cloud |Build |[`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) |Creates enterprise release build and submits the build to App Center. | -|iOS |Cloud |Release |[`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) |Creates release build and submits it to App Store Connect. | -|iOS (KMP) |Self-hosted |Test |[`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) |Lints and tests the PR. | -|iOS (KMP) |Self-hosted |Build |[`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) |Creates enterprise release build and submits the build to Futured App Store Connect. | -|iOS (KMP) |Self-hosted |Release |[`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) |Creates release build and submits it to App Store Connect. | +| Platform | Runner | Action | File | Description | +|:----------|:------------|:---------------|:-----------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| +| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | +| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | +| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | +| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | +| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | +| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | ## Contributors From 4f0a79b636143b3fd6b6b8c37aaf6a436d9a0569 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Thu, 19 Dec 2024 15:13:17 +0100 Subject: [PATCH 03/34] Remove detect-changes steps from iOS KMP workflows This decision should be made on trigger-workflow level. --- .../workflows/ios-kmp-selfhosted-build.yml | 88 ++++++++----------- .github/workflows/ios-kmp-selfhosted-test.yml | 65 +++++--------- 2 files changed, 57 insertions(+), 96 deletions(-) diff --git a/.github/workflows/ios-kmp-selfhosted-build.yml b/.github/workflows/ios-kmp-selfhosted-build.yml index a0298d2..b5d38bf 100644 --- a/.github/workflows/ios-kmp-selfhosted-build.yml +++ b/.github/workflows/ios-kmp-selfhosted-build.yml @@ -12,6 +12,12 @@ on: description: "Custom string that can contains values specified in your workflow file. Those values will be placed into environment variable. Example: \"CUSTOM-1: 1; CUSTOM-2: 2\"" type: string required: false + timeout_minutes: + description: "Job timeout in minutes" + type: number + required: false + default: 30 + secrets: MATCH_PASSWORD: required: true @@ -31,60 +37,36 @@ on: Private App Store Connect API issuer key for submitting build to App Store. jobs: - detect-changes: - name: Detect Changes - runs-on: ubuntu-latest - outputs: - # Matches all files which can affect iOS build, when changed - iosFiles: ${{ steps.file-changes.outputs.iosFiles }} - # Matches all files which can affect Android build, when changed - androidFiles: ${{ steps.file-changes.outputs.androidFiles }} + build: + runs-on: self-hosted + timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Detect Changes - uses: dorny/paths-filter@v2 - id: file-changes with: - base: ${{ github.ref }} - filters: | - iosFiles: - - "!(androidApp/**)" - androidFiles: - - "!(iosApp/**)" - build: - runs-on: self-hosted - timeout-minutes: 30 - needs: detect-changes - if: ${{ needs.detect-changes.outputs.iosFiles == 'true' }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - lfs: ${{ inputs.use_git_lfs }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Fastlane Beta - working-directory: iosApp - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec fastlane beta - env: - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - PR_TITLE: ${{ github.event.pull_request.title }} - APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} - APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - CUSTOM_VALUES: ${{ inputs.custom_values }} - - name: Upload IPA - uses: actions/upload-artifact@v4 - with: - name: Build.ipa - path: build_output/*.ipa - - name: Upload dSYM - uses: actions/upload-artifact@v4 - with: - name: Build.app.dSYM.zip - path: build_output/*.app.dSYM.zip + lfs: ${{ inputs.use_git_lfs }} + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Fastlane Beta + working-directory: iosApp + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + bundle exec fastlane beta + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + PR_TITLE: ${{ github.event.pull_request.title }} + APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} + APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} + APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} + CUSTOM_VALUES: ${{ inputs.custom_values }} + - name: Upload IPA + uses: actions/upload-artifact@v4 + with: + name: Build.ipa + path: build_output/*.ipa + - name: Upload dSYM + uses: actions/upload-artifact@v4 + with: + name: Build.app.dSYM.zip + path: build_output/*.app.dSYM.zip diff --git a/.github/workflows/ios-kmp-selfhosted-test.yml b/.github/workflows/ios-kmp-selfhosted-test.yml index b4bc641..1b16c23 100644 --- a/.github/workflows/ios-kmp-selfhosted-test.yml +++ b/.github/workflows/ios-kmp-selfhosted-test.yml @@ -12,52 +12,31 @@ on: description: "Custom string that can contains values specified in your workflow file. Those values will be placed into environment variable. Example: \"CUSTOM-1: 1; CUSTOM-2: 2\"" type: string required: false - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + timeout_minutes: + description: "Job timeout in minutes" + type: number + required: false + default: 30 jobs: - detect-changes: - name: Detect Changes - runs-on: ubuntu-latest - outputs: - # Matches all files which can affect iOS build, when changed - iosFiles: ${{ steps.file-changes.outputs.iosFiles }} - # Matches all files which can affect Android build, when changed - androidFiles: ${{ steps.file-changes.outputs.androidFiles }} + test: + name: Test + runs-on: self-hosted + timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: file-changes with: - filters: | - iosFiles: - - "!(androidApp/**)" - androidFiles: - - "!(iosApp/**)" - test: - runs-on: self-hosted - timeout-minutes: 30 - needs: detect-changes - if: ${{ needs.detect-changes.outputs.iosFiles == 'true' }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - lfs: ${{ inputs.use_git_lfs }} - fetch-depth: 0 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Fastlane Test - working-directory: iosApp - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec fastlane test - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CUSTOM_VALUES: ${{ inputs.custom_values }} + lfs: ${{ inputs.use_git_lfs }} + fetch-depth: 0 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Fastlane Test + working-directory: iosApp + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + bundle exec fastlane test + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CUSTOM_VALUES: ${{ inputs.custom_values }} From 52bbfb24e5202bbcd2fbc96a6b367ed25f309114 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Thu, 19 Dec 2024 15:44:23 +0100 Subject: [PATCH 04/34] Add android-cloud-check.yml workflow --- .github/workflows/android-cloud-check.yml | 54 +++++++++++++++++++++++ README.md | 29 ++++++------ 2 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/android-cloud-check.yml diff --git a/.github/workflows/android-cloud-check.yml b/.github/workflows/android-cloud-check.yml new file mode 100644 index 0000000..dfecfdd --- /dev/null +++ b/.github/workflows/android-cloud-check.yml @@ -0,0 +1,54 @@ +name: Android Pull Request Check + +on: + workflow_call: + inputs: + TIMEOUT_MINUTES: + description: "Job timeout in minutes" + required: false + type: number + default: 30 + LINT_GRADLE_TASKS: + description: "A Gradle task(s) for executing lint check, for example `lintCheck lintRelease`" + required: true + type: string + TEST_GRADLE_TASKS: + description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" + required: true + type: string + +jobs: + test: + name: Lint & Tests + runs-on: ubuntu-latest + timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Run Lint Check + shell: bash + run: ./gradlew --continue ${{ inputs.LINT_GRADLE_TASKS }} + - name: Run Unit Tests + shell: bash + run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} + - name: Danger action + uses: MeilCli/danger-action@v2 + continue-on-error: true + with: + plugins_file: 'Gemfile' + danger_file: 'Dangerfile' + danger_id: 'danger-pr' + env: + # The secrets.GITHUB_TOKEN is implicitly provided by trigger workflow + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 3f8cf3c..de7a4fe 100644 --- a/README.md +++ b/README.md @@ -23,20 +23,21 @@ All the available reusable workflows are listed in the following table. ### Available workflows -| Platform | Runner | Action | File | Description | -|:----------|:------------|:---------------|:-----------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| -| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | -| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | -| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | -| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | -| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | -| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| Platform | Runner | Action | File | Description | +|:---------------|:------------|:--------------------|:-----------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| +| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | +| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | +| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | +| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | +| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | +| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | ## Contributors From a7e8faf738edb0ec138fe67f18cac755130de9f2 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 10:08:51 +0100 Subject: [PATCH 05/34] Add android-cloud-release-firebaseAppDistribution.yml workflow --- ...-cloud-release-firebaseAppDistribution.yml | 119 ++++++++++++++++++ README.md | 31 ++--- 2 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/android-cloud-release-firebaseAppDistribution.yml diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml new file mode 100644 index 0000000..c19240e --- /dev/null +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -0,0 +1,119 @@ +name: Android Release to Firebase App Distribution + +on: + workflow_call: + inputs: + TIMEOUT_MINUTES: + description: "Job timeout in minutes" + required: false + type: number + default: 30 + VERSION_NAME: + description: "Version name" + required: false + type: string + default: '1.X.X-snapshot' + BUILD_NUMBER_OFFSET: + description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." + required: false + type: number + default: 0 + KMP_FLAVOR: + description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects". + required: false + type: string + default: 'test' + APP_DISTRIBUTION_GROUPS: + description: "Comma-separated list of app distribution group IDs" + required: true + type: string + TEST_GRADLE_TASKS: + description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" + required: true + type: string + BUNDLE_GRADLE_TASK: + description: "A Gradle task for assembling app bundle, for example `bundleEnterprise`" + required: true + type: string + UPLOAD_GRADLE_TASK: + description: "A Gradle task for uploading APK, for example `appDistributionUploadEnterprise`" + required: true + type: string + SIGNING_KEYSTORE_PATH: + description: "Path to keystore for signing of universal APK. Example: `keystore/debug.jks' or 'androidApp/signing/debug.keystore'." + required: true + type: string + SIGNING_KEYSTORE_PASSWORD: + description: "Password to provided keystore" + required: true + type: string + SIGNING_KEY_ALIAS: + description: "Alias of the signing key in the provided keystore" + required: true + type: string + SIGNING_KEY_PASSWORD: + description: "Password to the key in the provided keystore" + required: true + type: string + secrets: + APP_DISTRIBUTION_SERVICE_ACCOUNT: + required: true + description: "Firebase App Distribution Service Account JSON key" + +jobs: + build: + name: Enterprise Build + runs-on: [ ubuntu-latest ] + timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} + env: + FIREBASE_CREDENTIALS_FILE: firebase_credentials.json + BUNDLETOOL_URL: https://github.com/google/bundletool/releases/download/1.17.2/bundletool-all-1.17.2.jar + EXCLUDE_AAB_FILTER: .*intermediate + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Prepare Environment + run: | + echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV + echo "VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + - name: Run Unit tests + shell: bash + run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} + - name: Generate Artifacts (AAB and APK) + id: artifacts + shell: bash + run: | + ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor=$KMP_FLAVOR + BUNDLE_FILE=$(find . -name '*.aab' | grep -v '.*intermediate') + + wget -O bundletool.jar ${{ env.BUNDLETOOL_URL }} + java -jar bundletool.jar build-apks \ + --bundle $BUNDLE_FILE \ + --output universal.apks \ + --mode universal \ + --ks ${{ inputs.SIGNING_KEYSTORE_PATH }} + --ks-pass pass:${{ inputs.SIGNING_KEYSTORE_PASSWORD }} \ + --ks-key-alias ${{ inputs.SIGNING_KEY_ALIAS }} + --key-pass pass:${{ inputs.SIGNING_KEY_PASSWORD }} + unzip universal.apks -d universal_apk + UNIVERSAL_APK_FILE=$(find universal_apk/ -name '*.apk') + + echo "bundle_file=$BUNDLE_FILE" >> $GITHUB_OUTPUT + echo "universal_apk_file=$UNIVERSAL_APK_FILE" >> $GITHUB_OUTPUT + - name: Upload to Firebase App Distribution + shell: bash + run: | + echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > $FIREBASE_CREDENTIALS_FILE + ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ + --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ + --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" + --artifactType="APK" \ + --artifactPath="${{ steps.artifacts.outputs.universal_apk_file }}" diff --git a/README.md b/README.md index de7a4fe..d90573a 100644 --- a/README.md +++ b/README.md @@ -23,21 +23,22 @@ All the available reusable workflows are listed in the following table. ### Available workflows -| Platform | Runner | Action | File | Description | -|:---------------|:------------|:--------------------|:-----------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| -| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | -| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | -| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | -| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | -| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | -| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | -| Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | +| Platform | Runner | Action | File | Description | +|:---------------|:------------|:--------------------|:-----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| +| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | +| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | +| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | +| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | +| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | +| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | +| Android (+KMP) | Cloud | QA Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Releases QA Snapshot build to Firebase App Distribution. | ## Contributors From acb8c880976db7da05fc1f02ea88a9be29447ace Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 10:34:28 +0100 Subject: [PATCH 06/34] Add JAVA_VERSION and JAVA_DISTRIBUTION inputs to android workflows --- .github/workflows/android-cloud-check.yml | 14 ++++++++++++-- ...droid-cloud-release-firebaseAppDistribution.yml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-cloud-check.yml b/.github/workflows/android-cloud-check.yml index dfecfdd..db86c5f 100644 --- a/.github/workflows/android-cloud-check.yml +++ b/.github/workflows/android-cloud-check.yml @@ -16,6 +16,16 @@ on: description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" required: true type: string + JAVA_VERSION: + description: "Java version to use" + required: false + type: string + default: '17' + JAVA_DISTRIBUTION: + description: "Java distribution to use" + required: false + type: string + default: 'zulu' jobs: test: @@ -32,8 +42,8 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: 'zulu' - java-version: '17' + java-version: ${{ inputs.JAVA_VERSION }} + distribution: ${{ inputs.JAVA_DISTRIBUTION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - name: Run Lint Check diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index c19240e..5b55ab3 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -55,6 +55,16 @@ on: description: "Password to the key in the provided keystore" required: true type: string + JAVA_VERSION: + description: "Java version to use" + required: false + type: string + default: '17' + JAVA_DISTRIBUTION: + description: "Java distribution to use" + required: false + type: string + default: 'zulu' secrets: APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true @@ -75,8 +85,8 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - distribution: 'zulu' - java-version: '17' + java-version: ${{ inputs.JAVA_VERSION }} + distribution: ${{ inputs.JAVA_DISTRIBUTION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment From 16d19bfc9c8f3b401dfe3504f9ef9a68ddaf5425 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 10:43:20 +0100 Subject: [PATCH 07/34] Reorder workflow inputs --- .github/workflows/android-cloud-check.yml | 13 ++++--- ...-cloud-release-firebaseAppDistribution.yml | 39 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/android-cloud-check.yml b/.github/workflows/android-cloud-check.yml index db86c5f..4c03885 100644 --- a/.github/workflows/android-cloud-check.yml +++ b/.github/workflows/android-cloud-check.yml @@ -3,11 +3,7 @@ name: Android Pull Request Check on: workflow_call: inputs: - TIMEOUT_MINUTES: - description: "Job timeout in minutes" - required: false - type: number - default: 30 + ## Required Inputs LINT_GRADLE_TASKS: description: "A Gradle task(s) for executing lint check, for example `lintCheck lintRelease`" required: true @@ -16,6 +12,13 @@ on: description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" required: true type: string + + ## Optional Inputs + TIMEOUT_MINUTES: + description: "Job timeout in minutes" + required: false + type: number + default: 30 JAVA_VERSION: description: "Java version to use" required: false diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 5b55ab3..c42e562 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -3,30 +3,15 @@ name: Android Release to Firebase App Distribution on: workflow_call: inputs: - TIMEOUT_MINUTES: - description: "Job timeout in minutes" - required: false - type: number - default: 30 + ## Required Inputs VERSION_NAME: - description: "Version name" - required: false + description: "Version name. Example: '1.X.X-snapshot'" + required: true type: string - default: '1.X.X-snapshot' BUILD_NUMBER_OFFSET: description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." - required: false - type: number - default: 0 - KMP_FLAVOR: - description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects". - required: false - type: string - default: 'test' - APP_DISTRIBUTION_GROUPS: - description: "Comma-separated list of app distribution group IDs" required: true - type: string + type: number TEST_GRADLE_TASKS: description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" required: true @@ -55,6 +40,22 @@ on: description: "Password to the key in the provided keystore" required: true type: string + APP_DISTRIBUTION_GROUPS: + description: "Comma-separated list of app distribution group IDs" + required: true + type: string + + ## Optional Inputs + KMP_FLAVOR: + description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects". + required: false + type: string + default: 'test' + TIMEOUT_MINUTES: + description: "Job timeout in minutes" + required: false + type: number + default: 30 JAVA_VERSION: description: "Java version to use" required: false From 8c1e243af3289c34de7a804f3bc1f19ccf34d381 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 13:45:51 +0100 Subject: [PATCH 08/34] Remove typo in YAML syntax --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index c42e562..727cd76 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -47,7 +47,7 @@ on: ## Optional Inputs KMP_FLAVOR: - description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects". + description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects" required: false type: string default: 'test' From 172c9a26c2b19ec99ff63edbf267a76547b620e2 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 14:03:34 +0100 Subject: [PATCH 09/34] Fix command line breaks --- .../android-cloud-release-firebaseAppDistribution.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 727cd76..f6d68da 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -110,9 +110,9 @@ jobs: --bundle $BUNDLE_FILE \ --output universal.apks \ --mode universal \ - --ks ${{ inputs.SIGNING_KEYSTORE_PATH }} + --ks ${{ inputs.SIGNING_KEYSTORE_PATH }} \ --ks-pass pass:${{ inputs.SIGNING_KEYSTORE_PASSWORD }} \ - --ks-key-alias ${{ inputs.SIGNING_KEY_ALIAS }} + --ks-key-alias ${{ inputs.SIGNING_KEY_ALIAS }} \ --key-pass pass:${{ inputs.SIGNING_KEY_PASSWORD }} unzip universal.apks -d universal_apk UNIVERSAL_APK_FILE=$(find universal_apk/ -name '*.apk') @@ -125,6 +125,6 @@ jobs: echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > $FIREBASE_CREDENTIALS_FILE ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ - --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" + --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ --artifactType="APK" \ --artifactPath="${{ steps.artifacts.outputs.universal_apk_file }}" From 38ce7af9aadb8c0f6bc776d287c0639a4063704a Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 14:43:28 +0100 Subject: [PATCH 10/34] Move signing credentials from inputs to secrets --- ...-cloud-release-firebaseAppDistribution.yml | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index f6d68da..71acadb 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -28,18 +28,6 @@ on: description: "Path to keystore for signing of universal APK. Example: `keystore/debug.jks' or 'androidApp/signing/debug.keystore'." required: true type: string - SIGNING_KEYSTORE_PASSWORD: - description: "Password to provided keystore" - required: true - type: string - SIGNING_KEY_ALIAS: - description: "Alias of the signing key in the provided keystore" - required: true - type: string - SIGNING_KEY_PASSWORD: - description: "Password to the key in the provided keystore" - required: true - type: string APP_DISTRIBUTION_GROUPS: description: "Comma-separated list of app distribution group IDs" required: true @@ -66,7 +54,17 @@ on: required: false type: string default: 'zulu' + secrets: + SIGNING_KEYSTORE_PASSWORD: + description: "Password to provided keystore" + required: true + SIGNING_KEY_ALIAS: + description: "Alias of the signing key in the provided keystore" + required: true + SIGNING_KEY_PASSWORD: + description: "Password to the key in the provided keystore" + required: true APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true description: "Firebase App Distribution Service Account JSON key" @@ -100,6 +98,10 @@ jobs: run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} - name: Generate Artifacts (AAB and APK) id: artifacts + env: + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} + ANDROID_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + ANDROID_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} shell: bash run: | ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor=$KMP_FLAVOR @@ -111,9 +113,9 @@ jobs: --output universal.apks \ --mode universal \ --ks ${{ inputs.SIGNING_KEYSTORE_PATH }} \ - --ks-pass pass:${{ inputs.SIGNING_KEYSTORE_PASSWORD }} \ - --ks-key-alias ${{ inputs.SIGNING_KEY_ALIAS }} \ - --key-pass pass:${{ inputs.SIGNING_KEY_PASSWORD }} + --ks-pass pass:${{ secrets.SIGNING_KEYSTORE_PASSWORD }} \ + --ks-key-alias ${{ secrets.SIGNING_KEY_ALIAS }} \ + --key-pass pass:${{ secrets.SIGNING_KEY_PASSWORD }} unzip universal.apks -d universal_apk UNIVERSAL_APK_FILE=$(find universal_apk/ -name '*.apk') From 90413b19f3984126f26f2cadff97e670f6f941a4 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 20 Dec 2024 15:08:03 +0100 Subject: [PATCH 11/34] Add android-cloud-release-googlePlay.yml --- .../android-cloud-release-googlePlay.yml | 119 ++++++++++++++++++ README.md | 33 ++--- 2 files changed, 136 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/android-cloud-release-googlePlay.yml diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml new file mode 100644 index 0000000..4e0b01b --- /dev/null +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -0,0 +1,119 @@ +name: Android Release to Firebase App Distribution + +on: + workflow_call: + inputs: + ## Required Inputs + VERSION_NAME: + description: "Release version name" + required: true + type: string + BUILD_NUMBER_OFFSET: + description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." + required: true + type: number + BUNDLE_GRADLE_TASK: + description: "A Gradle task for assembling app bundle, for example `bundleRelease`" + required: true + type: string + SIGNING_KEYSTORE_PATH: + description: "Path to keystore for signing of universal APK. Example: `keystore/debug.jks' or 'androidApp/signing/debug.keystore'." + required: true + type: string + GOOGLE_PLAY_APPLICATION_ID: + description: "Google Play applicationId" + required: true + type: string + GOOGLE_PLAY_WHATSNEW_DIRECTORY: + description: "Path to directory with changelog files" + required: true + type: string + + ## Optional Inputs + KMP_FLAVOR: + description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects" + required: false + type: string + default: 'test' + CHANGES_NOT_SENT_FOR_REVIEW: + description: 'A changesNotSentForReview Google Play flag. Enable when last google review failed, disable when last review was successful.' + type: boolean + required: false + default: false + TIMEOUT_MINUTES: + description: "Job timeout in minutes" + required: false + type: number + default: 30 + JAVA_VERSION: + description: "Java version to use" + required: false + type: string + default: '17' + JAVA_DISTRIBUTION: + description: "Java distribution to use" + required: false + type: string + default: 'zulu' + + secrets: + SIGNING_KEYSTORE_PASSWORD: + description: "Password to provided keystore" + required: true + SIGNING_KEY_ALIAS: + description: "Alias of the signing key in the provided keystore" + required: true + SIGNING_KEY_PASSWORD: + description: "Password to the key in the provided keystore" + required: true + GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT: + required: true + description: 'Google Play service account JSON' + +jobs: + build: + name: Release Build + runs-on: [ ubuntu-latest ] + timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} + env: + EXCLUDE_AAB_FILTER: .*intermediate + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: ${{ inputs.JAVA_VERSION }} + distribution: ${{ inputs.JAVA_DISTRIBUTION }} + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Prepare Environment + run: | + echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV + echo "VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + - name: Generate Artifacts (AAB) + id: artifacts + env: + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} + ANDROID_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + ANDROID_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + shell: bash + run: | + ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor=$KMP_FLAVOR + BUNDLE_FILE=$(find . -name '*.aab' | grep -v '.*intermediate') + MAPPING_FILE=$(find . -name mapping.txt) + + echo "bundle_file=$BUNDLE_FILE" >> $GITHUB_OUTPUT + echo "mapping_file=$MAPPING_FILE" >> $GITHUB_OUTPUT + - name: Upload to Google Play + uses: r0adkll/upload-google-play@v1.1.1 + with: + serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT }} + packageName: ${{ inputs.GOOGLE_PLAY_APPLICATION_ID }} + releaseFiles: ${{ steps.artifacts.outputs.bundle_file }} + track: internal + status: draft + whatsNewDirectory: ${{ inputs.GOOGLE_PLAY_WHATSNEW_DIRECTORY }} + mappingFile: ${{ steps.artifacts.outputs.mapping_file }} + changesNotSentForReview: ${{ inputs.CHANGES_NOT_SENT_FOR_REVIEW }} \ No newline at end of file diff --git a/README.md b/README.md index d90573a..a5f9df1 100644 --- a/README.md +++ b/README.md @@ -23,22 +23,23 @@ All the available reusable workflows are listed in the following table. ### Available workflows -| Platform | Runner | Action | File | Description | -|:---------------|:------------|:--------------------|:-----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| -| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | -| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | -| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | -| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | -| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | -| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | -| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | -| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | -| Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | -| Android (+KMP) | Cloud | QA Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Releases QA Snapshot build to Firebase App Distribution. | +| Platform | Runner | Action | File | Description | +|:---------------|:------------|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| +| Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | +| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | +| iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | +| iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS | Cloud | Test | [`ios-cloud-test`](.github/workflows/ios-cloud-test.yml) | Lints and tests the PR. | +| iOS | Cloud | Build | [`ios-cloud-build`](.github/workflows/ios-cloud-build.yml) | Creates enterprise release build and submits the build to App Center. | +| iOS | Cloud | Release | [`ios-cloud-release`](.github/workflows/ios-cloud-release.yml) | Creates release build and submits it to App Store Connect. | +| iOS (KMP) | Self-hosted | Test | [`ios-kmp-selfhosted-test`](.github/workflows/ios-kmp-selfhosted-test.yml) | Lints and tests the PR. | +| iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | +| iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | +| Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | +| Android (+KMP) | Cloud | Firebase Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Releases QA Snapshot build to Firebase App Distribution. | +| Android (+KMP) | Cloud | Google Play Release | [`android-cloud-release-googlePlay`](.github/workflows/android-cloud-release-googlePlay.yml) | Publishes release build to Google Play. | ## Contributors From 6adfde188c15e9e909bfc064bb6720d2bffc502b Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 12:52:59 +0100 Subject: [PATCH 12/34] Add ANDROID_ prefix to build number and version name env variables --- .../android-cloud-release-firebaseAppDistribution.yml | 4 ++-- .github/workflows/android-cloud-release-googlePlay.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 71acadb..a7153cf 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -90,8 +90,8 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV - echo "VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - name: Run Unit tests shell: bash diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 4e0b01b..98d4cf5 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -89,8 +89,8 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV - echo "VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - name: Generate Artifacts (AAB) id: artifacts From 4d5121744a1de97a7d73aaafa769653a432969e5 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 13:01:48 +0100 Subject: [PATCH 13/34] Set default KMP_FLAVOR to `prod` for Google Play release workflow --- .github/workflows/android-cloud-release-googlePlay.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 98d4cf5..5ca5e60 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -34,7 +34,7 @@ on: description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects" required: false type: string - default: 'test' + default: 'prod' CHANGES_NOT_SENT_FOR_REVIEW: description: 'A changesNotSentForReview Google Play flag. Enable when last google review failed, disable when last review was successful.' type: boolean From 0472275ea7163000cbdd98c9e47ca5506dc3c504 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 16:31:56 +0100 Subject: [PATCH 14/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5f9df1..db46b23 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ All the available reusable workflows are listed in the following table. | iOS (KMP) | Self-hosted | Build | [`ios-kmp-selfhosted-build`](.github/workflows/ios-kmp-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | | iOS (KMP) | Self-hosted | Release | [`ios-kmp-selfhosted-release`](.github/workflows/ios-kmp-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | | Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | -| Android (+KMP) | Cloud | Firebase Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Releases QA Snapshot build to Firebase App Distribution. | +| Android (+KMP) | Cloud | Firebase Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Publishes QA Snapshot build to Firebase App Distribution. | | Android (+KMP) | Cloud | Google Play Release | [`android-cloud-release-googlePlay`](.github/workflows/android-cloud-release-googlePlay.yml) | Publishes release build to Google Play. | ## Contributors From 88465c5989c88daa3c4dd30c90215deb98146482 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 16:32:07 +0100 Subject: [PATCH 15/34] Add CUSTOM_SECRETS and CUSTOM_SECRETS_FILE inputs to android publish workflows --- .../android-cloud-release-firebaseAppDistribution.yml | 9 +++++++++ .../workflows/android-cloud-release-googlePlay.yml | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index a7153cf..6d8371c 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -32,6 +32,11 @@ on: description: "Comma-separated list of app distribution group IDs" required: true type: string + CUSTOM_SECRETS_FILE: + description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + required: false + type: string + default: secrets.properties ## Optional Inputs KMP_FLAVOR: @@ -68,6 +73,9 @@ on: APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true description: "Firebase App Distribution Service Account JSON key" + CUSTOM_SECRETS: + required: false + description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." jobs: build: @@ -93,6 +101,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + echo "${{ secrets.CUSTOM_SECRETS }}" > $${{ inputs.CUSTOM_SECRETS_FILE }} - name: Run Unit tests shell: bash run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 5ca5e60..e132e14 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -55,6 +55,11 @@ on: required: false type: string default: 'zulu' + CUSTOM_SECRETS_FILE: + description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + required: false + type: string + default: secrets.properties secrets: SIGNING_KEYSTORE_PASSWORD: @@ -68,7 +73,10 @@ on: required: true GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT: required: true - description: 'Google Play service account JSON' + description: "Google Play service account JSON" + CUSTOM_SECRETS: + required: false + description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." jobs: build: @@ -92,6 +100,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + echo "${{ secrets.CUSTOM_SECRETS }}" > $${{ inputs.CUSTOM_SECRETS_FILE }} - name: Generate Artifacts (AAB) id: artifacts env: From fddf2f9b441da71b67f4edc143fda2cb49ee6150 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 16:50:48 +0100 Subject: [PATCH 16/34] Fix double dollar sign typo --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- .github/workflows/android-cloud-release-googlePlay.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 6d8371c..eef62ba 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -101,7 +101,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - echo "${{ secrets.CUSTOM_SECRETS }}" > $${{ inputs.CUSTOM_SECRETS_FILE }} + echo "${{ secrets.CUSTOM_SECRETS }}" > ${{ inputs.CUSTOM_SECRETS_FILE }} - name: Run Unit tests shell: bash run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index e132e14..c42cdaf 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -100,7 +100,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - echo "${{ secrets.CUSTOM_SECRETS }}" > $${{ inputs.CUSTOM_SECRETS_FILE }} + echo "${{ secrets.CUSTOM_SECRETS }}" > ${{ inputs.CUSTOM_SECRETS_FILE }} - name: Generate Artifacts (AAB) id: artifacts env: From 18bf890dfb47b9fcebf62a87ff4c46f627e06502 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 6 Jan 2025 16:50:48 +0100 Subject: [PATCH 17/34] Rename secrets inputs --- ...droid-cloud-release-firebaseAppDistribution.yml | 14 +++++++------- .../workflows/android-cloud-release-googlePlay.yml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index eef62ba..fcb3686 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -32,11 +32,6 @@ on: description: "Comma-separated list of app distribution group IDs" required: true type: string - CUSTOM_SECRETS_FILE: - description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." - required: false - type: string - default: secrets.properties ## Optional Inputs KMP_FLAVOR: @@ -44,6 +39,11 @@ on: required: false type: string default: 'test' + SECRET_PROPERTIES_FILE: + description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + required: false + type: string + default: secrets.properties TIMEOUT_MINUTES: description: "Job timeout in minutes" required: false @@ -73,7 +73,7 @@ on: APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true description: "Firebase App Distribution Service Account JSON key" - CUSTOM_SECRETS: + SECRET_PROPERTIES: required: false description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." @@ -101,7 +101,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - echo "${{ secrets.CUSTOM_SECRETS }}" > ${{ inputs.CUSTOM_SECRETS_FILE }} + echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Run Unit tests shell: bash run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index c42cdaf..3f1e3b1 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -35,6 +35,11 @@ on: required: false type: string default: 'prod' + SECRET_PROPERTIES_FILE: + description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + required: false + type: string + default: secrets.properties CHANGES_NOT_SENT_FOR_REVIEW: description: 'A changesNotSentForReview Google Play flag. Enable when last google review failed, disable when last review was successful.' type: boolean @@ -55,11 +60,6 @@ on: required: false type: string default: 'zulu' - CUSTOM_SECRETS_FILE: - description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." - required: false - type: string - default: secrets.properties secrets: SIGNING_KEYSTORE_PASSWORD: @@ -74,7 +74,7 @@ on: GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT: required: true description: "Google Play service account JSON" - CUSTOM_SECRETS: + SECRET_PROPERTIES: required: false description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." @@ -100,7 +100,7 @@ jobs: echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV - echo "${{ secrets.CUSTOM_SECRETS }}" > ${{ inputs.CUSTOM_SECRETS_FILE }} + echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Generate Artifacts (AAB) id: artifacts env: From 22bbec01bd6139d61dc353512d445f30aba617eb Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 10 Jan 2025 13:08:54 +0100 Subject: [PATCH 18/34] Rename android-cloud-release-googlePlay.yml workflow --- .github/workflows/android-cloud-release-googlePlay.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 3f1e3b1..b14647d 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -1,4 +1,4 @@ -name: Android Release to Firebase App Distribution +name: Android Release to Google Play on: workflow_call: From 9ad7c0e8c3d7653e940b7f0e17013cad46745415 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 10 Jan 2025 15:17:19 +0100 Subject: [PATCH 19/34] Fix shellcheck issues: quoting --- ...oid-cloud-release-firebaseAppDistribution.yml | 16 ++++++++-------- .../android-cloud-release-googlePlay.yml | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index fcb3686..438786d 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -98,9 +98,9 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV - echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV - echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> "$GITHUB_ENV" + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> "$GITHUB_ENV" + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> "$GITHUB_ENV" echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Run Unit tests shell: bash @@ -113,12 +113,12 @@ jobs: ANDROID_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} shell: bash run: | - ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor=$KMP_FLAVOR + ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor="$KMP_FLAVOR" BUNDLE_FILE=$(find . -name '*.aab' | grep -v '.*intermediate') wget -O bundletool.jar ${{ env.BUNDLETOOL_URL }} java -jar bundletool.jar build-apks \ - --bundle $BUNDLE_FILE \ + --bundle "$BUNDLE_FILE" \ --output universal.apks \ --mode universal \ --ks ${{ inputs.SIGNING_KEYSTORE_PATH }} \ @@ -128,12 +128,12 @@ jobs: unzip universal.apks -d universal_apk UNIVERSAL_APK_FILE=$(find universal_apk/ -name '*.apk') - echo "bundle_file=$BUNDLE_FILE" >> $GITHUB_OUTPUT - echo "universal_apk_file=$UNIVERSAL_APK_FILE" >> $GITHUB_OUTPUT + echo "bundle_file=$BUNDLE_FILE" >> "$GITHUB_OUTPUT" + echo "universal_apk_file=$UNIVERSAL_APK_FILE" >> "$GITHUB_OUTPUT" - name: Upload to Firebase App Distribution shell: bash run: | - echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > $FIREBASE_CREDENTIALS_FILE + echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index b14647d..3b7c195 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -97,9 +97,9 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> $GITHUB_ENV - echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> $GITHUB_ENV - echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> $GITHUB_ENV + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> "$GITHUB_ENV" + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> "$GITHUB_ENV" + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> "$GITHUB_ENV" echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Generate Artifacts (AAB) id: artifacts @@ -109,12 +109,12 @@ jobs: ANDROID_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} shell: bash run: | - ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor=$KMP_FLAVOR + ./gradlew ${{ inputs.BUNDLE_GRADLE_TASK }} -P buildkonfig.flavor="$KMP_FLAVOR" BUNDLE_FILE=$(find . -name '*.aab' | grep -v '.*intermediate') MAPPING_FILE=$(find . -name mapping.txt) - echo "bundle_file=$BUNDLE_FILE" >> $GITHUB_OUTPUT - echo "mapping_file=$MAPPING_FILE" >> $GITHUB_OUTPUT + echo "bundle_file=$BUNDLE_FILE" >> "$GITHUB_OUTPUT" + echo "mapping_file=$MAPPING_FILE" >> "$GITHUB_OUTPUT" - name: Upload to Google Play uses: r0adkll/upload-google-play@v1.1.1 with: From beaf069be5083fbe63389837a224683456164187 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 10 Jan 2025 15:20:39 +0100 Subject: [PATCH 20/34] Fix shellcheck issues: env redirects --- .../android-cloud-release-firebaseAppDistribution.yml | 9 ++++++--- .github/workflows/android-cloud-release-googlePlay.yml | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 438786d..4282730 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -98,9 +98,12 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> "$GITHUB_ENV" - echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> "$GITHUB_ENV" - echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> "$GITHUB_ENV" + { + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))"; + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}"; + "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" + } >> "$GITHUB_ENV" + echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Run Unit tests shell: bash diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 3b7c195..a25e5e4 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -97,9 +97,12 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Prepare Environment run: | - echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))" >> "$GITHUB_ENV" - echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}" >> "$GITHUB_ENV" - echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" >> "$GITHUB_ENV" + { + echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))"; + echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}"; + "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" + } >> "$GITHUB_ENV" + echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Generate Artifacts (AAB) id: artifacts From 43bed5426024c288fcb843fa31b88fe6f34efb1a Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Fri, 10 Jan 2025 15:31:44 +0100 Subject: [PATCH 21/34] Fix shellcheck issues: env redirects --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- .github/workflows/android-cloud-release-googlePlay.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 4282730..d96121d 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -101,7 +101,7 @@ jobs: { echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))"; echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}"; - "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" } >> "$GITHUB_ENV" echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index a25e5e4..b33c496 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -100,7 +100,7 @@ jobs: { echo "ANDROID_BUILD_NUMBER=$((GITHUB_RUN_NUMBER + ${{ inputs.BUILD_NUMBER_OFFSET}} ))"; echo "ANDROID_VERSION_NAME=${{ inputs.VERSION_NAME }}"; - "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" + echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" } >> "$GITHUB_ENV" echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} From 05576ef7cb705f8713b0a7fa2fd392bfa20f6f50 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 14:02:25 +0100 Subject: [PATCH 22/34] Quote experiment --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index d96121d..a8e8898 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -136,7 +136,7 @@ jobs: - name: Upload to Firebase App Distribution shell: bash run: | - echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" + echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > $FIREBASE_CREDENTIALS_FILE ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ From 17ec57ce03d63b8641c4430367d475b8c34f0142 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 14:46:09 +0100 Subject: [PATCH 23/34] Quote experiment --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index a8e8898..b3a76d5 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -136,7 +136,7 @@ jobs: - name: Upload to Firebase App Distribution shell: bash run: | - echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > $FIREBASE_CREDENTIALS_FILE + echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > "$FIREBASE_CREDENTIALS_FILE" ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ From 306310ef6e1e16a0322149d015376e100752fc01 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 15:07:03 +0100 Subject: [PATCH 24/34] Revert "Quote experiment" This reverts commit 17ec57ce03d63b8641c4430367d475b8c34f0142. --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index b3a76d5..a8e8898 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -136,7 +136,7 @@ jobs: - name: Upload to Firebase App Distribution shell: bash run: | - echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > "$FIREBASE_CREDENTIALS_FILE" + echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > $FIREBASE_CREDENTIALS_FILE ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ From 11f0a6479a016a7ec11d0d14faf5165084c5b00a Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 15:07:03 +0100 Subject: [PATCH 25/34] Revert "Quote experiment" This reverts commit 05576ef7cb705f8713b0a7fa2fd392bfa20f6f50. --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index a8e8898..d96121d 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -136,7 +136,7 @@ jobs: - name: Upload to Firebase App Distribution shell: bash run: | - echo ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} > $FIREBASE_CREDENTIALS_FILE + echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ From 028f51a709aa1650576f57e641062da4bacce7b0 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 15:07:47 +0100 Subject: [PATCH 26/34] Dump firebase credentials to file as part of Prepare Environment step --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index d96121d..06d7765 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -105,6 +105,7 @@ jobs: } >> "$GITHUB_ENV" echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} + echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" - name: Run Unit tests shell: bash run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} @@ -136,7 +137,6 @@ jobs: - name: Upload to Firebase App Distribution shell: bash run: | - echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" ./gradlew ${{ inputs.UPLOAD_GRADLE_TASK }} \ --serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \ --groups="${{ inputs.APP_DISTRIBUTION_GROUPS }}" \ From 2a7133526fe47d0e6f548ff208ae6c9194e294f8 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 16:12:14 +0100 Subject: [PATCH 27/34] Update firebase app distribution workflow: echo secrets with single quotes. --- .../android-cloud-release-firebaseAppDistribution.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 06d7765..7d4d0e2 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -104,8 +104,8 @@ jobs: echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" } >> "$GITHUB_ENV" - echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} - echo "${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}" > "$FIREBASE_CREDENTIALS_FILE" + echo '${{ secrets.SECRET_PROPERTIES }}' > ${{ inputs.SECRET_PROPERTIES_FILE }} + echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > "$FIREBASE_CREDENTIALS_FILE" - name: Run Unit tests shell: bash run: ./gradlew --continue ${{ inputs.TEST_GRADLE_TASKS }} From 724eb22eda9495c63104f53d9739e0f780b343a3 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 16:30:23 +0100 Subject: [PATCH 28/34] Echo all secrets with single quote --- .github/workflows/android-cloud-release-googlePlay.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index b33c496..7e96a4e 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -103,7 +103,7 @@ jobs: echo "KMP_FLAVOR=${{ inputs.KMP_FLAVOR }}" } >> "$GITHUB_ENV" - echo "${{ secrets.SECRET_PROPERTIES }}" > ${{ inputs.SECRET_PROPERTIES_FILE }} + echo '${{ secrets.SECRET_PROPERTIES }}' > ${{ inputs.SECRET_PROPERTIES_FILE }} - name: Generate Artifacts (AAB) id: artifacts env: @@ -128,4 +128,4 @@ jobs: status: draft whatsNewDirectory: ${{ inputs.GOOGLE_PLAY_WHATSNEW_DIRECTORY }} mappingFile: ${{ steps.artifacts.outputs.mapping_file }} - changesNotSentForReview: ${{ inputs.CHANGES_NOT_SENT_FOR_REVIEW }} \ No newline at end of file + changesNotSentForReview: ${{ inputs.CHANGES_NOT_SENT_FOR_REVIEW }} From 2b89d8a640cbcdfb07e6174834930420127bb4b9 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 17:20:51 +0100 Subject: [PATCH 29/34] Modify the type of 'changesNotSentForReview' to JSON in the Android release workflow. --- .github/workflows/android-cloud-release-googlePlay.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 7e96a4e..f40d6ee 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -128,4 +128,4 @@ jobs: status: draft whatsNewDirectory: ${{ inputs.GOOGLE_PLAY_WHATSNEW_DIRECTORY }} mappingFile: ${{ steps.artifacts.outputs.mapping_file }} - changesNotSentForReview: ${{ inputs.CHANGES_NOT_SENT_FOR_REVIEW }} + changesNotSentForReview: ${{ toJSON(inputs.CHANGES_NOT_SENT_FOR_REVIEW) }} From 1ad0c9d92725531da0bbb88b058717dd634e9597 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 17:28:07 +0100 Subject: [PATCH 30/34] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db46b23..4a4cd15 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repo contains reusable workflows. These workflows are automatically set up when creating projects using [iOS project template](https://github.com/futuredapp/iOS-project-template). -If you want to import them manually to your workflow configuration add a job like this: +If you want to import them manually, reference a reusable workflow in your trigger workflow: ```yml jobs: @@ -18,7 +18,7 @@ jobs: ``` Name the job first and choose its platform, runner and action. -Check the reusable workflow file and pass alll the required secrets to it. +Check the reusable workflow file and pass all the required secrets to it. All the available reusable workflows are listed in the following table. ### Available workflows @@ -45,7 +45,7 @@ All the available reusable workflows are listed in the following table. All contributions are welcome! -Current maintainer is [Matěj Kašpar Jirásek](https://github.com/mkj-is), . +Current maintainer is [Jakub Marek](https://github.com/jmarek41), and [Matej Semančík](https://github.com/matejsemancik), . ## License From 4eb1a3166964c056a06951990b54bdd2d5235b06 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 27 Jan 2025 17:37:26 +0100 Subject: [PATCH 31/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a4cd15..5714017 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you want to import them manually, reference a reusable workflow in your trigg ```yml jobs: {name}: - uses: futuredapp/.github/.github/workflows/{platform}-{runner}-{action}.yml@main + uses: futuredapp/.github/.github/workflows/{platform}-{runner}-{action}.yml@1.0.0 secrets: # Secrets to be passed to called workflow key: ${{ secrets.key }} From ac7e412247e4a5db1254d89cec02fa8ed73ae6a0 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Wed, 29 Jan 2025 13:20:28 +0100 Subject: [PATCH 32/34] Rename detect-changes workflow file --- ...-cloud-detect-changes.yml => kmp-cloud-detect-changes.yml} | 0 README.md | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{universal-cloud-detect-changes.yml => kmp-cloud-detect-changes.yml} (100%) diff --git a/.github/workflows/universal-cloud-detect-changes.yml b/.github/workflows/kmp-cloud-detect-changes.yml similarity index 100% rename from .github/workflows/universal-cloud-detect-changes.yml rename to .github/workflows/kmp-cloud-detect-changes.yml diff --git a/README.md b/README.md index 5714017..1eb3ae4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you want to import them manually, reference a reusable workflow in your trigg ```yml jobs: - {name}: + { name }: uses: futuredapp/.github/.github/workflows/{platform}-{runner}-{action}.yml@1.0.0 secrets: # Secrets to be passed to called workflow @@ -27,7 +27,6 @@ All the available reusable workflows are listed in the following table. |:---------------|:------------|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| | Universal | Cloud | Backup | [`universal-cloud-backup`](.github/workflows/universal-cloud-backup.yml) | Backups currently checked out ref to a remote repository. | | Universal | Self-hosted | Backup | [`universal-selfhosted-backup`](.github/workflows/universal-selfhosted-backup.yml) | Backups currently checked out ref to a remote repository. | -| Universal | Cloud | Detect Changes | [`universal-cloud-detect-changes`](.github/workflows/universal-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | | iOS | Self-hosted | Test | [`ios-selfhosted-test`](.github/workflows/ios-selfhosted-test.yml) | Lints and tests the PR. | | iOS | Self-hosted | Build | [`ios-selfhosted-build`](.github/workflows/ios-selfhosted-build.yml) | Creates enterprise release build and submits the build to Futured App Store Connect. | | iOS | Self-hosted | Release | [`ios-selfhosted-release`](.github/workflows/ios-selfhosted-release.yml) | Creates release build and submits it to App Store Connect. | @@ -40,6 +39,7 @@ All the available reusable workflows are listed in the following table. | Android (+KMP) | Cloud | Tests & Lint checks | [`android-cloud-check`](.github/workflows/android-cloud-check.yml) | Runs unit tests and lint checks on pull request. | | Android (+KMP) | Cloud | Firebase Snapshot Release | [`android-cloud-release-firebaseAppDistribution`](.github/workflows/android-cloud-release-firebaseAppDistribution.yml) | Publishes QA Snapshot build to Firebase App Distribution. | | Android (+KMP) | Cloud | Google Play Release | [`android-cloud-release-googlePlay`](.github/workflows/android-cloud-release-googlePlay.yml) | Publishes release build to Google Play. | +| KMP | Cloud | Detect Changes | [`kmp-cloud-detect-changes`](.github/workflows/kmp-cloud-detect-changes.yml) | Detects changed sources in KMP projects for conditional job execution. | ## Contributors From 42d7ff9dd7cff977e34486249ffaf678df0dadea Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Wed, 29 Jan 2025 13:45:38 +0100 Subject: [PATCH 33/34] Refactor Android cloud release workflows: Change descriptions and add defaults - Add default values for `VERSION_NAME` and `BUILD_NUMBER_OFFSET` inputs in the `android-cloud-release-firebaseAppDistribution.yml` workflow. - Make `BUILD_NUMBER_OFFSET` optional input and add default value in `android-cloud-release-googlePlay.yml` workflow. - Change `VERSION_NAME` description in `android-cloud-release-googlePlay.yml` from "Release version name" to "Build version name". - Improve descriptions for `SIGNING_KEYSTORE_PATH` and `GOOGLE_PLAY_WHATSNEW_DIRECTORY` inputs in `android-cloud-release-googlePlay.yml`. - Update `SECRET_PROPERTIES_FILE` description to clarify that it is picked up by the Secrets Gradle plugin in both workflows. - Rename `CUSTOM_SECRETS` input to `SECRET_PROPERTIES` and update description accordingly in both workflows. - Update `APP_DISTRIBUTION_SERVICE_ACCOUNT` and `GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT` descriptions in both workflows. --- ...-cloud-release-firebaseAppDistribution.yml | 24 ++++++++++--------- .../android-cloud-release-googlePlay.yml | 21 ++++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 7d4d0e2..1817357 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -4,14 +4,6 @@ on: workflow_call: inputs: ## Required Inputs - VERSION_NAME: - description: "Version name. Example: '1.X.X-snapshot'" - required: true - type: string - BUILD_NUMBER_OFFSET: - description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." - required: true - type: number TEST_GRADLE_TASKS: description: "A Gradle task(s) for executing unit tests, for example `testReleaseUnitTest` or `testDevEnterpriseUnitTest`" required: true @@ -34,13 +26,23 @@ on: type: string ## Optional Inputs + VERSION_NAME: + description: "Version name. Example: '1.X.X-snapshot'" + required: true + type: string + default: '1.X.X-snapshot' + BUILD_NUMBER_OFFSET: + description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." + required: false + type: number + default: 0 KMP_FLAVOR: description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects" required: false type: string default: 'test' SECRET_PROPERTIES_FILE: - description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + description: "A path to file that fill be populated with contents of 'SECRET_PROPERTIES' secret. This file can be picked up by Secrets Gradle plugin to embed secrets into BuildConfig." required: false type: string default: secrets.properties @@ -72,10 +74,10 @@ on: required: true APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true - description: "Firebase App Distribution Service Account JSON key" + description: "JSON key of service account with permissions to upload build to Firebase App Distribution" SECRET_PROPERTIES: required: false - description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." + description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'SECRET_PROPERTIES_FILE' input." jobs: build: diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index f40d6ee..616a39e 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -5,19 +5,15 @@ on: inputs: ## Required Inputs VERSION_NAME: - description: "Release version name" + description: "Build version name" required: true type: string - BUILD_NUMBER_OFFSET: - description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." - required: true - type: number BUNDLE_GRADLE_TASK: description: "A Gradle task for assembling app bundle, for example `bundleRelease`" required: true type: string SIGNING_KEYSTORE_PATH: - description: "Path to keystore for signing of universal APK. Example: `keystore/debug.jks' or 'androidApp/signing/debug.keystore'." + description: "Path to keystore for signing of universal APK. Example: `keystore/debug.jks' or 'androidApp/signing/debug.keystore'" required: true type: string GOOGLE_PLAY_APPLICATION_ID: @@ -25,18 +21,23 @@ on: required: true type: string GOOGLE_PLAY_WHATSNEW_DIRECTORY: - description: "Path to directory with changelog files" + description: "Path to directory with changelog files according to documentation in https://github.com/r0adkll/upload-google-play" required: true type: string ## Optional Inputs + BUILD_NUMBER_OFFSET: + description: "Build number offset. This number will be added to GITHUB_RUN_NUMBER and can be used to make corrections to build numbers." + required: false + type: number + default: 0 KMP_FLAVOR: description: "KMP Build flavor. This is optional and only required by KMP projects and can be ignored on pure Android projects" required: false type: string default: 'prod' SECRET_PROPERTIES_FILE: - description: "A path to file that fill be populated with contents of 'CUSTOM_SECRETS' secret. This file can be picked up for example by Secrets Gradle plugin to embed secrets into BuildConfig." + description: "A path to file that fill be populated with contents of 'SECRET_PROPERTIES' secret. This file can be picked up by Secrets Gradle plugin to embed secrets into BuildConfig." required: false type: string default: secrets.properties @@ -73,10 +74,10 @@ on: required: true GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT: required: true - description: "Google Play service account JSON" + description: "JSON key of service account with permissions to upload build to Google Play" SECRET_PROPERTIES: required: false - description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'CUSTOM_SECRETS_FILE' input." + description: "Custom string that contains key-value properties as secrets. Contents of this secret will be placed into file specified by 'SECRET_PROPERTIES_FILE' input." jobs: build: From ef9bdb2b7b52aec009ed877b69fe161da0114418 Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Wed, 29 Jan 2025 13:57:34 +0100 Subject: [PATCH 34/34] Fix optional field --- .../workflows/android-cloud-release-firebaseAppDistribution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 1817357..811bdcc 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -28,7 +28,7 @@ on: ## Optional Inputs VERSION_NAME: description: "Version name. Example: '1.X.X-snapshot'" - required: true + required: false type: string default: '1.X.X-snapshot' BUILD_NUMBER_OFFSET: