Skip to content

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

License

Notifications You must be signed in to change notification settings

usefulness/agp-version-finder-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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" ]
      steps:
        - 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"

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages