diff --git a/.github/workflows/android-cloud-nightly-build.yml b/.github/workflows/android-cloud-nightly-build.yml index ebe4395..0fe9365 100644 --- a/.github/workflows/android-cloud-nightly-build.yml +++ b/.github/workflows/android-cloud-nightly-build.yml @@ -91,6 +91,27 @@ on: type: string default: 'Testing' + BUILD_RUNS_ON: + description: "Runner label for the build job, for example `ubuntu-latest` (default) or `self-hosted` to build on the mac runners. Other jobs in this workflow stay on `ubuntu-latest`" + required: false + type: string + default: ubuntu-latest + SETUP_RUBY: + description: "Whether to install Ruby with ruby/setup-ruby (default). Set to false on runners whose image already ships Ruby, for example the self-hosted mac runners, where setup-ruby cannot create its tool cache" + required: false + type: boolean + default: true + ANDROID_SDK_PACKAGES: + description: "When set, installs the Android SDK in the build job (android-actions/setup-android) with these sdkmanager packages, for runners whose image has no SDK, for example `platforms;android-36 build-tools;36.0.0 platform-tools`" + required: false + type: string + default: "" + KOTLIN_NATIVE_CACHE: + description: "Caches ~/.konan/dependencies (LLVM, libffi) between runs; for KMP projects built on macOS, where the Kotlin/Native toolchain downloads them on every fresh runner" + required: false + type: boolean + default: false + secrets: APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true @@ -125,7 +146,7 @@ jobs: cache_key_prefix: ${{ inputs.CHANGELOG_CACHE_KEY_PREFIX }} build: name: Enterprise build - runs-on: ubuntu-latest + runs-on: ${{ inputs.BUILD_RUNS_ON }} needs: changelog if: ${{ needs.changelog.outputs.skip_build != 'true' }} timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} @@ -142,6 +163,9 @@ jobs: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} gradle_cache_encryption_key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + ruby: ${{ inputs.SETUP_RUBY }} + android_sdk_packages: ${{ inputs.ANDROID_SDK_PACKAGES }} + kotlin_native_cache: ${{ inputs.KOTLIN_NATIVE_CACHE }} - name: Build and upload to App Distribution uses: futuredapp/.github/.github/actions/android-build-firebase@2.5.0 with: diff --git a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml index 0f476b6..e296440 100644 --- a/.github/workflows/android-cloud-release-firebaseAppDistribution.yml +++ b/.github/workflows/android-cloud-release-firebaseAppDistribution.yml @@ -72,6 +72,27 @@ on: type: number default: 30 + BUILD_RUNS_ON: + description: "Runner label for the build job, for example `ubuntu-latest` (default) or `self-hosted` to build on the mac runners. Other jobs in this workflow stay on `ubuntu-latest`" + required: false + type: string + default: ubuntu-latest + SETUP_RUBY: + description: "Whether to install Ruby with ruby/setup-ruby (default). Set to false on runners whose image already ships Ruby, for example the self-hosted mac runners, where setup-ruby cannot create its tool cache" + required: false + type: boolean + default: true + ANDROID_SDK_PACKAGES: + description: "When set, installs the Android SDK in the build job (android-actions/setup-android) with these sdkmanager packages, for runners whose image has no SDK, for example `platforms;android-36 build-tools;36.0.0 platform-tools`" + required: false + type: string + default: "" + KOTLIN_NATIVE_CACHE: + description: "Caches ~/.konan/dependencies (LLVM, libffi) between runs; for KMP projects built on macOS, where the Kotlin/Native toolchain downloads them on every fresh runner" + required: false + type: boolean + default: false + secrets: APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true @@ -86,7 +107,7 @@ on: jobs: build: name: Enterprise Build - runs-on: ubuntu-latest + runs-on: ${{ inputs.BUILD_RUNS_ON }} timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} env: GRADLE_OPTS: ${{ inputs.GRADLE_OPTS }} @@ -101,6 +122,9 @@ jobs: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} gradle_cache_encryption_key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + ruby: ${{ inputs.SETUP_RUBY }} + android_sdk_packages: ${{ inputs.ANDROID_SDK_PACKAGES }} + kotlin_native_cache: ${{ inputs.KOTLIN_NATIVE_CACHE }} - name: Build and upload to App Distribution uses: futuredapp/.github/.github/actions/android-build-firebase@2.5.0 with: diff --git a/.github/workflows/android-cloud-release-googlePlay.yml b/.github/workflows/android-cloud-release-googlePlay.yml index 2e937ab..54b8592 100644 --- a/.github/workflows/android-cloud-release-googlePlay.yml +++ b/.github/workflows/android-cloud-release-googlePlay.yml @@ -78,6 +78,27 @@ on: type: string default: "" + BUILD_RUNS_ON: + description: "Runner label for the build job, for example `ubuntu-latest` (default) or `self-hosted` to build on the mac runners. Other jobs in this workflow stay on `ubuntu-latest`" + required: false + type: string + default: ubuntu-latest + SETUP_RUBY: + description: "Whether to install Ruby with ruby/setup-ruby (default). Set to false on runners whose image already ships Ruby, for example the self-hosted mac runners, where setup-ruby cannot create its tool cache" + required: false + type: boolean + default: true + ANDROID_SDK_PACKAGES: + description: "When set, installs the Android SDK in the build job (android-actions/setup-android) with these sdkmanager packages, for runners whose image has no SDK, for example `platforms;android-36 build-tools;36.0.0 platform-tools`" + required: false + type: string + default: "" + KOTLIN_NATIVE_CACHE: + description: "Caches ~/.konan/dependencies (LLVM, libffi) between runs; for KMP projects built on macOS, where the Kotlin/Native toolchain downloads them on every fresh runner" + required: false + type: boolean + default: false + secrets: SIGNING_KEYSTORE_PASSWORD: description: "Password to provided keystore" @@ -98,7 +119,7 @@ on: jobs: build: name: Release Build - runs-on: [ ubuntu-latest ] + runs-on: ${{ inputs.BUILD_RUNS_ON }} timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} env: GRADLE_OPTS: ${{ inputs.GRADLE_OPTS }} @@ -112,6 +133,9 @@ jobs: with: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} + ruby: ${{ inputs.SETUP_RUBY }} + android_sdk_packages: ${{ inputs.ANDROID_SDK_PACKAGES }} + kotlin_native_cache: ${{ inputs.KOTLIN_NATIVE_CACHE }} - name: Build and release uses: futuredapp/.github/.github/actions/android-build-googlePlay@2.5.0 with: diff --git a/.github/workflows/kmp-combined-nightly-build.yml b/.github/workflows/kmp-combined-nightly-build.yml index 96c2222..d4ba47f 100644 --- a/.github/workflows/kmp-combined-nightly-build.yml +++ b/.github/workflows/kmp-combined-nightly-build.yml @@ -111,6 +111,27 @@ on: required: false default: "Testing" + ANDROID_BUILD_RUNS_ON: + description: "Runner label for the Android build job, for example `ubuntu-latest` (default) or `self-hosted` to build on the mac runners. Other jobs in this workflow stay on `ubuntu-latest`" + required: false + type: string + default: ubuntu-latest + ANDROID_SETUP_RUBY: + description: "Whether to install Ruby with ruby/setup-ruby (default). Set to false on runners whose image already ships Ruby, for example the self-hosted mac runners, where setup-ruby cannot create its tool cache" + required: false + type: boolean + default: true + ANDROID_SDK_PACKAGES: + description: "When set, installs the Android SDK in the Android build job (android-actions/setup-android) with these sdkmanager packages, for runners whose image has no SDK, for example `platforms;android-36 build-tools;36.0.0 platform-tools`" + required: false + type: string + default: "" + ANDROID_KOTLIN_NATIVE_CACHE: + description: "Caches ~/.konan/dependencies (LLVM, libffi) between runs; for KMP projects built on macOS, where the Kotlin/Native toolchain downloads them on every fresh runner" + required: false + type: boolean + default: false + secrets: FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: required: true @@ -196,7 +217,7 @@ jobs: android_build: name: Android Build - runs-on: ubuntu-latest + runs-on: ${{ inputs.ANDROID_BUILD_RUNS_ON }} needs: changelog if: ${{ needs.changelog.outputs.skip_build != 'true' }} timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} @@ -213,6 +234,9 @@ jobs: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} gradle_cache_encryption_key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + ruby: ${{ inputs.ANDROID_SETUP_RUBY }} + android_sdk_packages: ${{ inputs.ANDROID_SDK_PACKAGES }} + kotlin_native_cache: ${{ inputs.ANDROID_KOTLIN_NATIVE_CACHE }} - name: Build and upload to App Distribution uses: futuredapp/.github/.github/actions/android-build-firebase@2.5.0 with: diff --git a/CLAUDE.md b/CLAUDE.md index 7968b0c..73dcca1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,6 +88,19 @@ bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/down ./actionlint -color ``` +### Releasing a New Version +Every internal `futuredapp/.github/.github/...@{version}` ref must point at the version being released. Use the scripts in `.github/scripts/`, not a manual sed: they also rewrite `@main` refs and cover both workflows and composite actions. + +```bash +# Point all internal action/workflow refs at the new version +.github/scripts/bump-action-refs.sh 2.6.0 + +# Verify nothing was missed (also run by validate-release-tag.yml when the tag is pushed) +.github/scripts/validate-action-refs.sh 2.6.0 +``` + +Convention: branch `release/{version}`, commit `chore(release): bump internal action refs to {version}`, PR into `main`, then create the `{version}` tag on the merge commit. The tag push triggers `validate-release-tag.yml`, which fails if any ref does not match the tag. + ### Android Actions Actions use Gradle tasks passed as inputs: - Lint: `./gradlew --continue {LINT_GRADLE_TASK}`