Skip to content

Commit dd7a8fe

Browse files
authored
Merge branch 'main' into upx
2 parents 8c0065f + 4398438 commit dd7a8fe

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,20 @@ jobs:
5656
- os: ubuntu-latest
5757
target: x86_64-pc-windows-gnu
5858
- os: macos-latest # AArch64
59+
checksums: sha256,sha512,sha1,md5
5960
- os: macos-13 # x86_64
61+
checksums: sha256,sha512,sha1,md5
6062
- os: macos-latest
63+
checksums: sha256,sha512,sha1,md5
6164
target: x86_64-apple-darwin
6265
- os: macos-latest
66+
checksums: sha256,sha512,sha1,md5
6367
target: aarch64-apple-darwin
6468
- os: macos-latest
69+
checksums: sha256,sha512,sha1,md5
6570
target: universal-apple-darwin
6671
- os: macos-latest
72+
checksums: sha256,sha512,sha1,md5
6773
target: universal-apple-darwin
6874
build_tool: cargo
6975
- os: windows-latest
@@ -86,7 +92,7 @@ jobs:
8692
bin: test-crate
8793
target: ${{ matrix.target }}
8894
build-tool: ${{ matrix.build_tool }}
89-
checksum: sha256,sha512,sha1,md5
95+
checksum: ${{ matrix.checksums || 'b2,sha256,sha512,sha1,md5' }}
9096
tar: all
9197
zip: all
9298
manifest-path: test-crate/Cargo.toml
@@ -126,3 +132,8 @@ jobs:
126132
target_dir=$(dirname "${{ steps.upload-rust-binary-action.outputs.tar }}")
127133
already_packed=$(upx "$target_dir/test-crate" | grep AlreadyPackedException)
128134
test -n "$already_packed"
135+
- name: Check b2 output
136+
if: ${{ contains(matrix.checksums || 'b2,sha256,sha512,sha1,md5', 'b2') }}
137+
run: |
138+
printf 'outputs.b2 should not be empty\n'
139+
test -n "${{ steps.upload-rust-binary-action.outputs.b2 }}"

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
1010

1111
## [Unreleased]
1212

13+
## [1.23.0] - 2024-11-11
14+
15+
- Add support for BLAKE2 checksums. ([#89](https://github.com/taiki-e/upload-rust-binary-action/issues/89), thanks @aartoni)
16+
1317
## [1.22.1] - 2024-10-19
1418

1519
- Fix failure when cross-compiling to Windows on non-Windows. ([#86](https://github.com/taiki-e/upload-rust-binary-action/issues/86))
@@ -180,7 +184,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
180184

181185
Initial release
182186

183-
[Unreleased]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.22.1...HEAD
187+
[Unreleased]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.23.0...HEAD
188+
[1.23.0]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.22.1...v1.23.0
184189
[1.22.1]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.22.0...v1.22.1
185190
[1.22.0]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.21.1...v1.22.0
186191
[1.21.1]: https://github.com/taiki-e/upload-rust-binary-action/compare/v1.21.0...v1.21.1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Currently, this action is basically intended to be used in combination with an a
4343
| no-default-features | false | Whether to disable cargo build default features | Boolean | `false` |
4444
| tar | false | On which platform to distribute the `.tar.gz` file (all, unix, windows, or none) | String | `unix` |
4545
| zip | false | On which platform to distribute the `.zip` file (all, unix, windows, or none) | String | `windows` |
46-
| checksum | false | Comma-separated list of algorithms to be used for checksum (sha256, sha512, sha1, or md5) | String | |
46+
| checksum | false | Comma-separated list of algorithms to be used for checksum (b2, sha256, sha512, sha1, or md5).<br>Note: b2 is not available by default on macOS, install `b2sum` to use it. | String | |
4747
| include | false | Comma-separated list of additional files to be included to the archive | String | |
4848
| asset | false | Comma-separated list of additional files to be uploaded separately | String | |
4949
| leading-dir | false | Whether to create the leading directory in the archive or not | Boolean | `false` |
@@ -70,6 +70,7 @@ Currently, this action is basically intended to be used in combination with an a
7070
| archive | Archive base name. |
7171
| zip | `.zip` archive file name. |
7272
| tar | `.tar.gz` archive file name. |
73+
| b2 | BLAKE2 checksum file name. |
7374
| sha256 | SHA256 checksum file name. |
7475
| sha512 | SHA512 checksum file name. |
7576
| sha1 | SHA1 checksum file name. |

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ inputs:
6565
description: Alias for 'build-tool'
6666
required: false
6767
checksum:
68-
description: Comma-separated list of algorithms to be used for checksum (sha256, sha512, sha1, or md5)
68+
description: Comma-separated list of algorithms to be used for checksum (b2, sha256, sha512, sha1, or md5)
6969
required: false
7070
token:
7171
description: >
@@ -123,6 +123,9 @@ outputs:
123123
tar:
124124
description: '.tar.gz archive file name'
125125
value: ${{ steps.upload-rust-binary-action.outputs.tar }}
126+
b2:
127+
description: 'BLAKE2 checksum file name'
128+
value: ${{ steps.upload-rust-binary-action.outputs.b2 }}
126129
sha256:
127130
description: 'SHA256 checksum file name'
128131
value: ${{ steps.upload-rust-binary-action.outputs.sha256 }}

main.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ if [[ -n "${checksum}" ]]; then
145145
while read -rd,; do
146146
checksums+=("${REPLY}")
147147
case "${REPLY}" in
148-
sha256 | sha512 | sha1 | md5) ;;
149-
*) bail "'checksum' input option must be 'sha256', 'sha512', 'sha1', or 'md5': '${REPLY}'" ;;
148+
b2 | sha256 | sha512 | sha1 | md5) ;;
149+
*) bail "'checksum' input option must be 'b2', 'sha256', 'sha512', 'sha1', or 'md5': '${REPLY}'" ;;
150150
esac
151151
done <<<"${checksum},"
152152
fi
@@ -516,6 +516,9 @@ for checksum in ${checksums[@]+"${checksums[@]}"}; do
516516
# GitHub-hosted macOS runner does not install GNU Coreutils by default.
517517
# https://github.com/actions/runner-images/issues/90
518518
case "${checksum}" in
519+
b2)
520+
bail "checksum for '${checksum}' requires '${checksum}sum' command; consider installing it"
521+
;;
519522
sha*)
520523
if type -P shasum >/dev/null; then
521524
shasum -a "${checksum#sha}" "${assets[@]}" >"${archive}.${checksum}"

0 commit comments

Comments
 (0)