Skip to content

GH Action that extracts the version string from the build.gradle file to use inside ci/cd pipelines.

License

Notifications You must be signed in to change notification settings

thecodemonkey/action-get-gradle-version

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

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get gradle version action

(a fork of get npm version action: https://github.com/pchynoweth/action-get-npm-version)



extracts the version string from the build.gradle file



Example usage

name: GET GRADLE VERSION

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.version.outputs.version }}              # <- put the version to output of the current job 
    steps:                                                       #    to share the version between different jobs
      - uses: actions/checkout@v2
      
      
      
      - uses: thecodemonkey/action-get-gradle-version@master     # <- USE THIS ACTION TO READ THE VERSION FROM BUILD.GRADLE
        id: version                                              # <- give this step an id to access the output of the step
        
        
        
        
      - run: 'echo version ${{ steps.version.outputs.version }}' # <- access the version
 
  deploy:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - run: 'echo version ${{needs.build.outputs.version}}'     # <- access the version in another job
      



Inputs

file

Optional The build.gradle file. Default "build.gradle".

use this input parameter if the build.gradle file is in a different directory.

  - uses: thecodemonkey/action-get-gradle-version@master
    with:
      file: module/subfolder/build.gradle



Outputs

version

the version inside build.gradle file. You have to give the step an id to access the output.

  - uses: thecodemonkey/action-get-gradle-version@master
    id: getversion
  - run: 'echo version ${{ steps.getversion.outputs.version }}' 



License

The scripts and documentation in this project are released under the MIT License

About

GH Action that extracts the version string from the build.gradle file to use inside ci/cd pipelines.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%