Skip to content

Commit 773590b

Browse files
Merge pull request #19 from cryptomator/feature/reproducible-builds
Reproducible Builds
2 parents 98fc890 + 715d6a9 commit 773590b

File tree

10 files changed

+615
-30
lines changed

10 files changed

+615
-30
lines changed

.github/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .github/release.yml
2+
# see https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
3+
4+
changelog:
5+
exclude:
6+
authors:
7+
- cryptobot
8+
- dependabot
9+
- github-actions
10+
categories:
11+
- title: What's New 🎉
12+
labels:
13+
- enhancement
14+
- title: Bugfixes 🐛
15+
labels:
16+
- bug
17+
- title: Other Changes 📎
18+
labels:
19+
- "*"
20+
exclude:
21+
labels:
22+
- bug
23+
- enhancement

.github/workflows/build.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
fetch-depth: 0
1313
- uses: actions/setup-java@v3
1414
with:
15-
java-version: 11
16-
distribution: 'temurin'
15+
java-version: 21
16+
distribution: 'zulu'
1717
cache: 'maven'
1818
- name: Cache SonarCloud packages
1919
uses: actions/cache@v3
@@ -23,11 +23,10 @@ jobs:
2323
restore-keys: ${{ runner.os }}-sonar
2424
- name: Ensure to use tagged version
2525
if: startsWith(github.ref, 'refs/tags/')
26-
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
26+
run: ./mvnw versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
2727
- name: Build and Test
28-
id: buildAndTest
2928
run: >
30-
mvn -B verify
29+
./mvnw -B verify
3130
jacoco:report
3231
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
3332
-Pcoverage,dependency-check
@@ -41,12 +40,33 @@ jobs:
4140
with:
4241
name: artifacts
4342
path: target/*.jar
43+
- name: Calculate Checksums
44+
id: checksums
45+
run: |
46+
{
47+
echo 'sha256<<EOF'
48+
shasum -a256 target/*.jar
49+
echo EOF
50+
} >> $GITHUB_OUTPUT
4451
- name: Create Release
45-
uses: actions/create-release@v1 # NOTE: action is unmaintained and archived
4652
if: startsWith(github.ref, 'refs/tags/')
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
53+
uses: softprops/action-gh-release@v1
4954
with:
50-
tag_name: ${{ github.ref }}
51-
release_name: Release ${{ github.ref }}
52-
prerelease: true
55+
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
56+
body: |-
57+
## Maven Coordinates
58+
```xml
59+
<dependency>
60+
<groupId>org.cryptomator</groupId>
61+
<artifactId>siv-mode</artifactId>
62+
<version>${{ github.ref_name }}</version>
63+
</dependency>
64+
```
65+
66+
## Artifact Checksums
67+
```txt
68+
${{ steps.checksums.outputs.sha256 }}
69+
```
70+
71+
See [README.md](../#reproducible-builds) section regarding reproducing this build.
72+
generate_release_notes: true

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
fetch-depth: 2
2121
- uses: actions/setup-java@v3
2222
with:
23-
java-version: 11
24-
distribution: 'temurin'
23+
java-version: 21
24+
distribution: 'zulu'
2525
cache: 'maven'
2626
- name: Initialize CodeQL
2727
uses: github/codeql-action/init@v2
2828
with:
2929
languages: java
3030
- name: Build and Test
31-
run: mvn -B install -DskipTests
31+
run: ./mvnw -B install -DskipTests
3232
- name: Perform CodeQL Analysis
3333
uses: github/codeql-action/analyze@v2

.github/workflows/publish-central.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ jobs:
1515
ref: "refs/tags/${{ github.event.inputs.tag }}"
1616
- uses: actions/setup-java@v3
1717
with:
18-
java-version: 11
19-
distribution: 'temurin'
18+
java-version: 21
19+
distribution: 'zulu'
2020
cache: 'maven'
2121
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
2222
server-username: MAVEN_USERNAME # env variable for username in deploy
2323
server-password: MAVEN_PASSWORD # env variable for token in deploy
2424
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
2525
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
26-
- name: Enforce project version ${{ github.event.inputs.tag }}
27-
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
26+
- name: Verify project version = ${{ github.event.release.tag_name }}
27+
run: |
28+
PROJECT_VERSION=$(./mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout)
29+
test "$PROJECT_VERSION" = "${{ github.event.release.tag_name }}"
2830
- name: Deploy
29-
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
31+
run: ./mvnw deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
3032
env:
3133
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3234
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

.github/workflows/publish-github.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-java@v3
1212
with:
13-
java-version: 11
14-
distribution: 'temurin'
13+
java-version: 21
14+
distribution: 'zulu'
1515
cache: 'maven'
1616
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
1717
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
18-
- name: Enforce project version ${{ github.event.release.tag_name }}
19-
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
18+
- name: Verify project version = ${{ github.event.release.tag_name }}
19+
run: |
20+
PROJECT_VERSION=$(./mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout)
21+
test "$PROJECT_VERSION" = "${{ github.event.release.tag_name }}"
2022
- name: Deploy
21-
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
23+
run: ./mvnw deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
2224
env:
2325
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}

.mvn/wrapper/maven-wrapper.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void encryptWithAssociatedData() {
5353
</dependencies>
5454
```
5555

56-
## JPMS
56+
## Java Module
5757

5858
From version 1.3.2 onwards this library is an explicit module with the name `org.cryptomator.siv`. You can use it by adding the following line to your `module-info.java`.
5959

@@ -63,11 +63,15 @@ requires org.cryptomator.siv;
6363

6464
Because BouncyCastle classes are shaded, this library only depends on `java.base`.
6565

66-
## Building
66+
## Reproducible Builds
6767

68-
This is a Maven project. To build it, run `mvn clean install`.
68+
This is a Maven project that can be built using `mvn install`. However, if you want to build this reproducibly, please make sure:
6969

70-
Requires JDK 11.0.3 or newer at build time due to JPMS support.
70+
1. Use the same build environment
71+
* The same [JDK as our CI builds](https://github.com/cryptomator/siv-mode/blob/develop/.github/workflows/build.yml#L15-L16)
72+
* Ideally the same same arch and OS (x86_64 Linux)
73+
* Same locale (en_US) and linebreaks (POSIX)
74+
2. Use `./mvnw install` instead (or `./mvnw verify` or `./mvnw package -DskipTests`, depending on your intentions)
7175

7276
## License
7377
Distributed under the MIT X Consortium license. See the LICENSE file for more info.

0 commit comments

Comments
 (0)