Skip to content

Commit 16d7066

Browse files
committed
Check JDK version before building release
1 parent 499e185 commit 16d7066

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ task assembleJavadoc(type: Sync) {
116116
destinationDir = file("${rootProject.buildDir}/javadoc")
117117
}
118118

119+
task checkJavaVersionBeforeRelease {
120+
doFirst {
121+
if (JavaVersion.current() != JavaVersion.VERSION_17) {
122+
throw new RuntimeException('Release must be built using JDK 17. Current JDK version: ' + JavaVersion.current())
123+
}
124+
}
125+
}
126+
119127
subprojects { project ->
120128

121129
if (project.plugins.hasPlugin('scala')) {
@@ -148,16 +156,19 @@ subprojects { project ->
148156
reproducibleFileOrder = true
149157
}
150158

151-
tasks.withType(Sign) {
152-
it.dependsOn check
153-
}
154-
155159
tasks.withType(AbstractTestTask) {
156160
testLogging {
157161
showStandardStreams = isCiBuild
158162
}
159163
}
160164

165+
tasks.withType(AbstractCompile) { shouldRunAfter checkJavaVersionBeforeRelease }
166+
tasks.withType(AbstractTestTask) { shouldRunAfter checkJavaVersionBeforeRelease }
167+
tasks.withType(Sign) {
168+
it.dependsOn check
169+
dependsOn checkJavaVersionBeforeRelease
170+
}
171+
161172
if (project.hasProperty('publishMe') && project.publishMe) {
162173
task sourcesJar(type: Jar) {
163174
archiveClassifier = 'sources'

doc/releasing.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,27 @@ Release candidate versions
66

77
1. Make sure release notes in `NEWS` are up to date.
88

9-
2. Make sure you're running Gradle in JDK 17.
10-
11-
3. Run the tests one more time:
9+
2. Run the tests one more time:
1210

1311
```
1412
$ ./gradlew clean check
1513
```
1614
17-
4. Tag the head commit with an `X.Y.Z-RCN` tag:
15+
3. Tag the head commit with an `X.Y.Z-RCN` tag:
1816
1917
```
2018
$ git tag -a -s 1.4.0-RC1 -m "Pre-release 1.4.0-RC1"
2119
```
2220
2321
No tag body needed.
2422
25-
5. Publish to Sonatype Nexus:
23+
4. Publish to Sonatype Nexus:
2624
2725
```
2826
$ ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
2927
```
3028
31-
6. Push to GitHub.
29+
5. Push to GitHub.
3230
3331
If the pre-release makes significant changes to the project README, such
3432
that the README does not accurately reflect the latest non-pre-release
@@ -46,7 +44,7 @@ Release candidate versions
4644
$ git push origin main 1.4.0-RC1
4745
```
4846
49-
7. Make GitHub release.
47+
6. Make GitHub release.
5048
5149
- Use the new tag as the release tag
5250
- Check the pre-release checkbox
@@ -55,7 +53,7 @@ Release candidate versions
5553
changes/additions since the previous release or pre-release.
5654
- Note which JDK version was used to build the artifacts.
5755
58-
8. Check that the ["Reproducible binary"
56+
7. Check that the ["Reproducible binary"
5957
workflow](/Yubico/java-webauthn-server/actions/workflows/release-verify-signatures.yml)
6058
runs and succeeds.
6159
@@ -65,9 +63,7 @@ Release versions
6563
6664
1. Make sure release notes in `NEWS` are up to date.
6765
68-
2. Make sure you're running Gradle in JDK 17.
69-
70-
3. Make a no-fast-forward merge from the last (non release candidate) release
66+
2. Make a no-fast-forward merge from the last (non release candidate) release
7167
to the commit to be released:
7268
7369
```
@@ -89,53 +85,53 @@ Release versions
8985
$ git branch -d release-1.4.0
9086
```
9187
92-
4. Remove the "(unreleased)" tag from `NEWS`.
88+
3. Remove the "(unreleased)" tag from `NEWS`.
9389
94-
5. Update the version in the dependency snippets in the README.
90+
4. Update the version in the dependency snippets in the README.
9591
96-
6. Update the version in JavaDoc links in the READMEs.
92+
5. Update the version in JavaDoc links in the READMEs.
9793
98-
7. Amend these changes into the merge commit:
94+
6. Amend these changes into the merge commit:
9995
10096
```
10197
$ git add NEWS
10298
$ git commit --amend --reset-author
10399
```
104100
105-
8. Run the tests one more time:
101+
7. Run the tests one more time:
106102
107103
```
108104
$ ./gradlew clean check
109105
```
110106
111-
9. Tag the merge commit with an `X.Y.Z` tag:
107+
8. Tag the merge commit with an `X.Y.Z` tag:
112108
113109
```
114110
$ git tag -a -s 1.4.0 -m "Release 1.4.0"
115111
```
116112
117113
No tag body needed since that's included in the commit.
118114
119-
10. Publish to Sonatype Nexus:
115+
9. Publish to Sonatype Nexus:
120116
121117
```
122118
$ ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
123119
```
124120
125-
11. Push to GitHub:
121+
10. Push to GitHub:
126122
127123
```
128124
$ git push origin main 1.4.0
129125
```
130126
131-
12. Make GitHub release.
127+
11. Make GitHub release.
132128
133129
- Use the new tag as the release tag
134130
- Copy the release notes from `NEWS` into the GitHub release notes; reformat
135131
from ASCIIdoc to Markdown and remove line wraps. Include all changes since
136132
the previous release (not just changes since the previous pre-release).
137133
- Note which JDK version was used to build the artifacts.
138134
139-
13. Check that the ["Reproducible binary"
135+
12. Check that the ["Reproducible binary"
140136
workflow](/Yubico/java-webauthn-server/actions/workflows/release-verify-signatures.yml)
141137
runs and succeeds.

0 commit comments

Comments
 (0)