Skip to content

Commit da12ddc

Browse files
committed
Put the Gradle plugins' jar in the GitHub release, signed like the rest
The draft GitHub release carried the runnable jar, the IntelliJ and Eclipse plugins and the native binaries, each with its signature. Now jreleaserRelease also builds the Gradle plugins' jar and attaches it with a signature from the release key, and its checksum goes into checksums_sha256.txt. The copy on the Gradle Plugin Portal is not signed. A dry run of the GitHub target lists the jar and its .asc for upload. The jar builds reproducibly: two clean builds give the same SHA-256.
1 parent 43df12f commit da12ddc

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ name: Release
99
# fails publishes nothing, and its deployments can be dropped in the Portal.
1010
#
1111
# Once Maven Central serves both, the Gradle plugins go to the Gradle Plugin Portal. After publishing, a
12-
# draft GitHub release on the tag collects the runnable jar, the IDE plugins and the native binaries.
12+
# draft GitHub release on the tag collects the runnable jar, the Gradle and IDE plugins and the native
13+
# binaries.
1314
#
1415
# Needs six repository secrets: JRELEASER_MAVENCENTRAL_USERNAME and JRELEASER_MAVENCENTRAL_PASSWORD (the
1516
# Central Portal user token), JRELEASER_GPG_SECRET_KEY and JRELEASER_GPG_PASSPHRASE, and
@@ -267,10 +268,11 @@ jobs:
267268
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
268269
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
269270

270-
# What Maven Central does not carry — the runnable formatter jar, the IntelliJ plugin zip, the Eclipse
271-
# plugin jar, and every platform's native binary as a plain download — goes into a draft GitHub release
272-
# on the tag, each file signed with the release key. Only once both deployments are published; publishing
273-
# the draft is a click on GitHub, and a re-run fails while a release for the tag exists.
271+
# What Maven Central does not carry — the runnable formatter jar, the Gradle plugins' jar, the IntelliJ
272+
# plugin zip, the Eclipse plugin jar, and every platform's native binary as a plain download — goes into
273+
# a draft GitHub release on the tag, each file signed with the release key. Only once both deployments
274+
# are published; publishing the draft is a click on GitHub, and a re-run fails while a release for the
275+
# tag exists.
274276
github-release:
275277
name: draft GitHub release
276278
needs: publish
@@ -295,7 +297,7 @@ jobs:
295297
pattern: native-image-*
296298
merge-multiple: true
297299

298-
- name: Build the IDE plugins and open the draft release
300+
- name: Build the plugins and open the draft release
299301
run: ./gradlew -PreleaseTarget=github -PnativeImages=native-images jreleaserRelease
300302
env:
301303
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ and published from this repository.
2323
| [Maven Central](https://central.sonatype.com/namespace/dev.openjavaformat) | `dev.openjavaformat:open-java-format`, with `-spi`, `-native` and `-jdk-bootstrap` |
2424
| [Gradle Plugin Portal](https://plugins.gradle.org/plugin/dev.openjavaformat.java-format) | `dev.openjavaformat.java-format` |
2525
| [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/34359-open-java-format) | the IntelliJ IDEA plugin |
26-
| [GitHub Releases](https://github.com/openjavaformat/open-java-format/releases/latest) | native binaries, a runnable jar, the IntelliJ and Eclipse plugins, every file signed |
26+
| [GitHub Releases](https://github.com/openjavaformat/open-java-format/releases/latest) | native binaries, a runnable jar, the Gradle, IntelliJ and Eclipse plugins, every file signed |
2727

2828
Why the project exists is in the [manifesto](https://openjavaformat.dev/manifesto/).
2929

‎buildSrc/src/main/groovy/open-java-format.release-conventions.gradle‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ plugins {
1212
// collected, the default deploys the jars; on a tag both read the same version from it.
1313
//
1414
// `-PreleaseTarget=github` deploys nothing. It is for `jreleaserRelease`, which opens a draft GitHub
15-
// release on the tag with what Maven Central does not carry — the runnable formatter jar, the IntelliJ
16-
// plugin zip, the Eclipse plugin jar and every platform's native binary as a plain download — each file
17-
// signed, plus a checksum file.
15+
// release on the tag with what Maven Central does not carry — the runnable formatter jar, the Gradle
16+
// plugins' jar, the IntelliJ plugin zip, the Eclipse plugin jar and every platform's native binary as a
17+
// plain download — each file signed, plus a checksum file.
1818
//
1919
// Publishing is a run of its own: with JRELEASER_MAVENCENTRAL_DEPLOYMENT_ID set, JReleaser publishes that
2020
// deployment, which an earlier run uploaded and the Portal validated, and nothing is built. The ID has to
2121
// be an environment variable: JReleaser 1.26 drops a deploymentId set in the DSL. The release workflow
2222
// uploads both deployments first and publishes them only once both are in, so a version whose native
2323
// build fails publishes nothing.
2424
//
25-
// gradle-open-java-format is not released here: the release workflow publishes its plugins to the Gradle
26-
// Plugin Portal once Maven Central serves the jars and native images they depend on.
25+
// gradle-open-java-format is not deployed here: the release workflow publishes its plugins to the Gradle
26+
// Plugin Portal once Maven Central serves the jars and native images they depend on. The GitHub release
27+
// carries its jar too, built from the same tag.
2728
def releaseTarget = providers.gradleProperty('releaseTarget').getOrElse('jars')
2829
def deploymentToPublish = providers.environmentVariable('JRELEASER_MAVENCENTRAL_DEPLOYMENT_ID').getOrNull()
2930
def releasedProjects
@@ -108,6 +109,9 @@ jreleaser {
108109
artifact {
109110
path = 'open-java-format/build/libs/open-java-format-{{projectVersion}}-all.jar'
110111
}
112+
artifact {
113+
path = 'gradle-open-java-format/build/libs/gradle-open-java-format-{{projectVersion}}.jar'
114+
}
111115
artifact {
112116
path = 'open-java-format-idea-plugin/build/distributions/open-java-format-idea-plugin-{{projectVersion}}.zip'
113117
}
@@ -163,8 +167,8 @@ tasks.named('jreleaserDeploy') {
163167

164168
tasks.named('jreleaserRelease') {
165169
if (releaseTarget == 'github') {
166-
dependsOn ':open-java-format:allJar', ':open-java-format-idea-plugin:buildPlugin',
167-
':open-java-format-eclipse-plugin:jar'
170+
dependsOn ':open-java-format:allJar', ':gradle-open-java-format:jar',
171+
':open-java-format-idea-plugin:buildPlugin', ':open-java-format-eclipse-plugin:jar'
168172
}
169173
}
170174

0 commit comments

Comments
 (0)