From 771c35ed278a55085feaa7448b83813a9da501a9 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sun, 7 Aug 2022 13:49:25 +0200 Subject: [PATCH] put sha1sum into release notes --- .github/actions/build/action.yml | 10 ++++++++++ .github/actions/release/action.yml | 6 +++++- .github/workflows/release.yml | 10 ++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index a2b844a0..d6a19a86 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -12,6 +12,9 @@ outputs: filename: description : 'Filename for the build artifacts' value : ${{ steps.env.outputs.filename }} + sha1sum: + description : 'Hashes of the output files' + value : ${{ steps.build.outputs.sha1sum }} runs: @@ -43,9 +46,16 @@ runs: cache-to : type=gha,scope=smo-downgrade-build,mode=max - name : Build mod + id : build shell : bash run: | ./docker-build.sh ${{ (steps.env.outputs.version != '' && steps.env.outputs.version) || '' }} + cd ./out/ + hashes=`sha1sum ${{ steps.env.outputs.filename }}.*` + hashes="${hashes//'%'/'%25'}" + hashes="${hashes//$'\n'/'%0A'}" + hashes="${hashes//$'\r'/'%0D'}" + echo "::set-output name=sha1sum::$hashes" - name : Upload artifacts uses : actions/upload-artifact@v3 diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index e0d55769..a64162b5 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -5,6 +5,10 @@ inputs: tag: description : 'Version tag' required : true + body: + description : 'Release description' + required : false + default : '' GITHUB_TOKEN: description : 'Secret GitHub token required to create the release' required : true @@ -31,6 +35,6 @@ runs: with: tag_name : ${{ inputs.tag }} release_name : Release ${{ inputs.tag }} - body : '' + body : ${{ inputs.body }} draft : true prerelease : false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a8082ba..27f2edbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,8 @@ jobs: build: runs-on: ubuntu-latest outputs: - filename: ${{ steps.build.outputs.filename }} + filename : ${{ steps.build.outputs.filename }} + sha1sum : ${{ steps.build.outputs.sha1sum }} steps: - name : Checkout @@ -38,7 +39,12 @@ jobs: id : release uses : ./.github/actions/release with: - tag : ${{ github.ref_name }} + tag : ${{ github.ref_name }} + body : | + ``` + $ sha1sum ${{ needs.build.outputs.filename }}.* + ${{ needs.build.outputs.sha1sum }} + ``` GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} - name : Attach build artifacts to release