From c4a527d5a05c23e13ba079ccf8e39c34419c719e Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Wed, 28 Aug 2024 20:24:21 +0600 Subject: [PATCH 1/5] chore: publish release checksums --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8813f564..4b06e9b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,27 +89,34 @@ jobs: CHISEL_VERSION: ${{ steps.build.outputs.CHISEL_VERSION }} run: | ARCHIVE_FILE=chisel_${CHISEL_VERSION}_${GOOS}_${GOARCH}.tar.gz + ARCHIVE_FILE_CKSUM="${ARCHIVE_FILE}.sha384" echo "Creating archive $ARCHIVE_FILE" mkdir -p dist/build cp chisel LICENSE README.md dist/build find dist/build -printf "%P\n" | tar -czf dist/$ARCHIVE_FILE --no-recursion -C dist/build -T - + sha384sum "dist/${ARCHIVE_FILE}" > "dist/${ARCHIVE_FILE_CKSUM}" # Share variables with subsequent steps echo "ARCHIVE_FILE=${ARCHIVE_FILE}" >>$GITHUB_OUTPUT + echo "ARCHIVE_FILE_CKSUM=${ARCHIVE_FILE_CKSUM}" >>$GITHUB_OUTPUT - name: Upload archive as Actions artifact uses: actions/upload-artifact@v3 with: name: ${{ steps.archive.outputs.ARCHIVE_FILE }} - path: dist/${{ steps.archive.outputs.ARCHIVE_FILE }} + path: + dist/${{ steps.archive.outputs.ARCHIVE_FILE }} + dist/${{ steps.archive.outputs.ARCHIVE_FILE_CKSUM }} - name: Upload archive to release env: CHISEL_VERSION: ${{ steps.build.outputs.CHISEL_VERSION }} ARCHIVE_FILE: ${{ steps.archive.outputs.ARCHIVE_FILE }} + ARCHIVE_FILE_CKSUM: ${{ steps.archive.outputs.ARCHIVE_FILE_CKSUM }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: ${{ github.event_name == 'release' }} run: | echo "Uploading $ARCHIVE_FILE to release $CHISEL_VERSION" gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE + gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE_CKSUM From b2b044bbd16ec1dafbbed90ce06ed0fc491e5191 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Wed, 28 Aug 2024 20:32:49 +0600 Subject: [PATCH 2/5] chore: fix typo on archive upload path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b06e9b8..eb61f64d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,7 +105,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ steps.archive.outputs.ARCHIVE_FILE }} - path: + path: | dist/${{ steps.archive.outputs.ARCHIVE_FILE }} dist/${{ steps.archive.outputs.ARCHIVE_FILE_CKSUM }} From caf84dad985e54c8f6314070a769573d265840df Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Wed, 28 Aug 2024 20:38:44 +0600 Subject: [PATCH 3/5] chore: fix archive path in checksum file --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb61f64d..ec4001e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: mkdir -p dist/build cp chisel LICENSE README.md dist/build find dist/build -printf "%P\n" | tar -czf dist/$ARCHIVE_FILE --no-recursion -C dist/build -T - - sha384sum "dist/${ARCHIVE_FILE}" > "dist/${ARCHIVE_FILE_CKSUM}" + cd dist/ && sha384sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE_CKSUM}" && cd - # Share variables with subsequent steps echo "ARCHIVE_FILE=${ARCHIVE_FILE}" >>$GITHUB_OUTPUT From 8cc0e5ce71c90edafceb79e2097b8f6f18e4259f Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Fri, 30 Aug 2024 15:01:52 +0600 Subject: [PATCH 4/5] chore: s/CKSUM/SHA384 --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec4001e7..6bfeab7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,17 +89,17 @@ jobs: CHISEL_VERSION: ${{ steps.build.outputs.CHISEL_VERSION }} run: | ARCHIVE_FILE=chisel_${CHISEL_VERSION}_${GOOS}_${GOARCH}.tar.gz - ARCHIVE_FILE_CKSUM="${ARCHIVE_FILE}.sha384" + ARCHIVE_FILE_SHA384="${ARCHIVE_FILE}.sha384" echo "Creating archive $ARCHIVE_FILE" mkdir -p dist/build cp chisel LICENSE README.md dist/build find dist/build -printf "%P\n" | tar -czf dist/$ARCHIVE_FILE --no-recursion -C dist/build -T - - cd dist/ && sha384sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE_CKSUM}" && cd - + cd dist/ && sha384sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE_SHA384}" && cd - # Share variables with subsequent steps echo "ARCHIVE_FILE=${ARCHIVE_FILE}" >>$GITHUB_OUTPUT - echo "ARCHIVE_FILE_CKSUM=${ARCHIVE_FILE_CKSUM}" >>$GITHUB_OUTPUT + echo "ARCHIVE_FILE_SHA384=${ARCHIVE_FILE_SHA384}" >>$GITHUB_OUTPUT - name: Upload archive as Actions artifact uses: actions/upload-artifact@v3 @@ -107,16 +107,16 @@ jobs: name: ${{ steps.archive.outputs.ARCHIVE_FILE }} path: | dist/${{ steps.archive.outputs.ARCHIVE_FILE }} - dist/${{ steps.archive.outputs.ARCHIVE_FILE_CKSUM }} + dist/${{ steps.archive.outputs.ARCHIVE_FILE_SHA384 }} - name: Upload archive to release env: CHISEL_VERSION: ${{ steps.build.outputs.CHISEL_VERSION }} ARCHIVE_FILE: ${{ steps.archive.outputs.ARCHIVE_FILE }} - ARCHIVE_FILE_CKSUM: ${{ steps.archive.outputs.ARCHIVE_FILE_CKSUM }} + ARCHIVE_FILE_SHA384: ${{ steps.archive.outputs.ARCHIVE_FILE_SHA384 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: ${{ github.event_name == 'release' }} run: | echo "Uploading $ARCHIVE_FILE to release $CHISEL_VERSION" gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE - gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE_CKSUM + gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE_SHA384 From b2fa5d521dcbfe2d602e26160d3f418f4087773a Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Fri, 30 Aug 2024 15:09:44 +0600 Subject: [PATCH 5/5] chore: place tarball in workdir The goal is to improve maintainability, because ``dist/`` was hardcoded in multiple steps. --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bfeab7d..d3d7ed64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,10 +92,10 @@ jobs: ARCHIVE_FILE_SHA384="${ARCHIVE_FILE}.sha384" echo "Creating archive $ARCHIVE_FILE" - mkdir -p dist/build - cp chisel LICENSE README.md dist/build - find dist/build -printf "%P\n" | tar -czf dist/$ARCHIVE_FILE --no-recursion -C dist/build -T - - cd dist/ && sha384sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE_SHA384}" && cd - + mkdir -p dist/ + cp chisel LICENSE README.md dist/ + find dist -printf "%P\n" | tar -czf $ARCHIVE_FILE --no-recursion -C dist -T - + sha384sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE_SHA384}" # Share variables with subsequent steps echo "ARCHIVE_FILE=${ARCHIVE_FILE}" >>$GITHUB_OUTPUT @@ -106,8 +106,8 @@ jobs: with: name: ${{ steps.archive.outputs.ARCHIVE_FILE }} path: | - dist/${{ steps.archive.outputs.ARCHIVE_FILE }} - dist/${{ steps.archive.outputs.ARCHIVE_FILE_SHA384 }} + ${{ steps.archive.outputs.ARCHIVE_FILE }} + ${{ steps.archive.outputs.ARCHIVE_FILE_SHA384 }} - name: Upload archive to release env: @@ -118,5 +118,5 @@ jobs: if: ${{ github.event_name == 'release' }} run: | echo "Uploading $ARCHIVE_FILE to release $CHISEL_VERSION" - gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE - gh release upload $CHISEL_VERSION dist/$ARCHIVE_FILE_SHA384 + gh release upload $CHISEL_VERSION $ARCHIVE_FILE + gh release upload $CHISEL_VERSION $ARCHIVE_FILE_SHA384