79
79
otp : ${{ matrix.otp }}
80
80
build_docs : ${{ matrix.build_docs }}
81
81
82
- - name : " Sign files with Trusted Signing"
83
- if : github.repository == 'elixir-lang/elixir'
84
-
85
- with :
86
- azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
87
- azure-client-id : ${{ secrets.AZURE_CLIENT_ID }}
88
- azure-client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
89
- endpoint : https://eus.codesigning.azure.net/
90
- trusted-signing-account-name : trusted-signing-elixir
91
- certificate-profile-name : Elixir
92
- files-folder : ${{ github.workspace }}
93
- files-folder-filter : exe
94
- file-digest : SHA256
95
- timestamp-rfc3161 : http://timestamp.acs.microsoft.com
96
- timestamp-digest : SHA256
97
-
98
- - name : " Attest release .exe provenance"
99
- uses : actions/attest-build-provenance@v2
100
- id : attest-exe-provenance
101
- with :
102
- subject-path : " elixir-otp-${{ matrix.otp }}.exe"
103
- - name : " Copy release .exe provenance"
104
- run : cp "$ATTESTATION" elixir-otp-${{ matrix.otp }}.exe.sigstore
105
- env :
106
- ATTESTATION : " ${{ steps.attest-exe-provenance.outputs.bundle-path }}"
107
-
108
- - name : " Attest release .zip provenance"
109
- uses : actions/attest-build-provenance@v2
110
- id : attest-zip-provenance
111
- with :
112
- subject-path : " elixir-otp-${{ matrix.otp }}.zip"
113
- - name : " Copy release .zip provenance"
114
- run : cp "$ATTESTATION" elixir-otp-${{ matrix.otp }}.zip.sigstore
115
- env :
116
- ATTESTATION : " ${{ steps.attest-zip-provenance.outputs.bundle-path }}"
117
-
118
82
- name : " Attest docs provenance"
119
83
uses : actions/attest-build-provenance@v2
120
84
id : attest-docs-provenance
@@ -127,42 +91,108 @@ jobs:
127
91
env :
128
92
ATTESTATION : " ${{ steps.attest-docs-provenance.outputs.bundle-path }}"
129
93
130
- - name : Create Release Hashes
131
- run : |
132
- shasum -a 1 elixir-otp-${{ matrix.otp }}.zip > elixir-otp-${{ matrix.otp }}.zip.sha1sum
133
- shasum -a 256 elixir-otp-${{ matrix.otp }}.zip > elixir-otp-${{ matrix.otp }}.zip.sha256sum
134
- shasum -a 1 elixir-otp-${{ matrix.otp }}.exe > elixir-otp-${{ matrix.otp }}.exe.sha1sum
135
- shasum -a 256 elixir-otp-${{ matrix.otp }}.exe > elixir-otp-${{ matrix.otp }}.exe.sha256sum
136
94
- name : Create Docs Hashes
137
95
if : ${{ matrix.build_docs }}
138
96
run : |
139
97
shasum -a 1 Docs.zip > Docs.zip.sha1sum
140
98
shasum -a 256 Docs.zip > Docs.zip.sha256sum
141
99
142
- - name : " Upload release artifacts"
100
+ - name : " Upload linux release artifacts"
101
+ uses : actions/upload-artifact@v4
102
+ with :
103
+ name : build-linux-elixir-otp-${{ matrix.otp }}
104
+ path : elixir-otp-${{ matrix.otp }}.zip
105
+
106
+ - name : " Upload windows release artifacts"
143
107
uses : actions/upload-artifact@v4
144
108
with :
145
- name : elixir-otp-${{ matrix.otp }}
146
- path : elixir-otp-${{ matrix.otp }}*
109
+ name : build-windows- elixir-otp-${{ matrix.otp }}
110
+ path : elixir-otp-${{ matrix.otp }}.exe
147
111
148
112
- name : " Upload doc artifacts"
149
113
uses : actions/upload-artifact@v4
150
114
if : ${{ matrix.build_docs }}
151
115
with :
152
116
name : Docs
153
117
path : Docs.zip*
118
+
119
+ sign :
120
+ needs : [build]
121
+ strategy :
122
+ fail-fast : true
123
+ matrix :
124
+ otp : [26, 27]
125
+ flavor : [windows, linux]
154
126
155
- upload-release :
156
- needs : [build, create_draft_release]
157
- runs-on : windows-2022
127
+ env :
128
+ RELEASE_FILE : elixir-otp-${{ matrix.otp }}.${{ matrix.flavor == 'linux' && 'zip' || 'exe' }}
129
+
130
+ runs-on : ${{ matrix.flavor == 'linux' && 'ubuntu-22.04' || 'windows-2022' }}
158
131
159
132
steps :
160
133
- uses : actions/download-artifact@v4
134
+ with :
135
+ name : build-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
161
136
162
- - run : |
163
- mv elixir-otp-*/* .
164
- mv Docs/* .
137
+ - name : " Sign files with Trusted Signing"
138
+ if : github.repository == 'elixir-lang/elixir' && matrix.flavor == 'windows'
139
+
140
+ with :
141
+ azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
142
+ azure-client-id : ${{ secrets.AZURE_CLIENT_ID }}
143
+ azure-client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
144
+ endpoint : https://eus.codesigning.azure.net/
145
+ trusted-signing-account-name : trusted-signing-elixir
146
+ certificate-profile-name : Elixir
147
+ files-folder : ${{ github.workspace }}
148
+ files-folder-filter : exe
149
+ file-digest : SHA256
150
+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
151
+ timestamp-digest : SHA256
152
+
153
+ - name : " Attest release provenance"
154
+ uses : actions/attest-build-provenance@v2
155
+ id : attest-provenance
156
+ with :
157
+ subject-path : ${{ env.RELEASE_FILE }}
158
+ - name : " Copy release .zip provenance"
165
159
shell : bash
160
+ run : cp "$ATTESTATION" "${RELEASE_FILE}.sigstore"
161
+ env :
162
+ ATTESTATION : " ${{ steps.attest-provenance.outputs.bundle-path }}"
163
+
164
+ - name : Create Release Hashes
165
+ if : matrix.flavor == 'windows'
166
+ shell : pwsh
167
+ run : |
168
+ $sha1 = Get-FileHash "$env:RELEASE_FILE" -Algorithm SHA1
169
+ $sha1.Hash.ToLower() + " " + $env:RELEASE_FILE | Out-File "$env:RELEASE_FILE.sha1sum"
170
+
171
+ $sha256 = Get-FileHash "$env:RELEASE_FILE" -Algorithm SHA256
172
+ $sha256.Hash.ToLower() + " " + $env:RELEASE_FILE | Out-File "$env:RELEASE_FILE.sha256sum"
173
+
174
+ - name : Create Release Hashes
175
+ if : matrix.flavor == 'linux'
176
+ shell : bash
177
+ run : |
178
+ shasum -a 1 "$RELEASE_FILE" > "${RELEASE_FILE}.sha1sum"
179
+ shasum -a 256 "$RELEASE_FILE" > "${RELEASE_FILE}.sha256sum"
180
+
181
+ - name : " Upload linux release artifacts"
182
+ uses : actions/upload-artifact@v4
183
+ with :
184
+ name : sign-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
185
+ path : ${{ env.RELEASE_FILE }}*
186
+
187
+ upload-release :
188
+ needs : [create_draft_release, build, sign]
189
+ runs-on : ubuntu-22.04
190
+
191
+ steps :
192
+ - uses : actions/download-artifact@v4
193
+ with :
194
+ pattern : ' {sign-*-elixir-otp-*,Docs}'
195
+ merge-multiple : true
166
196
167
197
- name : Upload Pre-built
168
198
shell : bash
@@ -190,7 +220,7 @@ jobs:
190
220
Docs.zip.sigstore
191
221
192
222
upload-builds-hex-pm :
193
- needs : build
223
+ needs : [ build, sign]
194
224
runs-on : ubuntu-22.04
195
225
concurrency : builds-hex-pm
196
226
env :
@@ -204,6 +234,9 @@ jobs:
204
234
OTP_GENERIC_VERSION : " 25"
205
235
steps :
206
236
- uses : actions/download-artifact@v4
237
+ with :
238
+ pattern : ' {sign-*-elixir-otp-*,Docs}'
239
+ merge-multiple : true
207
240
208
241
- name : Init purge keys file
209
242
run : |
@@ -213,7 +246,6 @@ jobs:
213
246
run : |
214
247
ref_name=${{ github.ref_name }}
215
248
216
- mv elixir-otp-*/* .
217
249
for zip in $(find . -type f -name 'elixir-otp-*.zip' | sed 's/^\.\///'); do
218
250
dest=${zip/elixir/${ref_name}}
219
251
surrogate_key=${dest/.zip$/}
0 commit comments