From 5f57b5ad792c0ad482a39a9b5ba1adb0f08a0329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Tue, 19 Jan 2021 15:46:39 +0100 Subject: [PATCH] Fix checksum file generation Part of #1750 Since we're merging the MSI package with the other built artifacts it's simpler to generate the checksum file right before creating the GH release. --- .github/workflows/all.yml | 2 ++ build-release.sh | 18 ------------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index a8b305c5c71..70590b1de6d 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -350,6 +350,8 @@ jobs: path: dist - name: Remove Chocolatey package run: rm dist/k6*.nupkg + - name: Generate checksum file + run: cd dist && sha256sum * > "k6-${VERSION}-checksums.txt" - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build-release.sh b/build-release.sh index 3a58008150d..4123eff0ed4 100755 --- a/build-release.sh +++ b/build-release.sh @@ -58,22 +58,6 @@ package() { esac } -CHECKSUM_FILE="k6-${VERSION}-checksums.txt" -checksum() { - if command -v sha256sum > /dev/null; then - CHECKSUM_CMD=("sha256sum") - elif command -v shasum > /dev/null; then - CHECKSUM_CMD=("shasum" "-a" "256") - else - echo "ERROR: unable to find a command to compute sha-256 hash" - exit 1 - fi - - echo "--- Generating checksum file..." - rm -f "${OUT_DIR}/$CHECKSUM_FILE" - (cd "$OUT_DIR" && find . -maxdepth 1 -type f -printf '%P\n' | sort | xargs "${CHECKSUM_CMD[@]}" > "$CHECKSUM_FILE") -} - cleanup() { find "$OUT_DIR" -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \; echo "--- Cleaned ${OUT_DIR}" @@ -97,5 +81,3 @@ package linux64 deb package mac zip package win32 zip package win64 zip - -checksum