Skip to content

Commit 20a498d

Browse files
committed
Replace single sha256 files with a combined one before publishing
1 parent f0bd79a commit 20a498d

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,23 +292,20 @@ jobs:
292292
env:
293293
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
294294

295-
# This checks the draft release on GitHub and publishes it. It does not upload to crates.io.
296-
publish-release:
297-
name: publish-release
295+
check-release:
296+
name: check-release
298297

299298
runs-on: ubuntu-latest
300299

301300
needs: [ create-release, build-release, build-macos-universal2-release ]
302301

303-
env:
304-
REPOSITORY: ${{ github.repository }}
305-
VERSION: ${{ needs.create-release.outputs.version }}
306-
307302
steps:
308303
- name: Discover assets
309304
run: |
310305
gh release --repo="$REPOSITORY" view "$VERSION" --json assets --jq '.assets.[].name' > assets.txt
311306
env:
307+
REPOSITORY: ${{ github.repository }}
308+
VERSION: ${{ needs.create-release.outputs.version }}
312309
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
313310

314311
- name: Show all asset names
@@ -329,8 +326,34 @@ jobs:
329326
diff -- <(mask aarch64) <(mask universal)
330327
diff -- <(mask x86_64) <(mask universal)
331328
329+
publish-release:
330+
name: publish-release
331+
332+
runs-on: ubuntu-latest
333+
334+
needs: [ create-release, check-release ]
335+
336+
env:
337+
REPOSITORY: ${{ github.repository }}
338+
VERSION: ${{ needs.create-release.outputs.version }}
339+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
340+
341+
steps:
342+
- name: Retrieve individual checksums
343+
run: gh release --repo="$REPOSITORY" download "$VERSION" --pattern='gitoxide-*.sha256'
344+
345+
- name: Concatenate checksums into one file
346+
run: cat gitoxide-*.sha256 > hashes.sha256
347+
348+
- name: Upload the combined checksum file
349+
run: gh release --repo="$REPOSITORY" upload "$VERSION" hashes.sha256
350+
351+
- name: Discard the individual checksum files
352+
run: |
353+
for sumfile in gitoxide-*.sha256; do
354+
gh release --repo="$REPOSITORY" delete-asset "$VERSION" "$sumfile" --yes
355+
done
356+
332357
- name: Publish the release
333358
if: false
334359
run: gh release --repo="$REPOSITORY" edit "$VERSION" --draft=false
335-
env:
336-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)