Skip to content

Commit cdc98d9

Browse files
committed
build: Configure JReleaser for releases
1 parent 6441c54 commit cdc98d9

File tree

3 files changed

+73
-64
lines changed

3 files changed

+73
-64
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
env:
3434
CI: true
3535
steps:
36-
- uses: actions/checkout@v4
36+
- uses: actions/checkout@v6
3737

3838
- name: Set up JDK 11
39-
uses: actions/setup-java@v4
39+
uses: actions/setup-java@v5
4040
with:
4141
java-version: 11
4242
distribution: zulu

.github/workflows/release.yml

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,19 @@ on:
1010
jobs:
1111
release:
1212
name: Release
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Cancel previous run
16-
uses: styfle/[email protected]
17-
with:
18-
access_token: ${{ secrets.GITHUB_TOKEN }}
19-
20-
- uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Set up Java
25-
uses: actions/setup-java@v4
26-
with:
27-
java-version: 11
28-
distribution: zulu
29-
cache: gradle
30-
31-
- name: Set release version
32-
run: |
33-
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
34-
echo ${{ github.event.inputs.version }} > VERSION
35-
git add VERSION
36-
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${{ github.event.inputs.version }}/g" README.adoc
37-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
38-
git config --global user.name "GitHub Action"
39-
git commit -a -m "Releasing version ${{ github.event.inputs.version }}"
40-
git push origin main
41-
42-
- name: Deploy to Plugin Portal
43-
env:
44-
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
45-
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
46-
run: ./gradlew -Prelease=true -Pfull-release=true -PreproducibleBuild=true publishPlugins -S
47-
48-
- name: Release
49-
uses: jreleaser/release-action@v2
50-
with:
51-
arguments: full-release
52-
env:
53-
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
54-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
56-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
57-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
58-
JRELEASER_BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
59-
60-
- name: JReleaser output
61-
if: always()
62-
uses: actions/upload-artifact@v4
63-
with:
64-
name: artifact
65-
path: |
66-
out/jreleaser/trace.log
67-
out/jreleaser/output.properties
13+
uses: kordamp/kordamp-gradle-plugin-workflow/.github/workflows/release.yml@main
14+
with:
15+
version: ${{ github.event.inputs.version }}
16+
java-version: 11
17+
secrets:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
20+
gpg-public-key: ${{ secrets.GPG_PUBLIC_KEY }}
21+
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
22+
gpg-key-id: ${{ secrets.GPG_KEY_ID }}
23+
gradle-publish-key: ${{ secrets.GRADLE_PUBLISH_KEY }}
24+
gradle-publish-secret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
25+
mastodon-access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
26+
bluesky-host: ${{ secrets.BLUESKY_HOST }}
27+
bluesky-handle: ${{ secrets.BLUESKY_HANDLE }}
28+
bluesky-password: ${{ secrets.BLUESKY_PASSWORD }}

jreleaser.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
#
2+
# SPDX-License-Identifier: MIT
3+
#
4+
# Copyright (c) 2020-2025 Andres Almiray.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in
14+
# all copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
# THE SOFTWARE.
23+
#
24+
125
project:
226
name: jbang-gradle-plugin
327
description: The JBang Gradle plugin allows JBang scripts to be executed during a Gradle build
@@ -31,14 +55,38 @@ project:
3155
release:
3256
github:
3357
overwrite: true
58+
milestone:
59+
name: '{{projectVersion}}'
60+
issues:
61+
enabled: true
3462
changelog:
35-
formatted: always
36-
preset: "conventional-commits"
37-
format: '- {{commitShortHash}} {{commitTitle}}'
63+
formatted: ALWAYS
64+
preset: conventional-commits
65+
contributors:
66+
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
67+
labelers:
68+
- label: 'dependencies'
69+
title: 'regex:^(?:deps(?:\(.*\))?!?):\s.*'
70+
order: 120
71+
categories:
72+
- title: '⚙️ Dependencies'
73+
key: 'dependencies'
74+
order: 80
75+
labels:
76+
- 'dependencies'
77+
hide:
78+
categories:
79+
- 'merge'
80+
contributors:
81+
- 'GitHub'
82+
replacers:
83+
- search: 'deps: '
3884

3985
announce:
4086
bluesky:
41-
active: NEVER
42-
status: 'JBang Gradle plugin {{projectVersion}} has been released! {{releaseNotesUrl}}'
43-
handle: 'jbang.dev'
44-
host: https://bsky.social
87+
active: RELEASE
88+
status: 🚀 JBang Gradle plugin {{projectVersion}} has been released! {{releaseNotesUrl}}
89+
mastodon:
90+
active: RELEASE
91+
host: https://mastodon.social
92+
status: 🚀 JBang Gradle plugin {{projectVersion}} has been released! {{releaseNotesUrl}}

0 commit comments

Comments
 (0)