generate checksum on release

This commit is contained in:
Chris
2023-09-13 15:26:34 -06:00
parent 05ad77e7c9
commit 9468928f43
4 changed files with 36 additions and 3 deletions

View File

@ -5,6 +5,9 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
jobs:
release:
name: Release
@ -41,14 +44,19 @@ jobs:
if: ${{ matrix.target == 'linux-x64' }}
run: ./publish.sh
- name: Create Checksums
run: ci/checksums.sh
- name: Create Release Notes
run: ci/latest-changes.sh > release-notes.txt
run: ci/release-notes.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: "artifacts/min-ed-launcher*"
body_path: release-notes.txt
body_path: release-notes.md
files: |
artifacts/min-ed-launcher*
artifacts/shasum.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View File

@ -2,6 +2,8 @@ investigation/
src/EdLauncher/epic-sdk-details.txt
lib/*
!lib/libsteam_api.so
release-notes.md
benchmarks/MinEdLauncher.Benchmarks/BenchmarkDotNet.Artifacts/
## rust
target/

9
ci/checksums.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
file_name=shasum.txt
pushd $(dirname "$(readlink -f "$0")")/../artifacts > /dev/null
find . -type f ! -name $file_name -printf '%P\n' | xargs shasum -a 256 -b > $file_name
cat $file_name
popd > /dev/null

14
ci/release-notes.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
root=$(dirname "$(readlink -f "$0")")/..
release_notes="$root"/release-notes.md
"$root"/ci/latest-changes.sh > "$release_notes"
echo -n "-----
Verify the release artifacts are built from source by Github by comparing the _shasum.txt_ contents with the the _Create Checksums_ section of the job log of the [automated release].
See [wiki] for instructions on how to check the checksums of the release artifacts.
[automated release]: ${BUILD_URL:-https://github.com/rfvgyhn/min-ed-launcher/actions}
[wiki]: https://github.com/rfvgyhn/min-ed-launcher/wiki/Verify-Checksums-for-a-Release" >> "$release_notes"