generate-tag #76
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: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build with Gradle | |
run: ./gradlew 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@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.TOKEN_GITHUB_ACTION }} | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Generate tag | |
run: ./gradlew 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 |