-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.78 KB
/
Copy pathbuild.yml
File metadata and controls
65 lines (56 loc) · 1.78 KB
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
59
60
61
62
63
64
65
name: Build & Release
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
create_release:
description: 'Create a GitHub Release?'
required: true
type: boolean
default: true
prerelease:
description: 'Mark the GitHub Release as a prerelease?'
required: true
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build & Test
run: mvn clean verify --batch-mode --no-transfer-progress
- name: Resolve Version
id: version
shell: bash
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT"
- name: Upload JAR Artifact
uses: actions/upload-artifact@v4
with:
name: VelocityNavigator-${{ steps.version.outputs.version }}
path: target/VelocityNavigator-*.jar
- name: Extract Release Notes
run: |
awk '/^## \[/{if (p) exit; p=1; print; next} p' CHANGELOG.md > release_notes.md
- name: Create GitHub Release
if: ${{ github.event_name == 'workflow_dispatch' && inputs.create_release }}
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: VelocityNavigator v${{ steps.version.outputs.version }}
body_path: release_notes.md
files: target/VelocityNavigator-*.jar
draft: false
prerelease: ${{ inputs.prerelease }}