File tree Expand file tree Collapse file tree 3 files changed +34
-9
lines changed Expand file tree Collapse file tree 3 files changed +34
-9
lines changed Original file line number Diff line number Diff line change 11name : Release
22on :
33 release :
4- types : [published]
4+ types : [ published ]
55env :
66 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77 JAVA_VERSION : ' 17.0.15' # this must be a specific version for reproducible builds
@@ -49,13 +49,18 @@ jobs:
4949 uses : grails/github-actions/pre-release@asf
5050 env :
5151 RELEASE_VERSION : ${{ steps.release_version.outputs.value }}
52- - name : " 🧩 Run Assemble"
53- id : assemble
54- run : ./gradlew -U assemble
5552 - name : " 🔐 Generate key file for artifact signing"
5653 env :
5754 SECRING_FILE : ${{ secrets.SECRING_FILE }}
5855 run : echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
56+ - name : " 🧩 Run Assemble"
57+ id : assemble
58+ run : |
59+ ./gradlew -U assemble -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
60+ env :
61+ GRAILS_PUBLISH_RELEASE : ' true'
62+ SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
63+ SIGNING_PASSPHRASE : ${{ secrets.SIGNING_PASSPHRASE }}
5964 - name : " 📤 Publish to Maven Central"
6065 env :
6166 GRAILS_PUBLISH_RELEASE : ' true'
Original file line number Diff line number Diff line change 1+ import java.time.Instant
2+ import java.time.ZoneOffset
3+ import java.time.format.DateTimeFormatter
4+
15version = projectVersion
26group = ' org.grails.plugins'
37
@@ -17,6 +21,16 @@ repositories {
1721 }
1822}
1923
24+ ext {
25+ buildInstant = java.util.Optional . ofNullable(System . getenv(" SOURCE_DATE_EPOCH" ))
26+ .filter(s -> ! s. isEmpty())
27+ .map(Long ::parseLong)
28+ .map(Instant ::ofEpochSecond)
29+ .orElseGet(Instant ::now)
30+ formattedBuildDate = DateTimeFormatter . ISO_INSTANT . format(buildInstant)
31+ buildDate = (buildInstant as Instant ). atZone(ZoneOffset . UTC ) // for reproducible builds
32+ }
33+
2034dependencies {
2135
2236 compileOnly platform(" org.apache.grails:grails-bom:$grailsVersion " )
Original file line number Diff line number Diff line change @@ -5,23 +5,29 @@ plugins {
55
66def isCI = System . getenv(). containsKey(' CI' )
77def isLocal = ! isCI
8- def isAuthenticated = System . getenv(). containsKey(' DEVELOCITY_ACCESS_KEY' )
8+ def isReproducibleBuild = System . getenv(' SOURCE_DATE_EPOCH' ) != null
9+ if (isReproducibleBuild) {
10+ gradle. settingsEvaluated {
11+ logger. warn(' *************** Remote Build Cache Disabled due to Reproducible Build ********************' )
12+ logger. warn(" Build date will be set to (SOURCE_DATE_EPOCH=${ System.getenv("SOURCE_DATE_EPOCH")} )" )
13+ }
14+ }
915
1016develocity {
1117 server = ' https://ge.grails.org'
1218 buildScan {
1319 tag(' grails-plugins' )
1420 tag(' grails-mail' )
15- publishing. onlyIf { isAuthenticated }
21+ publishing. onlyIf { it . authenticated }
1622 uploadInBackground = isLocal
1723 }
1824}
1925
2026buildCache {
21- local { enabled = isLocal }
27+ local { enabled = ( isLocal && ! isReproducibleBuild) || (isCI && isReproducibleBuild) }
2228 remote(develocity. buildCache) {
23- push = isCI && isAuthenticated
24- enabled = true
29+ push = isCI
30+ enabled = ! isReproducibleBuild
2531 }
2632}
2733
You can’t perform that action at this time.
0 commit comments