-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.78 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 }}"