-
Notifications
You must be signed in to change notification settings - Fork 13
55 lines (49 loc) · 1.84 KB
/
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
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Docker
run: |
CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
LATEST_VERSION=$(git tag -l --sort=-version:refname | head -1 | cut -d 'v' -f 2)
if [ "$LATEST_VERSION" == "$CURRENT_VERSION" ]; then
echo "Latest version is $LATEST_VERSION. Current version is $CURRENT_VERSION. Pushing latest tag."
mvn clean package -P production jib:build -Djib.to.auth.username=$DOCKER_USER -Djib.to.auth.password=$DOCKER_TOKEN -Djib.to.tags=latest
else
echo "Latest version is $LATEST_VERSION. Current version is $CURRENT_VERSION. Pushing latest tag."
mvn clean package -P production jib:build -Djib.to.auth.username=$DOCKER_USER -Djib.to.auth.password=$DOCKER_TOKEN
fi
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
- name: Generate release changelog
uses: mikepenz/release-changelog-builder-action@v5
id: build_changelog
with:
configuration: 'changelog-builder.json'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.build_changelog.outputs.changelog }}
artifacts: 'target/suricate.jar'
draft: true
prerelease: true
allowUpdates: true