-
Notifications
You must be signed in to change notification settings - Fork 7
43 lines (40 loc) · 1.23 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
name: Create Release
on:
workflow_dispatch:
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Build with Maven
run: mvn -U -B package
- name: Create Changelog
shell: bash
run: |
DIFF=$(git log $(git tag --sort=-creatordate | sed '2q;d')..HEAD --oneline)
if [ -z "$DIFF" ]; then
echo "Defaulting to full log"
DIFF=$(git log --oneline)
fi
echo "# Commits since last release" > CHANGELOG.txt
echo "$DIFF" | sed 's/^/* /' | sed '/Auto-Update Dependencies/{s/Updated/\n\t* Updated/g}' | sed '/\[maven-release-plugin\]/d' | sed -r '/.*\(#\w+\)$/d' >> CHANGELOG.txt
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
body_path: CHANGELOG.txt
generate_release_notes: true
files: |
target/timesheetgenerator.jar