Skip to content
anchor

GitHub Action

Increment the version code/name of your Android project

v1.3 Latest version

Increment the version code/name of your Android project

anchor

Increment the version code/name of your Android project

This action will increment the version code/name directly in build.gradle .

Installation

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

              

- name: Increment the version code/name of your Android project

uses: doublesymmetry/[email protected]

Learn more about this action in doublesymmetry/android-version-actions

Choose a version

android-version-action v1.3

Override your android version number and version code through github actions

Usage

- uses: DoubleSymmetry/[email protected]
  with:
    gradlePath: app/build.gradle # or app/build.gradle.kts

    # versionCode
    # ex. 10
    # If versionCode is not set, auto-increment versionCode.
    versionCode: ${{github.run_number}}

    # versionName
    # ex. 3.2.0
    # If versionName is not set, the version does not be changed.
    versionName: ''

Examples

auto increment build number

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Bump version
        uses: DoubleSymmetry/[email protected]
        with:
          gradlePath: app/build.gradle # or app/build.gradle.kts 
          versionName: 1.0.0

specify build number using GITHUB_RUN_NUMBER

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Bump version
        uses: DoubleSymmetry/[email protected]
        with:
          gradlePath: app/build.gradle # or app/build.gradle.kts 
          versionCode: ${{github.run_number}}
          versionName: 1.0.0