-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (52 loc) · 1.65 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
name: Create release
on:
workflow_dispatch:
inputs:
releaseType:
description: Release type
default: patch-milestone
type: choice
options:
- patch-milestone
- minor-milestone
- patch
- minor
required: true
defaults:
run:
shell: bash
jobs:
create-release:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
JVM_OPTS: "-Xmx6G"
SBT_OPTS: "-Dsbt.ci=true"
steps:
- 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@v4
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}}" = "patch-milestone" || "${{github.event.inputs.releaseType}}" = "minor-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 }}"