Create release #34
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: Create release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseType: | |
description: 'Release type' | |
required: true | |
type: choice | |
default: 'calver-milestone' | |
options: | |
- 'calver-milestone' | |
- 'calver' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
# JVM_OPTS: "-Xmx6G" # ignored when .jvmopts is present | |
SBT_OPTS: "-Dsbt.ci=true" | |
steps: | |
- name: Validate inputs | |
run: exit 1 | |
if: | | |
github.event.inputs.releaseType != 'calver' && | |
github.event.inputs.releaseType != 'calver-milestone' | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # indicates all history for all branches and tags | |
token: ${{ secrets.GATLING_CI_TOKEN }} # for tag to trigger other workflows (release) | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
cache: 'sbt' | |
- name: Next version | |
id: tag | |
run: | | |
sbt "gatlingWriteBumpVersion ${{ github.event.inputs.releaseType }}" | |
export CURRENT_TAG="v$(cat target/gatlingNextVersion)" | |
echo "tag='$CURRENT_TAG'" | |
echo "tag=$CURRENT_TAG" >> $GITHUB_OUTPUT | |
- name: Git tag | |
run: | | |
git config user.name "${{ secrets.GATLING_CI_NAME }}" | |
git config user.email "${{ secrets.GATLING_CI_EMAIL }}" | |
if [ "${{github.event.inputs.releaseType}}" = "calver-milestone" ]; then | |
git tag "${{ steps.tag.outputs.tag }}" | |
else | |
git tag "${{ steps.tag.outputs.tag }}" -m "Version ${{ steps.tag.outputs.tag }}" | |
fi | |
git push origin "${{ steps.tag.outputs.tag }}" |