Repository navigation
77 lines (66 loc) · 3.16 KB
/
Copy pathmaster.yml
File metadata and controls
77 lines (66 loc) · 3.16 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
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and Release
on:
push:
branches:
- master
tags:
- 'v*.*.*' # triggers on tags like v3.0.1, v4.0.0, etc.
permissions:
contents: write # needed to create GitHub Releases and upload assets
jobs:
build-and-release:
name: Build fat JAR and publish release
runs-on: ubuntu-latest
steps:
# ── 1. Checkout ────────────────────────────────────────────────────────
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so Gradle version plugins work correctly
# ── 2. Java 21 ─────────────────────────────────────────────────────────
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# ── 3. Gradle wrapper permissions ──────────────────────────────────────
- name: Make gradlew executable
run: chmod +x ./gradlew
# ── 4. Build ────────────────────────────────────────────────────────────
# fatJar lives in gui/build.gradle.kts — it runs shadowJar then copies
# the output to dist/threadtear-<version>.jar
- name: Build fat JAR
run: ./gradlew :threadtear-gui:fatJar --no-daemon
env:
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
# ── 5. Resolve the JAR path and derive version from the Git tag ─────────
- name: Locate built JAR
id: jar
run: |
JAR=$(ls dist/threadtear-*.jar | head -1)
echo "path=$JAR" >> "$GITHUB_OUTPUT"
echo "name=$(basename $JAR)" >> "$GITHUB_OUTPUT"
# Strip the leading 'v' from the tag to get a clean version string
VERSION="${GITHUB_REF_NAME#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# ── 6. Create GitHub Release and upload the JAR ─────────────────────────
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "ThreadTearX ${{ steps.jar.outputs.version }}"
body: |
## ThreadTearX ${{ steps.jar.outputs.version }}
### Installation
Download `${{ steps.jar.outputs.name }}` and run:
```
java -jar ${{ steps.jar.outputs.name }}
```
Requires **Java 21** or newer.
### What's changed
_Fill in release notes here, or connect a CHANGELOG.md._
draft: false
prerelease: ${{ contains(github.ref_name, '-') }} # tags like v4.0.0-beta become pre-releases
files: ${{ steps.jar.outputs.path }}
fail_on_unmatched_files: true