taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
227 stars 19 forks source link

sha256sum not found on macOS runners #30

Closed chshersh closed 1 year ago

chshersh commented 1 year ago

When using the checksum field of this action with the sha256 field, I see the following error on macOS runners:

/Users/runner/work/_actions/taiki-e/upload-rust-binary-action/v1/main.sh: line 277: sha256sum: command not found
Error: Command failed: bash --noprofile --norc /Users/runner/work/_actions/taiki-e/upload-rust-binary-action/v1/main.sh

The checksum tool is called here:

https://github.com/taiki-e/upload-rust-binary-action/blob/fde83aaa24409a00584de496f2307887610d9286/main.sh#L277

Apparenty, sha256sum is not installed on macOS by default:

Workaround for users

Install coreutils with brew to bring sha256sum into the scope:

- name: Install coreutils for macOS
  if: matrix.os == 'macOS-latest'
  run: brew install coreutils

Fix in the action

Use the shasum tool on macOS with the -a option

shasum -a 256 foo.txt > foo-sha256.txt
taiki-e commented 1 year ago

Fixed in 1.9.1. Thanks for the report!