From 83c05441269a15b7d3d2b18c27e6fd5c483923f9 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Tue, 15 Oct 2024 17:24:05 +0800 Subject: [PATCH] fix(sha256): failed to gen sha256 (#2) Signed-off-by: Kevin Cui --- .github/workflows/release.yml | 5 ----- main.sh | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dddc28b..9bd1706 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,9 +46,6 @@ jobs: CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Hash - run: sha256sums ./out/* > sha256.txt - - name: Get Tag Name shell: bash run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV @@ -66,9 +63,7 @@ jobs: uses: softprops/action-gh-release@v2 with: files: | - ./*.tar.gz ./out/* - ./sha256.txt body_path: ./sha256.txt draft: false prerelease: false diff --git a/main.sh b/main.sh index 2b13068..db7bf93 100755 --- a/main.sh +++ b/main.sh @@ -1,9 +1,13 @@ #/bin/sh -set -e +set -ex export WORK=`pwd` +if [ -z "$CODESIGN_IDENTITY" ]; then + export CODESIGN_IDENTITY="-" +fi + rm -rf ./out mkdir -p ./out export GOARCH=arm64 @@ -44,4 +48,12 @@ codesign --force --sign $CODESIGN_IDENTITY --timestamp --entitlements krunkit.en find $WORK/out -name "*.dylib" -type f -exec sh -c "echo 'Signing {}...'; codesign --force --sign $CODESIGN_IDENTITY --timestamp {}" ';' # pack -tar -czvf ./libexec-$GOOS-$GOARCH.tar.gz -C ./out/ . +echo "Packing..." +cd $WORK/out +tar -czvf ./libexec-$GOOS-$GOARCH.tar.gz . + +# generate sha256 +cd $WORK/out +echo "Generating sha256..." +shasum -a 256 ./* > sha256.txt +cat ./sha256.txt