-
-
Notifications
You must be signed in to change notification settings - Fork 65
46 lines (42 loc) · 1.17 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
name: Maven Build and Release
on:
push:
tags: [ 'v*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Set RELEASE_VERSION from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print version
run: |
echo $RELEASE_VERSION
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: target
path: ${{ github.workspace }}/target/**/*
- name: Extract changelog content
run: |
sed -n "/^## \[$RELEASE_VERSION]/,/^## /p" CHANGELOG.md | sed '1d;$d' > changelog_body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog_body.md
draft: true
prerelease: false
files: |
target/minecraft-prometheus-exporter-*.jar
README.md
CHANGELOG.md
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}