-
Notifications
You must be signed in to change notification settings - Fork 57
47 lines (44 loc) · 1.15 KB
/
build.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
name: build
on:
push:
workflow_dispatch:
create:
tag: '*'
jobs:
build:
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.release.outputs.id }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 20
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Clean up artifacts
run: rm target/original-*.jar
- name: Release
id: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: "ServerTap ${{ github.ref_name }}"
body_path: CHANGELOG.md
draft: true
files: target/*.jar
# use a separate step to un-draft the release in case the build fails
finalize-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Publish release
if: startsWith(github.ref, 'refs/tags/')
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.build.outputs.release_id }}