Skip to content

Commit c0ec99f

Browse files
committed
build: Switch release configuration to JReleaser
1 parent a755c17 commit c0ec99f

File tree

4 files changed

+103
-48
lines changed

4 files changed

+103
-48
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,65 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
79

810
jobs:
9-
Release:
11+
release:
12+
name: Release
1013
runs-on: ubuntu-latest
11-
env:
12-
CI: true
1314
steps:
15+
- name: Cancel previous run
16+
uses: styfle/[email protected]
17+
with:
18+
access_token: ${{ secrets.GITHUB_TOKEN }}
19+
1420
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
1523

16-
- name: Set up JDK 11
24+
- name: Set up Java
1725
uses: actions/setup-java@v4
1826
with:
1927
java-version: 11
2028
distribution: zulu
2129
cache: gradle
2230

23-
- name: Release
24-
run: ./gradlew -PreproducibleBuild=true -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} publishPlugins
25-
26-
- name: Generate changelog
27-
id: changelog
28-
uses: metcalfc/[email protected]
29-
with:
30-
myToken: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Set release version
32+
run: |
33+
VERSION=${{ github.event.inputs.version }}
34+
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${VERSION}/g" README.adoc
35+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
36+
git config --global user.name "GitHub Action"
37+
git commit -a -m "Releasing version $VERSION"
38+
git push origin main
3139
32-
- name: Create GitHub Release
33-
id: create_release
34-
uses: actions/create-release@v1
40+
- name: Deploy to Plugin Portal
3541
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
43+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
44+
run: ./gradlew -Prelease=true -Pfull-release=true -PreproducibleBuild=true publishPlugins -S
45+
46+
- name: Release
47+
uses: jreleaser/release-action@v2
3748
with:
38-
tag_name: ${{ github.ref }}
39-
release_name: Release ${{ github.ref }}
40-
body: |
41-
https://plugins.gradle.org/plugin/dev.jbang
42-
43-
### Changelog
44-
${{ steps.changelog.outputs.changelog }}
45-
draft: false
46-
prerelease: false
47-
48-
- name: Version
49-
id: version
50-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
51-
52-
- name: Announce
53-
uses: ethomson/send-tweet-action@v1
49+
arguments: full-release
50+
env:
51+
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
52+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
54+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
55+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
56+
JRELEASER_BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
57+
58+
- name: JReleaser output
59+
if: always()
60+
uses: actions/upload-artifact@v4
5461
with:
55-
status: "jbang gradle plugin v${{ steps.version.outputs.VERSION }} released https://plugins.gradle.org/plugin/dev.jbang"
56-
consumer-key: ${{ secrets.TWITTER_API_KEY }}
57-
consumer-secret: ${{ secrets.TWITTER_API_SECRET_KEY }}
58-
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
59-
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
62+
name: artifact
63+
path: |
64+
out/jreleaser/trace.log
65+
out/jreleaser/output.properties

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020 Andres Almiray
1+
Copyright (c) 2020-2025 Andres Almiray
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ following properties
3434

3535
[options="header", cols="6*<,^"]
3636
|===
37-
| Property | Type | Option | System | Environment | Default | Required
38-
| script | String | jbang-script | jbang.script | JBANG_SCRIPT | | {required-icon}
39-
| jbangArgs | List<String> | jbang-jbang-args | jbang.jbangArgs | JBANG_JBANG_ARGS | [ ] | {optional-icon}
40-
| args | List<String> | jbang-args | jbang.args | JBANG_ARGS | [ ] | {optional-icon}
41-
| trusts | List<String> | jbang-trusts | jbang.trusts | JBANG_TRUSTS | [ ] | {optional-icon}
42-
| version | String | jbang-version | jbang.version | JBANG_VERSION | latest | {optional-icon}
43-
| installDir | Directory | | jbang.install.dir | JBANG_INSTALL_DIR | $gradleUserHomeDir/caches/jbang | {optional-icon}
37+
| Property | Type | Option | System | Environment | Default | Required
38+
| script | String | jbang-script | jbang.script | JBANG_SCRIPT | | {required-icon}
39+
| jbangArgs | List<String> | jbang-jbang-args | jbang.jbangArgs | JBANG_JBANG_ARGS | [ ] | {optional-icon}
40+
| args | List<String> | jbang-args | jbang.args | JBANG_ARGS | [ ] | {optional-icon}
41+
| trusts | List<String> | jbang-trusts | jbang.trusts | JBANG_TRUSTS | [ ] | {optional-icon}
42+
| version | String | jbang-version | jbang.version | JBANG_VERSION | latest | {optional-icon}
43+
| installDir | Directory | | jbang.install.dir | JBANG_INSTALL_DIR | $gradleUserHomeDir/caches/jbang | {optional-icon}
4444
|===
4545

4646
[horizontal]

jreleaser.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
project:
2+
name: jbang-gradle-plugin
3+
description: The JBang Gradle plugin allows JBang scripts to be executed during a Gradle build
4+
longDescription: |
5+
The JBang Gradle plugin allows JBang scripts to be executed during a Gradle build.
6+
The plugin attempts to use an existing JBang installation. If no JBang installation is found, the plugin will install
7+
JBang by downloading and caching the latest version binaries (in your local Gradle cache directory) for subsequent runs.
8+
links:
9+
homepage: https://jbang.dev
10+
documentation: https://jbang.dev/documentation
11+
license: https://github.com/jbangdev/jbang-gradle-plugin/blob/main/LICENSE
12+
authors:
13+
- Andres Almiray
14+
- Max Rydahl Andersen
15+
license: MIT
16+
tags:
17+
- jbang
18+
- bash
19+
- java
20+
- shell
21+
- scripting
22+
- gradle
23+
- plugin
24+
java:
25+
groupId: dev.jbang
26+
version: 8
27+
inceptionYear: 2020
28+
stereotype: NONE
29+
30+
release:
31+
github:
32+
overwrite: true
33+
sign: true
34+
releaseName: '{{tagName}}'
35+
changelog:
36+
formatted: always
37+
preset: "conventional-commits"
38+
format: '- {{commitShortHash}} {{commitTitle}}'
39+
40+
signing:
41+
active: ALWAYS
42+
armored: true
43+
44+
announce:
45+
bluesky:
46+
active: RELEASE
47+
status: 'JBang Gradle plugin {{projectVersion}} has been released! {{releaseNotesUrl}}'
48+
handle: 'jbang.dev'
49+
host: https://bsky.social

0 commit comments

Comments
 (0)