generate-tag #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generate-tag | |
on: | |
workflow_dispatch: | |
branches: [main] | |
inputs: | |
stage: | |
description: 'Stage' | |
required: true | |
default: 'auto' | |
type: choice | |
options: | |
- 'alpha' | |
- 'beta' | |
- 'rc' | |
- 'final' | |
- 'auto' | |
scope: | |
description: 'Scope' | |
required: true | |
default: 'auto' | |
type: choice | |
options: | |
- 'minor' | |
- 'major' | |
- 'auto' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: build -x spotlessCheck "-Psemver.scope=${{ github.event.inputs.scope }}" "-Psemver.stage=${{ github.event.inputs.stage }}" | |
- name: Stop Gradle daemons | |
run: ./gradlew --stop | |
generate-tag: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.TOKEN_GITHUB_ACTION }} | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Generate Tag | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: createSemverTag "-Psemver.scope=${{ github.event.inputs.scope }}" "-Psemver.stage=${{ github.event.inputs.stage }}" | |
- name: Push changes to tag | |
run: git push --follow-tags | |
- name: Stop Gradle daemons | |
run: ./gradlew --stop |