Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
search

GitHub Action

Android Gradle Plugin version finder

v1.0.0

Android Gradle Plugin version finder

search

Android Gradle Plugin version finder

Find current stable and latest Android Gradle Plugin version for later use in Github Actions matrix

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Android Gradle Plugin version finder

uses: usefulness/agp-version-finder-action@v1.0.0

Learn more about this action in usefulness/agp-version-finder-action

Choose a version

Android Gradle Plugin version finder - GitHub Action

.github/workflows/pull_request.yml

Find current stable and latest Android Gradle Plugin version for GitHub Actions matrix builds.

Usage

The action only exposes multiple outputs containing latest version for each AGP release channel.

Configuration:

Simple usage:

  jobs:
      actual-tests:
        runs-on: ubuntu-latest
        strategy:
          fail-fast: false
          matrix:
            javaVersion: [ 21 ]
            gradle: [ current, release-candidate ]
            agp: ["stable", "rc", "alpha"]

        - id: agp-version-finder
          uses: usefulness/agp-version-finder-action@v1
          with:
            version-to-resolve: ${{ matrix.agp }}

        - run: echo ${{ steps.agp-version-finder.outputs.resolved-version }}

Extra: Use AGP version in job name:

  jobs:
    provide-agp-version-matrix:
      runs-on: ubuntu-latest
      outputs:
        agp-versions: ${{ steps.build-agp-matrix.outputs.agp-versions }}
      steps:
        # Fetch latest AGP versions
        - id: agp-version-finder
          uses: usefulness/agp-version-finder-action@v1

        # Consume action outputs to build AGP matrix
        - id: build-agp-matrix
          run: echo 'agp-versions=["${{ steps.agp-version-finder.outputs.latest-stable }}", "${{ steps.agp-version-finder.outputs.latest-alpha }}"]' >> $GITHUB_OUTPUT

      actual-tests:
        runs-on: ubuntu-latest
        needs:
          - provide-agp-version-matrix
        strategy:
          fail-fast: false
          matrix:
            javaVersion: [ 21 ]
            gradle: [ current, release-candidate ]
            # When evaluated will be replaced with array ["7.2.2", "7.4.0-alpha13"] 
            agp: ${{ fromJSON(needs.provide-agp-version-matrix.outputs.agp-versions) }}

source

All available action outputs, representing respective AGP release channels:

  • latest-stable i.e. "7.2.2"
  • latest-rc i.e. "7.3.0-rc01"
  • latest-beta i.e. "7.3.0-beta02"
  • latest-alpha i.e. "7.4.0-alpha13"