Skip to content

Commit 90dc45b

Browse files
Add reproducible builds configuration
1 parent a48e289 commit 90dc45b

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/releaseExtension.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ jobs:
1919
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5
2020
- name: Build Zip
2121
run: ./gradlew hivemqExtensionZip
22+
- name: Generate SHA256 checksum
23+
run: |
24+
cd build/hivemq-extension
25+
sha256sum hivemq-azure-cluster-discovery-extension-${{ github.event.release.name }}.zip | cut -d' ' -f1 > hivemq-azure-cluster-discovery-extension-${{ github.event.release.name }}.sha256
2226
- name: Upload GitHub Release Asset
2327
run: gh release upload ${{ github.event.release.tag_name }} ./build/hivemq-extension/hivemq-azure-cluster-discovery-extension-${{ github.event.release.name }}.zip
2428
env:
2529
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Upload SHA256 Checksum
31+
run: gh release upload ${{ github.event.release.tag_name }} ./build/hivemq-extension/hivemq-azure-cluster-discovery-extension-${{ github.event.release.name }}.sha256
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,26 @@ license {
108108
header = rootDir.resolve("HEADER")
109109
mapping("java", "SLASHSTAR_STYLE")
110110
}
111+
112+
// configure reproducible builds
113+
tasks.withType<AbstractArchiveTask>().configureEach {
114+
isPreserveFileTimestamps = false
115+
isReproducibleFileOrder = true
116+
117+
// normalize file permissions for reproducibility
118+
// files: 0644 (rw-r--r--), directories: 0755 (rwxr-xr-x)
119+
filePermissions {
120+
unix("0644")
121+
}
122+
dirPermissions {
123+
unix("0755")
124+
}
125+
}
126+
127+
tasks.withType<JavaCompile>().configureEach {
128+
options.encoding = "UTF-8"
129+
// ensure consistent compilation across different JDK versions
130+
options.compilerArgs.addAll(listOf(
131+
"-parameters" // include parameter names for reflection (improves consistency)
132+
))
133+
}

gradle.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
version=1.2.3
2+
3+
# reproducible builds configuration
4+
org.gradle.caching=true
5+
systemProp.file.encoding=UTF-8
6+
7+
# JVM settings for consistent builds
8+
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US
9+
10+
# ensure consistent behavior across environments
11+
org.gradle.parallel=true
12+
org.gradle.daemon=true

0 commit comments

Comments
 (0)