From b270d43a5d6341eb7cebce11ba2598f41b78b77c Mon Sep 17 00:00:00 2001 From: Bambooin Date: Thu, 24 Jun 2021 18:37:57 +0800 Subject: [PATCH] feat: add sha256 check for release --- .github/workflows/release_ci.yml | 6 +++--- Makefile | 9 +++++++-- script/sha256sum.sh | 12 ++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100755 script/sha256sum.sh diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 78f677c..94d26ed 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -13,8 +13,8 @@ jobs: fetch-depth: 0 submodules: 'recursive' - - name: Archive rimerc - run: make archive + - name: Build rimerc + run: make release - name: Build changelog id: release_log @@ -30,7 +30,7 @@ jobs: - name: Create release uses: ncipollo/release-action@v1 with: - artifacts: "release/*.zip" + artifacts: "release/*.zip,release/*.sha256.txt" body: | ${{ steps.release_log.outputs.changelog }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 163420f..ef9ff0b 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # build script for rimerc releasePath=release -.PHONY: all pacakge archive install clean +.PHONY: all pacakge archive sha256sum release install clean -all: archive +all: release pacakge: ./script/package.sh @@ -11,6 +11,11 @@ pacakge: archive: pacakge ./script/archive.sh +sha256sum: archive + ./script/sha256sum.sh + +release: sha256sum + clean: rm -rf ${releasePath} diff --git a/script/sha256sum.sh b/script/sha256sum.sh new file mode 100755 index 0000000..1b4aa0a --- /dev/null +++ b/script/sha256sum.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +releasePath=release + +pushd ${releasePath} + +for zip in *.zip +do + sha256sum ${zip} > ${zip}.sha256.txt +done + +popd