Skip to content

Commit 95c48b3

Browse files
feat: jreleaser
1 parent 445c80e commit 95c48b3

2 files changed

Lines changed: 42 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25+
- name: Extract version from tag
26+
id: version
27+
run: |
28+
RAW_TAG="${GITHUB_REF_NAME}"
29+
VERSION="${RAW_TAG#v}"
30+
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
2532
- name: ☕ Setup Java ${{ env.JAVA_VERSION }}
2633
uses: actions/setup-java@v4
2734
with:
@@ -37,9 +44,14 @@ jobs:
3744
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3845
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3946
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
40-
run: |
41-
RAW_TAG="${GITHUB_REF##*/}"
42-
VERSION="${RAW_TAG#v}"
47+
run: ./gradlew :api:publishToCentralPortal -Pversion=${{ steps.version.outputs.version }}
48+
49+
- name: "📦 Build all shadowJARs"
50+
run: ./gradlew clean shadowJar
4351

44-
[[ "$VERSION" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
45-
./gradlew :api:publishToCentralPortal -Pversion="$VERSION"
52+
- name: "🏗 Run JReleaser"
53+
uses: jreleaser/release-action@v2
54+
with:
55+
arguments: full-release --set-version ${{ steps.version.outputs.version }}
56+
env:
57+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jreleaser.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
project:
2+
name: octopus-plugin
3+
description: "Paper plugin with API for wrapper around Octopus SDK for o7studios product Octopus"
4+
license: GPL-3.0
5+
6+
release:
7+
github:
8+
owner: o7studios
9+
name: octopus-plugin
10+
tagName: "{{projectVersion}}"
11+
releaseName: "{{projectVersion}}"
12+
changelog:
13+
formatted: ALWAYS
14+
preset: conventional-commits
15+
links: true
16+
17+
distributions:
18+
api:
19+
type: SINGLE_JAR
20+
artifacts:
21+
- path: api/build/libs/octopus-plugin-api-all.jar
22+
plugin:
23+
type: SINGLE_JAR
24+
artifacts:
25+
- path: plugin/build/libs/octopus-plugin-all.jar

0 commit comments

Comments
 (0)