From 6159c4d5b68c4a68d9ee7c2fd448cb80c0762bd3 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Mon, 7 Oct 2019 12:15:26 +0200 Subject: [PATCH] [ci] Fix Windows checksumming --- .github/workflows/ci.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b3414a8..587bcf50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -174,6 +174,7 @@ jobs: name=cargo-deny tag=$(git describe --tags --abbrev=0) release_name="$name-$tag-${{ matrix.target }}" + release_tar="${release_name}.tar.gz" mkdir "$release_name" if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then @@ -182,11 +183,17 @@ jobs: cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/" cp README.md LICENSE-APACHE LICENSE-MIT "$release_name/" - tar czvf "$release_name.tar.gz" "$release_name" + tar czvf "$release_tar" "$release_name" rm -r "$release_name" - echo -n "$(shasum -ba 256 "$release_name.tar.gz" | cut -d " " -f 1)" > "$release_name.tar.gz.sha256" + # Windows environments in github actions don't have the gnu coreutils installed, + # which includes the shasum exe, so we just use powershell instead + if [ "{{ matrix.os }}" == "windows-latest" ]; then + echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c - + else + echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256" + fi - name: Publish uses: softprops/action-gh-release@v1 with: