-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.44 KB
/
release.yml
File metadata and controls
58 lines (48 loc) · 1.44 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
name: Build and Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Extract version
id: version
run: |
RAW="${GITHUB_REF_NAME}"
VERSION="${RAW#v}"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "RAW_VERSION=$RAW" >> $GITHUB_OUTPUT
- name: Build JAR
run: mvn clean package -Drevision=${{ steps.version.outputs.VERSION }}
- name: List built files
run: ls -lh target/
- name: Select correct JAR
id: jar
run: |
JAR=$(find target -name "*.jar" ! -name "*original*" | head -n 1)
echo "Selected JAR: $JAR"
echo "JAR_FILE=$JAR" >> $GITHUB_OUTPUT
- name: Create GitHub Release
if: ${{ !env.ACT }}
run: |
gh release create "${{ steps.version.outputs.RAW_VERSION }}" \
"${{ steps.jar.outputs.JAR_FILE }}" \
--title "Release ${{ steps.version.outputs.RAW_VERSION }}" \
--notes "Release ${{ steps.version.outputs.RAW_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}