1
1
name : Reproducible binary
2
2
3
+ # This workflow waits for release signatures to appear on Maven Central,
4
+ # then rebuilds the artifacts and verifies them against those signatures,
5
+ # and finally uploads the signatures to the GitHub release.
6
+
3
7
on :
4
8
release :
5
9
types : [published, edited]
6
10
7
11
jobs :
12
+ download :
13
+ name : Download keys and signatures
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Fetch keys
18
+ run : gpg --no-default-keyring --keyring ./yubico.keyring --keyserver hkps://keys.openpgp.org --recv-keys 57A9DEED4C6D962A923BB691816F3ED99921835E
19
+
20
+ - name : Download signatures from Maven Central
21
+ timeout-minutes : 60
22
+ run : |
23
+ until wget https://repo1.maven.org/maven2/com/yubico/webauthn-server-attestation/${{ github.ref_name }}/webauthn-server-attestation-${{ github.ref_name }}.jar.asc; do sleep 180; done
24
+ until wget https://repo1.maven.org/maven2/com/yubico/webauthn-server-core/${{ github.ref_name }}/webauthn-server-core-${{ github.ref_name }}.jar.asc; do sleep 180; done
25
+
26
+ - name : Store keyring and signatures as artifact
27
+ uses : actions/upload-artifact@v3
28
+ with :
29
+ name : keyring-and-signatures
30
+ retention-days : 1
31
+ path : |
32
+ yubico.keyring
33
+ *.jar.asc
34
+
8
35
verify :
9
36
name : Verify signatures (JDK ${{ matrix.java }} ${{ matrix.distribution }})
10
-
37
+ needs : download
11
38
runs-on : ubuntu-latest
39
+
12
40
strategy :
13
41
matrix :
14
42
java : [17]
@@ -31,21 +59,34 @@ jobs:
31
59
java --version
32
60
./gradlew jar
33
61
34
- - name : Fetch keys
35
- run : gpg --no-default-keyring --keyring ./yubico.keyring --keyserver hkps://keys.openpgp.org --recv-keys 57A9DEED4C6D962A923BB691816F3ED99921835E
62
+ - name : Retrieve keyring and signatures
63
+ uses : actions/download-artifact@v3
64
+ with :
65
+ name : keyring-and-signatures
36
66
37
- - name : Verify signatures from GitHub release
67
+ - name : Verify signatures from Maven Central
38
68
run : |
39
- wget https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ github.ref_name }}/webauthn-server-attestation-${{ github.ref_name }}.jar.asc
40
- wget https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ github.ref_name }}/webauthn-server-core-${{ github.ref_name }}.jar.asc
41
-
42
69
gpg --no-default-keyring --keyring ./yubico.keyring --verify webauthn-server-attestation-${{ github.ref_name }}.jar.asc webauthn-server-attestation/build/libs/webauthn-server-attestation-${{ github.ref_name }}.jar
43
70
gpg --no-default-keyring --keyring ./yubico.keyring --verify webauthn-server-core-${{ github.ref_name }}.jar.asc webauthn-server-core/build/libs/webauthn-server-core-${{ github.ref_name }}.jar
44
71
45
- - name : Verify signatures from Maven Central
72
+ upload :
73
+ name : Upload signatures to GitHub
74
+ needs : verify
75
+ runs-on : ubuntu-latest
76
+
77
+ permissions :
78
+ contents : write # Allow uploading release artifacts
79
+
80
+ steps :
81
+ - name : Retrieve signatures
82
+ uses : actions/download-artifact@v3
83
+ with :
84
+ name : keyring-and-signatures
85
+
86
+ - name : Upload signatures to GitHub
46
87
run : |
47
- wget -O webauthn-server-core- ${{ github.ref_name }}.jar.mavencentral.asc https://repo1.maven.org/maven2/com/yubico/webauthn-server-core/ ${{ github.ref_name }}/webauthn-server-core- ${{ github.ref_name }}.jar.asc
48
- wget -O webauthn-server-attestation-${{ github.ref_name }}.jar.mavencentral.asc https://repo1.maven.org/maven2/com/yubico/webauthn-server-attestation/${{ github.ref_name }}/webauthn-server-attestation-${{ github.ref_name }}.jar.asc
88
+ RELEASE_DATA=$(curl -H "Authorization: Bearer ${{ github.token }}" ${{ github.api_url }}/repos/ ${{ github.repository }}/releases/tags/ ${{ github.ref_name }})
89
+ UPLOAD_URL=$(jq -r .upload_url <<<"${RELEASE_DATA}" | sed 's/{?name,label}//')
49
90
50
- gpg --no-default-keyring --keyring ./yubico.keyring --verify webauthn-server-attestation-${{ github.ref_name }}.jar.mavencentral. asc webauthn-server-attestation/build/libs/webauthn-server-attestation- ${{ github.ref_name }}.jar
51
- gpg --no-default-keyring --keyring ./yubico.keyring --verify webauthn-server-core-${{ github.ref_name }}.jar.mavencentral. asc webauthn-server-core/build/libs/webauthn-server-core- ${{ github.ref_name }}.jar
91
+ curl -X POST -H "Authorization: Bearer ${{ github.token }}" -H 'Content-Type: text/plain' --data-binary @ webauthn-server-attestation-${{ github.ref_name }}.jar.asc "${UPLOAD_URL}?name= webauthn-server-attestation- ${{ github.ref_name }}.jar.asc"
92
+ curl -X POST -H "Authorization: Bearer ${{ github.token }}" -H 'Content-Type: text/plain' --data-binary @ webauthn-server-core-${{ github.ref_name }}.jar.asc "${UPLOAD_URL}?name= webauthn-server-core- ${{ github.ref_name }}.jar.asc"
0 commit comments