Compare commits

...

205 Commits
v1.4.2 ... v1

Author SHA1 Message Date
Taiki Endo
9a29ce630c Release 1.17.3 2022-12-22 11:24:47 +09:00
Taiki Endo
acc0c0687d Update wasmtime@latest to 4.0.0 2022-12-22 11:21:14 +09:00
Taiki Endo
c98c0a5de9 Tweak CI config 2022-12-22 11:21:06 +09:00
Taiki Endo
b5a6a481a3 Release 1.17.2 2022-12-18 01:34:34 +09:00
Taiki Endo
936bda0c55 Update mdbook@latest to 0.4.25 2022-12-18 01:23:18 +09:00
Taiki Endo
e0abba697f Update GitHub workflow badge
See badges/shields issue 8671
2022-12-16 04:13:50 +09:00
Taiki Endo
320900e2b1 Update mdbook@latest to 0.4.24 2022-12-16 00:51:55 +09:00
Taiki Endo
4ea8614f66 Release 1.17.1 2022-12-15 21:13:23 +09:00
Taiki Endo
c4112353fe Update cargo-llvm-cov@latest to 0.5.3 2022-12-15 21:03:09 +09:00
Taiki Endo
d14576d5ee Support mdbook on linux-musl 2022-12-15 20:39:00 +09:00
Taiki Endo
54f239fc7f Update comments on GitHub Actions Runner 2022-12-15 20:23:58 +09:00
Taiki Endo
0c60ab7876 Update mdbook@latest to 0.4.23 2022-12-15 20:23:24 +09:00
Taiki Endo
cb3ffa00b0 Release 1.17.0 2022-12-15 01:51:11 +09:00
Taiki Endo
a68686a8a2 Support aarch64 host more 2022-12-15 01:48:50 +09:00
Taiki Endo
c5a36f2fba Support aarch64 self-hosted runners 2022-12-15 00:16:20 +09:00
Taiki Endo
5e3287fe00 Update protoc@latest to 3.21.12 2022-12-14 23:49:33 +09:00
Taiki Endo
807aa14713 Do not install dnf on CentOS 7 2022-12-14 23:46:06 +09:00
Taiki Endo
1ab447b34f Improve support for Fedora/RHEL based containers/self-hosted runners 2022-12-14 22:40:45 +09:00
Taiki Endo
d66f303732 Update changelog 2022-12-14 12:00:52 +09:00
Taiki Endo
59c6ff35e6 Tweak changelog 2022-12-14 11:51:33 +09:00
Taiki Endo
4dad9dd51d Release 1.16.0 2022-12-14 11:48:06 +09:00
Taiki Endo
9ff3167a7f Add compatibility note 2022-12-14 11:47:44 +09:00
Taiki Endo
2a026de3a2 Test ubuntu:18:04 container in CI 2022-12-14 11:37:45 +09:00
Taiki Endo
f69fae4162 Update changelog 2022-12-14 11:31:32 +09:00
Taiki Endo
c3ee7d751f Add comment 2022-12-14 11:29:57 +09:00
Taiki Endo
ff96887f37 Install packages required for installation if not installed 2022-12-14 11:24:22 +09:00
Taiki Endo
97334a704a Remove needless host_triple call 2022-12-14 10:54:03 +09:00
Taiki Endo
83639e6b24 rustc-independent musl detection, take 2 2022-12-14 10:47:48 +09:00
Taiki Endo
8bc4e50568 Compact case statement in install_cargo_binstall 2022-12-14 10:42:47 +09:00
Jiahao XU
1fa8737224 Bump cargo-binstall to v0.18.1 (#32) 2022-12-14 10:26:38 +09:00
Taiki Endo
a75cc5295d Release 1.15.5 2022-12-13 20:54:41 +09:00
Taiki Endo
ee26d44cfa Update shellcheck@latest to 0.9.0 2022-12-13 20:52:26 +09:00
Taiki Endo
4eef07f07c Release 1.15.4 2022-12-12 23:43:39 +09:00
Taiki Endo
bb72b7ab31 Test GitHub-provided ubuntu-22.04 runner in CI 2022-12-12 23:38:49 +09:00
Taiki Endo
f80dd34cc7 Update cargo-binstall@latest to 0.18.0 2022-12-12 23:26:16 +09:00
Taiki Endo
a252073294 Support installing cargo-binstall on custom linux targets 2022-12-12 23:26:02 +09:00
Taiki Endo
f4a1ca475e Update shfmt@latest to 3.6.0 2022-12-12 23:19:44 +09:00
Taiki Endo
d33a0a9074 Test ubuntu and debian containers in CI 2022-12-11 16:22:13 +09:00
Taiki Endo
3594558506 Test musl container in CI (#31) 2022-12-11 14:21:01 +09:00
Taiki Endo
bbcb7fd5c9 Release 1.15.3 2022-12-11 13:50:42 +09:00
Taiki Endo
155e686da4 Update changelog 2022-12-11 13:50:26 +09:00
Taiki Endo
e5d84f2a67 Revert "Adjust host env check"
This reverts commit 5b5badbee3.

Fixes #29
2022-12-11 13:48:21 +09:00
Taiki Endo
0865eee0cd Release 1.15.2 2022-12-11 03:46:11 +09:00
Taiki Endo
ab2d9d2b4f Add spell-check to CI 2022-12-09 22:03:48 +09:00
Taiki Endo
8666426bd7 Update protoc@latest to 3.21.11 2022-12-09 01:33:14 +09:00
Taiki Endo
5b5badbee3 Adjust host env check 2022-12-04 07:21:43 +09:00
Taiki Endo
8f358b0517 Update mdbook-linkcheck@latest to 0.7.7 2022-12-04 07:13:24 +09:00
Taiki Endo
087b8bdbf4 Release 1.15.1 2022-12-04 07:03:31 +09:00
Taiki Endo
22d12abbc7 Update cargo-hack@latest to 0.5.24 2022-12-04 06:45:42 +09:00
Taiki Endo
c4dcfd4545 Use reusable workflows 2022-12-03 22:41:35 +09:00
Taiki Endo
36e7fe7dbe Update wasmtime@latest to 3.0.1 2022-12-02 04:18:23 +09:00
Taiki Endo
d49da406cc Update protoc@latest to 3.21.10 2022-12-02 03:20:47 +09:00
Taiki Endo
d0f28d3db6 Overhaul tidy check 2022-12-02 03:19:40 +09:00
Taiki Endo
96c3fd376d Release 1.15.0 2022-11-29 23:09:01 +09:00
Taiki Endo
4091e8ab02 Support cargo-deny 2022-11-29 12:09:30 +09:00
Taiki Endo
956e75d2d4 Update mdbook@latest to 0.4.22 2022-11-29 12:08:30 +09:00
Taiki Endo
44a0ddacb9 Release 1.14.7 2022-11-28 02:01:08 +09:00
Taiki Endo
ce55513d1e Update cargo-llvm-cov@latest to 0.5.2 2022-11-28 01:59:00 +09:00
Taiki Endo
d650d1426d Release 1.14.6 2022-11-27 21:37:13 +09:00
Taiki Endo
9de731de5b Update cargo-hack, cargo-llvm-cov, and cargo-minimal-versions 2022-11-27 21:33:58 +09:00
Taiki Endo
8c5018c59c Release 1.14.5 2022-11-27 14:38:13 +09:00
Taiki Endo
f5afcb464c Update cargo-binstall@latest to 0.17.0 2022-11-27 14:35:58 +09:00
Taiki Endo
b42a02cb11 Update wasmtime@latest to 3.0.0 2022-11-27 13:51:45 +09:00
Taiki Endo
c971aa51fb Release 1.14.4 2022-11-04 09:46:25 +09:00
Taiki Endo
c0929bd53c Update cargo-udeps to 0.1.35 2022-11-04 09:44:12 +09:00
Taiki Endo
dfd35942fe Release 1.14.3 2022-10-28 21:58:34 +09:00
Taiki Endo
078ab003a2 Update wasmtime and protoc 2022-10-28 21:56:16 +09:00
Taiki Endo
ba4b012f19 Release 1.14.2 2022-10-26 02:19:48 +09:00
Taiki Endo
6746ad0324 Update cargo-hack, cargo-minimal-versions, and parse-changelog 2022-10-26 01:20:02 +09:00
Taiki Endo
68642cc590 Release 1.14.1 2022-10-21 10:41:31 +09:00
Taiki Endo
97df8adcf7 Update wasmtime to 2.0.0 2022-10-21 10:30:43 +09:00
Taiki Endo
f021e393f7 Update protoc to 3.21.8 2022-10-19 11:42:45 +09:00
Taiki Endo
0158edbfba Release 1.14.0 2022-10-18 17:34:34 +09:00
Taiki Endo
e3981a6d57 Update changelog 2022-10-18 17:33:52 +09:00
Taiki Endo
1bc9250743 Update gitignore 2022-10-18 17:33:45 +09:00
Jiahao XU
999ba40f44 Bump cargo-binstall to v0.16.0 (#28) 2022-10-18 16:04:12 +09:00
Taiki Endo
b8a856acea Remove repo name from error 2022-10-04 10:05:47 +09:00
Jiahao XU
9f3710a281 Fix main.sh: bail on semver operators (#26)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-10-03 21:02:42 +09:00
Taiki Endo
e85ee51dd0 Update protoc to 3.21.7 2022-09-30 11:37:02 +09:00
Taiki Endo
c35547fc3a Release 1.13.9 2022-09-29 01:12:03 +09:00
Taiki Endo
7e60635127 Update changelog 2022-09-29 01:11:54 +09:00
Colt Frederickson
25db2c0373 Update cargo-binstall to 0.14.0 (#24)
Update to the latest cargo-binstall, which fixes the installation of sccache.
2022-09-29 00:28:38 +09:00
Taiki Endo
eabd84cfdd Revert "Update wasmtime to 1.0.1"
This reverts commit c7aafffa95.

This release currently missing binaries for x86_64 Linux/macOS/Windows.
2022-09-27 11:36:26 +09:00
Taiki Endo
c7aafffa95 Update wasmtime to 1.0.1 2022-09-27 11:28:55 +09:00
Taiki Endo
93c0efda22 Release 1.13.8 2022-09-26 23:35:40 +09:00
Taiki Endo
71ce4c0326 Update cargo-hack to 0.5.21 2022-09-26 23:27:29 +09:00
Taiki Endo
e380e63944 Release 1.13.7 2022-09-25 17:14:11 +09:00
Taiki Endo
0f4d53b2aa Update changelog 2022-09-25 17:13:49 +09:00
Taiki Endo
ac22f2e031 Do not use cargo-binstall for upgrade for cargo-binstall (#23) 2022-09-25 17:08:12 +09:00
Taiki Endo
c079fd141a Insert new line after cargo-binstall version output 2022-09-25 16:32:11 +09:00
Jiahao XU
edbd1909dc Ensure that cargo-binstall 0.13.3 is used (#22)
* Ensure that 0.13.3 is used
* Remove passing deprecated `--secure` flag to `cargo-binstall`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-25 16:12:29 +09:00
Taiki Endo
618bb235a3 Release 1.13.6 2022-09-25 15:53:15 +09:00
Taiki Endo
93a94c2059 Update cargo-binstall to 0.13.3 2022-09-25 15:51:10 +09:00
Taiki Endo
6bb27b4afe Update changelog 2022-09-24 15:04:26 +09:00
Taiki Endo
ca5df137f6 Release 1.13.5 2022-09-24 14:21:55 +09:00
Taiki Endo
a7ac3cded3 Downgrade cargo-binstall to 0.13.1
Refs: https://github.com/taiki-e/install-action/issues/21
2022-09-24 14:20:07 +09:00
Taiki Endo
2b9035e07b Update cargo-hack to 0.5.20 2022-09-24 13:49:09 +09:00
Taiki Endo
6c0394aa23 Release 1.13.4 2022-09-23 00:39:06 +09:00
Taiki Endo
815f5e1266 Update cargo-hack to 0.5.19 2022-09-23 00:29:54 +09:00
Taiki Endo
d5d85f7b2e Release 1.13.3 2022-09-21 01:21:35 +09:00
Taiki Endo
a0deac80c0 Update wasmtime to 1.0.0 2022-09-21 01:17:45 +09:00
Taiki Endo
6597128d21 Release 1.13.2 2022-09-16 23:05:08 +09:00
Taiki Endo
e4c6aaa80b Update cargo-udeps to 0.1.33 2022-09-16 11:28:06 +09:00
Taiki Endo
c8c4e1b05f Release 1.13.1 2022-09-15 09:41:56 +09:00
Taiki Endo
39be0e3135 Update protoc to 3.21.6 2022-09-15 08:37:15 +09:00
Taiki Endo
5475499f3a Release 1.13.0 2022-09-10 20:53:15 +09:00
Taiki Endo
462c9790a0 Avoid using sudo on protoc installation 2022-09-10 20:47:43 +09:00
Taiki Endo
7f648a20c4 Update link to cargo-binstall license file 2022-09-10 20:41:26 +09:00
Taiki Endo
6b915acdfc Release 1.12.4 2022-09-10 17:29:37 +09:00
Taiki Endo
6559edc36a Update cargo-llvm-cov to 0.5.0 2022-09-10 17:27:21 +09:00
Taiki Endo
d7be3bce25 Use token input option instead of environment variable 2022-09-09 01:50:01 +09:00
Taiki Endo
c43c9c2677 Release 1.12.3 2022-09-08 23:43:16 +09:00
Taiki Endo
aab22b4379 Update parse-changelog to 0.5.1 2022-09-08 23:41:42 +09:00
Taiki Endo
20c09fa7dc Release 1.12.2 2022-09-04 23:02:17 +09:00
Taiki Endo
684e4b1c21 Update cargo-hack to 0.5.18 2022-09-04 22:52:00 +09:00
Taiki Endo
d62eacb562 Release 1.12.1 2022-09-01 11:41:13 +09:00
Taiki Endo
a8382c73ee Update wasmtime to 0.40.1 2022-09-01 11:24:24 +09:00
Taiki Endo
6c46ebf75b Release 1.12.0 2022-08-28 17:38:32 +09:00
Taiki Endo
f912bf2387 Update changelog 2022-08-28 17:38:13 +09:00
messense
2962aafadb Support cargo-valgrind (#20) 2022-08-28 17:34:23 +09:00
Taiki Endo
581b570b73 Release 1.11.2 2022-08-23 21:38:29 +09:00
Taiki Endo
57339998f1 Update wasmtime, cargo-udeps, and protoc 2022-08-23 21:29:55 +09:00
Taiki Endo
dda69eeab2 Remove uses of GitHub-hosted ubuntu-18.04 runner
Refs: https://github.com/actions/runner-images/issues/6002
2022-08-22 22:14:46 +09:00
Taiki Endo
3f4a57923d Add .shellcheckrc 2022-08-22 21:50:17 +09:00
Taiki Endo
cb1e26fae1 Enable dependabot update for Github Actions 2022-08-20 21:38:18 +09:00
Taiki Endo
74efbe3ca4 Release 1.11.1 2022-08-13 16:16:46 +09:00
Taiki Endo
0ed66b7383 Update changelog 2022-08-13 16:14:20 +09:00
Jiahao XU
b9424a9dfb Cargo binstall force (#19)
* Upgrade `cargo-binstall` if already installed
* Use `--force` for `cargo-binstall` in case bin is not cached

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-13 16:02:28 +09:00
Taiki Endo
0b2484c3a0 Release 1.11.0 2022-08-13 14:40:02 +09:00
NAKASHIMA, Makoto
bd71caf797 Support cargo-udeps (#17) 2022-08-13 14:37:57 +09:00
Taiki Endo
4696ae1646 Update cargo-hack to 0.5.17 2022-08-13 06:16:32 +09:00
Taiki Endo
a1eacca287 Update cargo-binstall URL 2022-08-09 05:09:08 +09:00
Taiki Endo
c25592b07d Release 1.10.4 2022-08-07 02:15:58 +09:00
Taiki Endo
61afdb8d12 Update cargo-llvm-cov to 0.4.14 2022-08-07 01:51:36 +09:00
Taiki Endo
536bc7c409 Release 1.10.3 2022-08-01 21:13:03 +09:00
Taiki Endo
f317c8aedc Support wasm-pack on Windows 2022-08-01 21:12:54 +09:00
Taiki Endo
de0e9b667c Release 1.10.2 2022-08-01 19:49:40 +09:00
Taiki Endo
45e69d69e2 Support protoc on Windows 2022-08-01 19:43:41 +09:00
Taiki Endo
9c40419eb7 Release 1.10.1 2022-08-01 18:19:11 +09:00
Taiki Endo
b8a66e6289 Update readme and changelog 2022-08-01 18:19:01 +09:00
Taiki Endo
a8803585a3 Fix missing include files when installing protoc on Linux and macOS 2022-08-01 18:07:53 +09:00
Taiki Endo
80528fecb9 Release 1.10.0 2022-08-01 17:43:41 +09:00
Taiki Endo
878e967972 Set PROTOC environment variable when installing protoc 2022-08-01 17:40:32 +09:00
Taiki Endo
b1b32c59f1 Tweak readme 2022-08-01 17:30:50 +09:00
Taiki Endo
a8398547d2 Release 1.9.0 2022-08-01 17:27:44 +09:00
Taiki Endo
15ad10ce15 Update readme 2022-08-01 17:26:13 +09:00
Taiki Endo
27a2597e2a Support protoc 2022-08-01 17:23:02 +09:00
Taiki Endo
41cb1134d7 Release 1.8.4 2022-08-01 12:16:56 +09:00
Taiki Endo
13e84cc696 Update cargo-llvm-cov to 0.4.13 2022-08-01 12:03:10 +09:00
Taiki Endo
d744cfca57 Release 1.8.3 2022-07-30 17:56:09 +09:00
Taiki Endo
f6e099c85c Support shorthand for mdbook-linkcheck 2022-07-30 17:56:01 +09:00
Taiki Endo
a86d24f499 Release 1.8.2 2022-07-30 16:55:08 +09:00
Taiki Endo
c13274e43a Update cargo-llvm-cov to 0.4.12 2022-07-30 16:53:29 +09:00
Taiki Endo
b0d750a59e Update cargo-hack to 0.5.16 2022-07-30 15:20:07 +09:00
Taiki Endo
7d5481ab3a Release 1.8.1 2022-07-26 12:08:13 +09:00
Taiki Endo
b6afd8d427 Fix cargo-binstall installation failure take 2 2022-07-26 12:07:17 +09:00
Taiki Endo
d1839c2f68 Fix cargo-binstall installation failure
`head` doesn't accept `1` option.
2022-07-26 12:05:34 +09:00
Taiki Endo
85064bbc1c Move cargo-binstall version output to install_cargo_binstall 2022-07-26 12:03:09 +09:00
Taiki Endo
9fdefab8ca Release 1.8.0 2022-07-26 11:36:08 +09:00
Taiki Endo
c430b7f8ce Update changelog 2022-07-26 11:33:53 +09:00
Taiki Endo
cfca345a65 Accept install-action@cargo-nextest 2022-07-26 11:33:53 +09:00
Christopher Durham
a76dc5ad72 Accept tool: cargo-nextest to install nextest (#15) 2022-07-26 11:30:14 +09:00
Christopher Durham
1dda3d1d7e Don't try to run cargo binstall --version (#16) 2022-07-26 11:30:04 +09:00
Taiki Endo
92705122ed Only use musl binaries for nextest if glibc isn't available
Closes #13
2022-07-26 11:21:16 +09:00
Taiki Endo
7e5692dc7d Release 1.7.0 2022-07-25 20:02:35 +09:00
Taiki Endo
8aa291abce Install Rust-related binaries to /usr/local/bin when cargo home is not available 2022-07-25 20:00:53 +09:00
Taiki Endo
36cb23f9a6 Release 1.6.1 2022-07-25 19:49:44 +09:00
Taiki Endo
ab4e6f5142 Update changelog 2022-07-25 19:49:37 +09:00
Taiki Endo
aae9c8b0a3 Fix install log for nextest 2022-07-25 19:47:04 +09:00
Taiki Endo
6eaed8fc4e Remove ... from log 2022-07-25 19:42:59 +09:00
Taiki Endo
fd84b52d9c Release 1.6.0 2022-07-25 19:40:48 +09:00
Taiki Endo
d637ba13b3 Set PATH internally when cargo home is not available 2022-07-25 19:38:45 +09:00
Taiki Endo
f343021ffc Cleanup
- Support mdbook-linkcheck.
- Support mdbook on Windows.
- Support wasmtime on Windows.
- Support nextest on Linux (musl).
- Fix installation failure when `$CARGO_HOME/bin` or `$HOME/.cargo/bin` is not available.

Fixes #11
2022-07-25 19:26:13 +09:00
Taiki Endo
d7602d9dcb Release 1.5.11 2022-07-25 14:49:21 +09:00
Taiki Endo
31800b17cc Fix cargo-binstall installation
Fixes #10
2022-07-25 14:47:39 +09:00
Taiki Endo
e6302a3430 Release 1.5.10 2022-07-24 13:22:47 +09:00
Taiki Endo
1e5fc1d1ff Update parse-changelog to 0.5.0 2022-07-24 13:08:44 +09:00
Taiki Endo
ca9824f699 Release 1.5.9 2022-07-23 03:34:27 +09:00
Taiki Endo
de0d285973 Update mdbook to 0.4.21 2022-07-23 03:32:40 +09:00
Taiki Endo
fb59c794dd Use macos-11 instead of deprecated macos-10.15
Refs: https://github.com/actions/virtual-environments/issues/5583
2022-07-21 21:58:15 +09:00
Taiki Endo
daa62f7ff1 Update wasmtime to 0.39.1 2022-07-21 21:58:07 +09:00
Taiki Endo
f113ef4cd9 Release 1.5.8 2022-07-21 10:16:36 +09:00
Taiki Endo
6a6a02956b Update wasmtime to 0.39.0 2022-07-21 10:07:56 +09:00
Taiki Endo
782f135cee Release 1.5.7 2022-07-21 00:18:12 +09:00
Taiki Endo
d39d50062b Update cargo-llvm-cov to 0.4.11 2022-07-21 00:16:52 +09:00
Taiki Endo
6f1ebcd9e2 Release 1.5.6 2022-07-18 16:01:38 +09:00
Taiki Endo
161dccbf9a Update cargo-llvm-cov to 0.4.10 2022-07-18 15:54:38 +09:00
Taiki Endo
b410f0ad6a Release 1.5.5 2022-07-18 14:25:59 +09:00
Taiki Endo
e067205061 Update cargo-hack to 0.5.15 2022-07-18 14:19:39 +09:00
Taiki Endo
78118df4d7 Release 1.5.4 2022-07-16 17:23:56 +09:00
Taiki Endo
1cbab0616a Update cross, cargo-minimal-versions, and parse-changelog 2022-07-16 17:22:27 +09:00
Taiki Endo
e937b634a0 Update mdbook to 0.4.20 2022-07-16 16:19:22 +09:00
Taiki Endo
37f510303a Release 1.5.3 2022-07-08 00:35:25 +09:00
Taiki Endo
841e33c134 Update cargo-llvm-cov to 0.4.9 2022-07-08 00:28:29 +09:00
Taiki Endo
095ba5e160 Update tools/publish.sh 2022-07-06 03:39:38 +09:00
Taiki Endo
0e32218b80 Release 1.5.2 2022-07-03 01:22:05 +09:00
Taiki Endo
4a4d2c21ca Update cross to 0.2.2 2022-07-02 22:50:11 +09:00
Taiki Endo
64d4f090ec Revert "Update cross to 0.2.2"
This reverts commit 60952837b3.
2022-07-02 22:40:49 +09:00
Taiki Endo
60952837b3 Update cross to 0.2.2 2022-07-02 22:38:45 +09:00
Taiki Endo
640bc768ee Release 1.5.1 2022-07-02 22:34:50 +09:00
Taiki Endo
d5b4eb3fc2 Update mdbook to 0.4.19 2022-07-02 21:04:09 +09:00
Taiki Endo
83e8fa8971 Release 1.5.0 2022-06-29 00:36:31 +09:00
Taiki Endo
2ab583ea78 Update changelog 2022-06-29 00:32:07 +09:00
Taiki Endo
6745402100 Update wasmtime to 0.38.1 2022-06-29 00:30:20 +09:00
Jiahao XU
03433ef024 Enable secure mode for cargo-binstall (#9)
`--secure` mode enforce downloads over secure transports only.
As a result, http will be disabled, and it will also set
min tls version to be 1.2

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-29 00:28:27 +09:00
14 changed files with 1331 additions and 220 deletions

49
.cspell.json Normal file
View File

@@ -0,0 +1,49 @@
{
"version": "0.2",
"gitignoreRoot": ".",
"useGitignore": true,
"dictionaryDefinitions": [
{
"name": "organization-dictionary",
"path": "./.github/.cspell/organization-dictionary.txt",
"addWords": true
},
{
"name": "project-dictionary",
"path": "./.github/.cspell/project-dictionary.txt",
"addWords": true
},
{
"name": "rust-dependencies",
"path": "./.github/.cspell/rust-dependencies.txt",
"addWords": true
}
],
"dictionaries": [
"organization-dictionary",
"project-dictionary",
"rust-dependencies"
],
"ignoreRegExpList": [
// Copyright notice
"Copyright ((\\(c\\)|\\(C\\)|©) )?.*",
// GHA actions/workflows
"uses: .+@",
// GHA context (repo name, owner name, etc.)
"github.\\w+ (=|!)= '.+'",
// GH username
"( |\\[)@[\\w_-]+",
// Git config username
"git config user.name .*",
// Cargo.toml authors
"authors *= *\\[.*\\]",
"\".* <[\\w_.+-]+@[\\w.-]+>\""
],
"languageSettings": [
{
"languageId": ["*"],
"dictionaries": ["rust"]
}
],
"ignorePaths": []
}

View File

@@ -0,0 +1,109 @@
// This is a dictionary shared by projects under https://github.com/taiki-e.
// It is not intended for manual editing.
endo
taiki
// tool name and its configs or options
asan
cflags
clippy
codegen
cxxflags
exitcode
miri
miriflags
msan
retag
rustc
rustdoc
rustdocflags
rustflags
rustfmt
rustsec
rustup
valgrind
xcompile
Zdoctest
Zmiri
// Rust target triple
aarch
androideabi
armeb
armebv
armv
asmjs
atmega
bpfeb
bpfel
cuda
eabi
eabihf
emscripten
espidf
fortanix
gnuabi
gnueabi
gnueabihf
gnullvm
gnuspe
gnux
illumos
imac
macabi
mipsel
mipsisa
msvc
muslabi
musleabi
musleabihf
nvptx
openwrt
riscv
softfloat
sparcv
thumbeb
thumbebv
thumbv
tvos
uclibc
uclibceabi
uclibceabihf
uefi
vxworks
wasi
watchos
xous
// Rust other
alloc
canonicalize
consts
deque
doctest
hasher
inlateout
intrinsics
lateout
msrv
peekable
punct
repr
rfind
rfold
splitn
uninit
// Other
connrefused
cygwin
euxo
msys
noninteractive
noprofile
norc
pipefail
powerset
proto
tlsv

25
.github/.cspell/project-dictionary.txt vendored Normal file
View File

@@ -0,0 +1,25 @@
binstall
bytecodealliance
distro
doas
Dpkg
jfrimmel
koalaman
libc
linkcheck
mdbook
microdnf
mvdan
nextest
protobuf
protoc
protocolbuffers
quickinstall
rockylinux
rustwasm
shellcheck
shfmt
toolchains
udeps
wasmtime
xscale

0
.github/.cspell/rust-dependencies.txt vendored Normal file
View File

9
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: ''
labels: []

View File

@@ -10,7 +10,7 @@ on:
- main
- dev
schedule:
- cron: '0 0 * * *'
- cron: '0 1 * * *'
workflow_dispatch:
defaults:
@@ -18,28 +18,30 @@ defaults:
shell: bash
jobs:
tidy:
uses: taiki-e/workflows/.github/workflows/tidy-no-rust.yml@main
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
tool:
# Note: Specifying the version of valgrind and wasm-pack is not supported.
# cargo-watch is supported by cargo-binstall (through quickinstall)
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,cargo-watch
- cargo-hack@0.5.14,cargo-llvm-cov@0.4.8,cargo-minimal-versions@0.1.4,parse-changelog@0.4.8,cross@0.2.1,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.1,wasmtime@0.37.0,mdbook@0.4.18,cargo-watch@8.1.1
# Nextest supports basic version ranges as well
- nextest@0.9
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
include:
# Note: mdBook binary is incompatible with ubuntu 18.04,
# see https://github.com/rust-lang/mdBook/issues/1779
- os: ubuntu-18.04
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,cargo-watch
- os: macos-10.15
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,cargo-watch
# Note: Specifying the version of valgrind and cargo-binstall is not supported.
- os: ubuntu-20.04
tool: cargo-hack@0.5.24,cargo-llvm-cov@0.5.3,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.12,shellcheck@0.9.0,shfmt@3.6.0,wasm-pack@0.10.3,wasmtime@4.0.0,mdbook@0.4.25,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
# Nextest supports basic version ranges as well. For other tools, this will be supported by https://github.com/taiki-e/install-action/pull/27.
- os: ubuntu-20.04
tool: nextest@0.9
- os: macos-11
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- os: windows-2019
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,cargo-watch
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
@@ -49,20 +51,68 @@ jobs:
with:
tool: ${{ matrix.tool }}
tidy:
test-container:
strategy:
fail-fast: false
matrix:
container:
- ubuntu:18.04 # glibc 2.27
- ubuntu:20.04 # glibc 2.31
- debian:10-slim # glibc 2.28
- debian:11-slim # glibc 2.31
- rockylinux:8 # glibc 2.28
- rockylinux:8-minimal # glibc 2.28
tool:
# valgrind: installing snap to container is difficult...
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
include:
- container: ubuntu:22.04 # glibc 2.35
# cargo-udeps depends on openssl 1.1
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- container: fedora:latest # glibc 2.36 (as of fedora 37)
# cargo-udeps depends on openssl 1.1
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- container: centos:7 # glibc 2.17
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
# we don't support nextest on very old glibc due to https://github.com/taiki-e/install-action/issues/13.
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
- container: alpine:latest # musl 1.2.3 (as of alpine 3.17)
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- name: Install requirements (ubuntu/debian)
run: |
set -euxo pipefail
apt-get -o Acquire::Retries=10 -qq update
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
- name: Install requirements (fedora/rockylinux)
run: |
set -euxo pipefail
dnf=dnf
if ! type -P dnf &>/dev/null; then
dnf=microdnf
fi
# tar and gzip are required for actions/checkout on rockylinux:*-minimal
$dnf install -y cargo tar gzip
if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'rockylinux')
- name: Install requirements (centos)
run: |
set -euxo pipefail
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}"
if: startsWith(matrix.container, 'centos')
- name: Install requirements (alpine)
run: |
set -eux
apk add bash cargo
shell: sh
if: startsWith(matrix.container, 'alpine')
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: taiki-e/install-action@shellcheck
- uses: taiki-e/install-action@shfmt
- run: npm install prettier
- run: shfmt -d $(git ls-files '*.sh')
if: always()
- run: npx prettier -c $(git ls-files '*.yml')
if: always()
- run: npx prettier -c $(git ls-files '*.js')
if: always()
- run: shellcheck $(git ls-files '*.sh')
if: always()
- uses: ./
with:
tool: ${{ matrix.tool }}

View File

@@ -26,5 +26,4 @@ jobs:
changelog: CHANGELOG.md
title: $version
branch: 'main|v[0-9]+'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

5
.gitignore vendored
View File

@@ -1,6 +1,5 @@
node_modules
package-lock.json
package.json
target
Cargo.lock
# For platform and editor specific settings, it is recommended to add to
# a global .gitignore file.

14
.shellcheckrc Normal file
View File

@@ -0,0 +1,14 @@
# ShellCheck configuration
# https://github.com/koalaman/shellcheck/blob/HEAD/shellcheck.1.md#rc-files
# See also:
# https://www.shellcheck.net/wiki/Optional
# https://google.github.io/styleguide/shellguide.html
# https://www.shellcheck.net/wiki/SC2292
# https://google.github.io/styleguide/shellguide.html#s6.3-tests
enable=require-double-brackets
# https://www.shellcheck.net/wiki/SC2250
# https://google.github.io/styleguide/shellguide.html#s5.6-variable-expansion
enable=require-variable-braces

View File

@@ -10,6 +10,310 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [1.17.3] - 2022-12-22
- Update `wasmtime@latest` to 4.0.0.
## [1.17.2] - 2022-12-17
- Update `mdbook@latest` to 0.4.25.
## [1.17.1] - 2022-12-15
- Update `mdbook@latest` to 0.4.23.
- Support `mdbook` on Linux (musl).
- Update `cargo-llvm-cov@latest` to 0.5.3.
## [1.17.0] - 2022-12-14
- Update `protoc@latest` to 3.21.12.
- Support aarch64 self-hosted runners (Linux, macOS, Windows).
- Improve support for Fedora/RHEL based containers/self-hosted runners.
## [1.16.0] - 2022-12-14
- Update `cargo-binstall@latest` to 0.18.1. ([#32](https://github.com/taiki-e/install-action/pull/32), thanks @NobodyXu)
- If the host environment lacks packages required for installation, such as `curl` or `tar`, install them if possible.
It is mainly intended to make the use of this action easy on containers or self-hosted runners, and currently supports Debian-based distributions (including Ubuntu) and Alpine.
The system's package manager is used for these installations. However, `bash`, which is an execution requirement of the action itself, and `cargo`, which is usually preferred for installation by rustup rather than the system's package manager, are *not* covered by these installations.
See also the [compatibility note in readme](https://github.com/taiki-e/install-action#compatibility).
## [1.15.5] - 2022-12-13
- Update `shellcheck@latest` to 0.9.0.
## [1.15.4] - 2022-12-12
- Update `shfmt@latest` to 3.6.0.
- Update `cargo-binstall@latest` to 0.18.0.
- Support installing `cargo-binstall` on linux with custom host targets such as x86_64-alpine-linux-musl.
## [1.15.3] - 2022-12-11
- Fix bug regarding musl host detection. ([#29](https://github.com/taiki-e/install-action/issues/29))
## [1.15.2] - 2022-12-10
- Update `mdbook-linkcheck@latest` to 0.7.7.
- Update `protoc@latest` to 3.21.11.
## [1.15.1] - 2022-12-03
- Update `wasmtime@latest` to 3.0.1.
- Update `protoc@latest` to 3.21.10.
- Update `cargo-hack@latest` to 0.5.24.
## [1.15.0] - 2022-11-29
- Support `cargo-deny`.
- Update `mdbook@latest` to 0.4.22.
## [1.14.7] - 2022-11-27
- Update `cargo-llvm-cov@latest` to 0.5.2.
## [1.14.6] - 2022-11-27
- Update `cargo-hack@latest` to 0.5.23.
- Update `cargo-llvm-cov@latest` to 0.5.1.
- Update `cargo-minimal-versions@latest` to 0.1.8.
## [1.14.5] - 2022-11-27
- Update `wasmtime@latest` to 3.0.0.
- Update `cargo-binstall@latest` to 0.17.0.
## [1.14.4] - 2022-11-04
- Update `cargo-udeps@latest` to 0.1.35.
## [1.14.3] - 2022-10-28
- Update `wasmtime@latest` to 2.0.1.
- Update `protoc@latest` to 3.21.9.
## [1.14.2] - 2022-10-25
- Update `cargo-hack@latest` to 0.5.22.
- Update `cargo-minimal-versions@latest` to 0.1.7.
- Update `parse-changelog@latest` to 0.5.2.
## [1.14.1] - 2022-10-21
- Update `wasmtime@latest` to 2.0.0.
- Update `protoc@latest` to 3.21.8.
## [1.14.0] - 2022-10-18
- Update `protoc@latest` to 3.21.7.
- Update `cargo-binstall@latest` to 0.16.0. ([#28](https://github.com/taiki-e/install-action/pull/28), thanks @NobodyXu)
- Reject semver operators in version. This was not supported even before, but was accidentally accepted in the `cargo-binstall` fallback. ([#26](https://github.com/taiki-e/install-action/pull/26), thanks @NobodyXu)
## [1.13.9] - 2022-09-28
- Update `cargo-binstall@latest` to 0.14.0. ([#24](https://github.com/taiki-e/install-action/pull/24), thanks @coltfred)
## [1.13.8] - 2022-09-26
- Update `cargo-hack@latest` to 0.5.21.
## [1.13.7] - 2022-09-25
- Work around cargo-binstall upgrade issue on Windows. ([#23](https://github.com/taiki-e/install-action/pull/23))
- Ensure that the latest cargo-binstall is used. ([#22](https://github.com/taiki-e/install-action/pull/22), thanks @NobodyXu)
## [1.13.6] - 2022-09-25
- Update `cargo-binstall@latest` to 0.13.3.
## [1.13.5] - 2022-09-24
- Update `cargo-hack@latest` to 0.5.20.
- Downgrade `cargo-binstall@latest` to 0.13.1 to avoid [upstream bug](https://github.com/cargo-bins/cargo-binstall/issues/416).
## [1.13.4] - 2022-09-22
- Update `cargo-hack@latest` to 0.5.19.
## [1.13.3] - 2022-09-20
- Update `wasmtime@latest` to 1.0.0.
## [1.13.2] - 2022-09-16
- Update `cargo-udeps@latest` to 0.1.33.
## [1.13.1] - 2022-09-15
- Update `protoc@latest` to 3.21.6.
## [1.13.0] - 2022-09-10
- Avoid using sudo on `protoc` installation.
## [1.12.4] - 2022-09-10
- Update `cargo-llvm-cov@latest` to 0.5.0.
## [1.12.3] - 2022-09-08
- Update `parse-changelog@latest` to 0.5.1.
## [1.12.2] - 2022-09-04
- Update `cargo-hack@latest` to 0.5.18.
## [1.12.1] - 2022-09-01
- Update `wasmtime@latest` to 0.40.1.
## [1.12.0] - 2022-08-28
- Support `cargo-valgrind`. ([#20](https://github.com/taiki-e/install-action/pull/20), thanks @messense)
## [1.11.2] - 2022-08-23
- Update `wasmtime@latest` to 0.40.0.
- Update `cargo-udeps@latest` to 0.1.32.
- Update `protoc@latest` to 3.21.5.
## [1.11.1] - 2022-08-13
- Make installation that uses `cargo-binstall` robust. ([#19](https://github.com/taiki-e/install-action/pull/19), thanks @NobodyXu)
## [1.11.0] - 2022-08-13
- Update `cargo-hack@latest` to 0.5.17.
- Support `cargo-udeps`. ([#17](https://github.com/taiki-e/install-action/pull/17), thanks @gifnksm)
## [1.10.4] - 2022-08-06
- Update `cargo-llvm-cov@latest` to 0.4.14.
## [1.10.3] - 2022-08-01
- Support `wasm-pack` on Windows.
- Support specifying the version of `wasm-pack`.
## [1.10.2] - 2022-08-01
- Support `protoc` on Windows.
## [1.10.1] - 2022-08-01
- Fix missing include files when installing `protoc` on Linux and macOS.
- Installation of `protoc` on Windows is not currently working (in all released versions) and is considered unsupported.
## [1.10.0] - 2022-08-01
- Set the `PROTOC` environment variable when installing `protoc` if it has not already been set.
## [1.9.0] - 2022-08-01
- Support `protoc`.
- Support `shellcheck` on Windows.
- Support `shfmt` on Windows.
## [1.8.4] - 2022-08-01
- Update `cargo-llvm-cov@latest` to 0.4.13.
## [1.8.3] - 2022-07-30
- Support `taiki-e/install-action@mdbook-linkcheck` shorthand for mdbook-linkcheck.
## [1.8.2] - 2022-07-30
- Update `cargo-hack@latest` to 0.5.16.
- Update `cargo-llvm-cov@latest` to 0.4.12.
## [1.8.1] - 2022-07-26
- Fix `cargo-binstall` installation failure.
## [1.8.0] - 2022-07-26
- Only use musl binaries for nextest if glibc isn't available. See [#13](https://github.com/taiki-e/install-action/issues/13) for more.
- Fix `cargo-binstall` installation failure. ([#16](https://github.com/taiki-e/install-action/pull/16), thanks @CAD97)
- Accept `cargo-nextest` as an alias for `nextest`. ([#15](https://github.com/taiki-e/install-action/pull/15), thanks @CAD97)
## [1.7.0] - 2022-07-25
- Install Rust-related binaries to `/usr/local/bin` when `$CARGO_HOME/bin` and `$HOME/.cargo/bin` is not available.
## [1.6.1] - 2022-07-25
- Fix diagnostics.
## [1.6.0] - 2022-07-25
- Support `mdbook-linkcheck`.
- Support `mdbook` on Windows.
- Support `wasmtime` on Windows.
- Support `nextest` on Linux (musl).
- Fix installation failure when `$CARGO_HOME/bin` and `$HOME/.cargo/bin` is not available.
## [1.5.11] - 2022-07-25
- Fix `cargo-binstall` installation on macOS and Windows.
## [1.5.10] - 2022-07-24
- Update `parse-changelog@latest` to 0.5.0.
## [1.5.9] - 2022-07-22
- Update `wasmtime@latest` to 0.39.1.
- Update `mdbook@latest` to 0.4.21.
## [1.5.8] - 2022-07-21
- Update `wasmtime@latest` to 0.39.0.
## [1.5.7] - 2022-07-20
- Update `cargo-llvm-cov@latest` to 0.4.11.
## [1.5.6] - 2022-07-18
- Update `cargo-llvm-cov@latest` to 0.4.10.
## [1.5.5] - 2022-07-18
- Update `cargo-hack@latest` to 0.5.15.
## [1.5.4] - 2022-07-16
- Update `mdbook@latest` to 0.4.20.
- Update `cross@latest` to 0.2.4.
- Update `cargo-minimal-versions@latest` to 0.1.5.
- Update `parse-changelog@latest` to 0.4.9.
## [1.5.3] - 2022-07-07
- Update `cargo-llvm-cov@latest` to 0.4.9.
## [1.5.2] - 2022-07-02
- Update `cross@latest` to 0.2.2.
## [1.5.1] - 2022-07-02
- Update `mdbook@latest` to 0.4.19.
## [1.5.0] - 2022-06-28
- Enable secure mode for `cargo-binstall`. ([#9](https://github.com/taiki-e/install-action/pull/9), thanks @NobodyXu)
- Update `wasmtime@latest` to 0.38.1.
## [1.4.2] - 2022-06-16
- Update `cargo-llvm-cov@latest` to 0.4.8.
@@ -157,7 +461,70 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.4.2...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.17.3...HEAD
[1.17.3]: https://github.com/taiki-e/install-action/compare/v1.17.2...v1.17.3
[1.17.2]: https://github.com/taiki-e/install-action/compare/v1.17.1...v1.17.2
[1.17.1]: https://github.com/taiki-e/install-action/compare/v1.17.0...v1.17.1
[1.17.0]: https://github.com/taiki-e/install-action/compare/v1.16.0...v1.17.0
[1.16.0]: https://github.com/taiki-e/install-action/compare/v1.15.5...v1.16.0
[1.15.5]: https://github.com/taiki-e/install-action/compare/v1.15.4...v1.15.5
[1.15.4]: https://github.com/taiki-e/install-action/compare/v1.15.3...v1.15.4
[1.15.3]: https://github.com/taiki-e/install-action/compare/v1.15.2...v1.15.3
[1.15.2]: https://github.com/taiki-e/install-action/compare/v1.15.1...v1.15.2
[1.15.1]: https://github.com/taiki-e/install-action/compare/v1.15.0...v1.15.1
[1.15.0]: https://github.com/taiki-e/install-action/compare/v1.14.7...v1.15.0
[1.14.7]: https://github.com/taiki-e/install-action/compare/v1.14.6...v1.14.7
[1.14.6]: https://github.com/taiki-e/install-action/compare/v1.14.5...v1.14.6
[1.14.5]: https://github.com/taiki-e/install-action/compare/v1.14.4...v1.14.5
[1.14.4]: https://github.com/taiki-e/install-action/compare/v1.14.3...v1.14.4
[1.14.3]: https://github.com/taiki-e/install-action/compare/v1.14.2...v1.14.3
[1.14.2]: https://github.com/taiki-e/install-action/compare/v1.14.1...v1.14.2
[1.14.1]: https://github.com/taiki-e/install-action/compare/v1.14.0...v1.14.1
[1.14.0]: https://github.com/taiki-e/install-action/compare/v1.13.9...v1.14.0
[1.13.9]: https://github.com/taiki-e/install-action/compare/v1.13.8...v1.13.9
[1.13.8]: https://github.com/taiki-e/install-action/compare/v1.13.7...v1.13.8
[1.13.7]: https://github.com/taiki-e/install-action/compare/v1.13.6...v1.13.7
[1.13.6]: https://github.com/taiki-e/install-action/compare/v1.13.5...v1.13.6
[1.13.5]: https://github.com/taiki-e/install-action/compare/v1.13.4...v1.13.5
[1.13.4]: https://github.com/taiki-e/install-action/compare/v1.13.3...v1.13.4
[1.13.3]: https://github.com/taiki-e/install-action/compare/v1.13.2...v1.13.3
[1.13.2]: https://github.com/taiki-e/install-action/compare/v1.13.1...v1.13.2
[1.13.1]: https://github.com/taiki-e/install-action/compare/v1.13.0...v1.13.1
[1.13.0]: https://github.com/taiki-e/install-action/compare/v1.12.4...v1.13.0
[1.12.4]: https://github.com/taiki-e/install-action/compare/v1.12.3...v1.12.4
[1.12.3]: https://github.com/taiki-e/install-action/compare/v1.12.2...v1.12.3
[1.12.2]: https://github.com/taiki-e/install-action/compare/v1.12.1...v1.12.2
[1.12.1]: https://github.com/taiki-e/install-action/compare/v1.12.0...v1.12.1
[1.12.0]: https://github.com/taiki-e/install-action/compare/v1.11.2...v1.12.0
[1.11.2]: https://github.com/taiki-e/install-action/compare/v1.11.1...v1.11.2
[1.11.1]: https://github.com/taiki-e/install-action/compare/v1.11.0...v1.11.1
[1.11.0]: https://github.com/taiki-e/install-action/compare/v1.10.4...v1.11.0
[1.10.4]: https://github.com/taiki-e/install-action/compare/v1.10.3...v1.10.4
[1.10.3]: https://github.com/taiki-e/install-action/compare/v1.10.2...v1.10.3
[1.10.2]: https://github.com/taiki-e/install-action/compare/v1.10.1...v1.10.2
[1.10.1]: https://github.com/taiki-e/install-action/compare/v1.10.0...v1.10.1
[1.10.0]: https://github.com/taiki-e/install-action/compare/v1.9.0...v1.10.0
[1.9.0]: https://github.com/taiki-e/install-action/compare/v1.8.4...v1.9.0
[1.8.4]: https://github.com/taiki-e/install-action/compare/v1.8.3...v1.8.4
[1.8.3]: https://github.com/taiki-e/install-action/compare/v1.8.2...v1.8.3
[1.8.2]: https://github.com/taiki-e/install-action/compare/v1.8.1...v1.8.2
[1.8.1]: https://github.com/taiki-e/install-action/compare/v1.8.0...v1.8.1
[1.8.0]: https://github.com/taiki-e/install-action/compare/v1.7.0...v1.8.0
[1.7.0]: https://github.com/taiki-e/install-action/compare/v1.6.1...v1.7.0
[1.6.1]: https://github.com/taiki-e/install-action/compare/v1.6.0...v1.6.1
[1.6.0]: https://github.com/taiki-e/install-action/compare/v1.5.11...v1.6.0
[1.5.11]: https://github.com/taiki-e/install-action/compare/v1.5.10...v1.5.11
[1.5.10]: https://github.com/taiki-e/install-action/compare/v1.5.9...v1.5.10
[1.5.9]: https://github.com/taiki-e/install-action/compare/v1.5.8...v1.5.9
[1.5.8]: https://github.com/taiki-e/install-action/compare/v1.5.7...v1.5.8
[1.5.7]: https://github.com/taiki-e/install-action/compare/v1.5.6...v1.5.7
[1.5.6]: https://github.com/taiki-e/install-action/compare/v1.5.5...v1.5.6
[1.5.5]: https://github.com/taiki-e/install-action/compare/v1.5.4...v1.5.5
[1.5.4]: https://github.com/taiki-e/install-action/compare/v1.5.3...v1.5.4
[1.5.3]: https://github.com/taiki-e/install-action/compare/v1.5.2...v1.5.3
[1.5.2]: https://github.com/taiki-e/install-action/compare/v1.5.1...v1.5.2
[1.5.1]: https://github.com/taiki-e/install-action/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/taiki-e/install-action/compare/v1.4.2...v1.5.0
[1.4.2]: https://github.com/taiki-e/install-action/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/taiki-e/install-action/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/taiki-e/install-action/compare/v1.3.13...v1.4.0

View File

@@ -1,6 +1,6 @@
# install-action
[![build status](https://img.shields.io/github/workflow/status/taiki-e/install-action/CI/main?style=flat-square&logo=github)](https://github.com/taiki-e/install-action/actions)
[![build status](https://img.shields.io/github/actions/workflow/status/taiki-e/install-action/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/install-action/actions)
GitHub Action for installing development tools (mainly from GitHub Releases).
@@ -9,6 +9,7 @@ GitHub Action for installing development tools (mainly from GitHub Releases).
- [Example workflow](#example-workflow)
- [Supported tools](#supported-tools)
- [Security](#security)
- [Compatibility](#compatibility)
- [Related Projects](#related-projects)
- [License](#license)
@@ -39,7 +40,7 @@ To install a specific version, use `@version` syntax:
```yaml
- uses: taiki-e/install-action@v1
with:
tool: cargo-hack@0.5.11
tool: cargo-hack@0.5.24
```
To install multiple tools:
@@ -66,19 +67,28 @@ https://spdx.org/licenses
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- |
| [**cargo-hack**](https://github.com/taiki-e/cargo-hack) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-hack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-MIT) |
| [**cargo-llvm-cov**](https://github.com/taiki-e/cargo-llvm-cov) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-llvm-cov/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-MIT) |
| [**cargo-minimal-versions**](https://github.com/taiki-e/cargo-minimal-versions) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-minimal-versions/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-MIT) |
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `~/.cargo/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-MIT) |
| [**cross**](https://github.com/cross-rs/cross) | `~/.cargo/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-MIT) |
| [**nextest**](https://github.com/nextest-rs/nextest) | `~/.cargo/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) |
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) |
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS | [BSD-3-Clause](https://github.com/mvdan/sh/blob/HEAD/LICENSE) |
| [**cargo-binstall**][cargo-binstall] | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cargo-bins/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE) |
| [**cargo-deny**](https://github.com/EmbarkStudios/cargo-deny) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/EmbarkStudios/cargo-deny/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/EmbarkStudios/cargo-deny/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/EmbarkStudios/cargo-deny/blob/HEAD/LICENSE-MIT) |
| [**cargo-hack**](https://github.com/taiki-e/cargo-hack) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-hack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-MIT) |
| [**cargo-llvm-cov**](https://github.com/taiki-e/cargo-llvm-cov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-llvm-cov/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-MIT) |
| [**cargo-minimal-versions**](https://github.com/taiki-e/cargo-minimal-versions) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-minimal-versions/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-MIT) |
| [**cargo-udeps**](https://github.com/est31/cargo-udeps) | `$CARGO_HOME/bin` | [GitHub Release](https://github.com/est31/cargo-udeps/releases) | Linux, macOS, Windows | [Apache-2.0 OR MIT](https://github.com/est31/cargo-udeps/blob/master/LICENSE) |
| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Release](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) or [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) |
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-MIT) |
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/HEAD/LICENSE) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/HEAD/LICENSE) |
| [**nextest**](https://github.com/nextest-rs/nextest) (alias: `cargo-nextest`) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) |
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-MIT) |
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) |
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/mvdan/sh/blob/HEAD/LICENSE) |
| [**valgrind**](https://valgrind.org) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0-or-later](https://valgrind.org/docs/manual/license.gpl.html) |
| [**wasm-pack**](https://github.com/rustwasm/wasm-pack) | `~/.cargo/bin` | [GitHub Releases](https://github.com/rustwasm/wasm-pack/releases) | Linux, macOS | [Apache-2.0](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-MIT) |
| [**wasmtime**](https://github.com/bytecodealliance/wasmtime) | `~/.cargo/bin` | [GitHub Releases](https://github.com/bytecodealliance/wasmtime/releases) | Linux, macOS | [Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/HEAD/LICENSE) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `~/.cargo/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/HEAD/LICENSE) |
| [**cargo-binstall**][cargo-binstall] | `~/.cargo/bin` | [GitHub Releases](https://github.com/ryankurte/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/ryankurte/cargo-binstall/blob/HEAD/LICENSE.txt) |
| [**wasm-pack**](https://github.com/rustwasm/wasm-pack) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustwasm/wasm-pack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-MIT) |
| [**wasmtime**](https://github.com/bytecodealliance/wasmtime) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/bytecodealliance/wasmtime/releases) | Linux, macOS, Windows | [Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/HEAD/LICENSE) |
If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `/usr/local/bin`.<br>
If `/usr/local/bin` is not available, binaries will be installed to `$HOME/.install-action/bin`.<br>
If a tool not included in the list above is specified, this action uses [cargo-binstall] as a fallback.
@@ -92,13 +102,21 @@ When installing the tool from GitHub Releases, this action will download the too
If you want a higher level of security, consider working on [#1](https://github.com/taiki-e/install-action/issues/1).
## Compatibility
This action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows) and containers (Ubuntu, Debian, Alpine, Fedora, CentOS, Rocky).
To use this action in self-hosted runners or in containers, you will need to install at least the following:
- bash
- cargo (if you install cargo subcommands or use cargo-binstall fallback)
## Related Projects
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
- [upload-rust-binary-action]: GitHub Action for building and uploading Rust binary to GitHub Releases.
- [setup-cross-toolchain-action]: GitHub Action for setup toolchains for cross compilation and cross testing for Rust.
[cargo-binstall]: https://github.com/ryankurte/cargo-binstall
[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall
[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action
[setup-cross-toolchain-action]: https://github.com/taiki-e/setup-cross-toolchain-action
[upload-rust-binary-action]: https://github.com/taiki-e/upload-rust-binary-action

634
main.sh
View File

@@ -30,71 +30,166 @@ warn() {
info() {
echo "info: $*"
}
download() {
local url="$1"
local bin_dir="$2"
local bin="$3"
if [[ "${bin_dir}" == "/usr/"* ]]; then
if [[ ! -d "${bin_dir}" ]]; then
bin_dir="${HOME}/.install-action/bin"
if [[ ! -d "${bin_dir}" ]]; then
mkdir -p "${bin_dir}"
echo "${bin_dir}" >>"${GITHUB_PATH}"
export PATH="${PATH}:${bin_dir}"
fi
fi
fi
local tar_args=()
case "${url}" in
*.tar.gz | *.tgz) tar_args+=("xzf") ;;
*.tar.bz2 | *.tbz2)
tar_args+=("xjf")
if ! type -P bzip2 &>/dev/null; then
case "${base_distro}" in
debian | alpine | fedora) sys_install bzip2 ;;
esac
fi
;;
*.tar.xz | *.txz)
tar_args+=("xJf")
if ! type -P xz &>/dev/null; then
case "${base_distro}" in
debian) sys_install xz-utils ;;
alpine | fedora) sys_install xz ;;
esac
fi
;;
*.zip)
if ! type -P unzip &>/dev/null; then
case "${base_distro}" in
debian | alpine | fedora) sys_install unzip ;;
esac
fi
mkdir -p .install-action-tmp
(
cd .install-action-tmp
info "downloading ${url}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
unzip tmp.zip
mv "${bin}" "${bin_dir}/"
)
rm -rf .install-action-tmp
return 0
;;
*) bail "unrecognized archive format '${url}' for ${tool}" ;;
esac
tar_args+=("-")
local components
components=$(tr <<<"${bin}" -cd '/' | wc -c)
if [[ "${components}" != "0" ]]; then
tar_args+=(--strip-components "${components}")
fi
info "downloading ${url}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" \
| tar "${tar_args[@]}" -C "${bin_dir}" "${bin}"
}
install_cargo_binstall() {
cargo_bin="${CARGO_HOME:-$HOME/.cargo}/bin"
# https://github.com/cargo-bins/cargo-binstall/releases
local binstall_version="0.18.1"
local install_binstall='1'
if [[ -f "${cargo_bin}/cargo-binstall${exe}" ]]; then
if [[ "$(cargo binstall -V)" == "cargo-binstall ${binstall_version}" ]]; then
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall${exe}"
install_binstall=''
else
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall${exe}, but is not compatible version with install-action, upgrading"
rm "${cargo_bin}/cargo-binstall${exe}"
fi
fi
if [ ! -f "${cargo_bin}/cargo-binstall" ]; then
if [[ -n "${install_binstall}" ]]; then
info "installing cargo-binstall"
target="$(rustc -vV | grep host | cut -c 7-)"
base_url=https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall
is_zip=false
case "${target}" in
x86_64-unknown-linux-gnu) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
x86_64-unknown-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
armv7-unknown-linux-gnueabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
armv7-unknown-linux-musleabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
aarch64-unknown-linux-gnu) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
aarch64-unknown-linux-musl) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
x86_64-pc-windows-gnu)
is_zip=true
url="${base_url}-x86_64-pc-windows-msvc.zip"
;;
x86_64-apple-darwin | aarch64-apple-darwin | x86_64-pc-windows-msvc)
is_zip=true
url="${base_url}-${target}.zip"
;;
*) bail "unsupported target '${target}' for cargo-binstall" ;;
esac
if [ $is_zip = true ]; then
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "$url" -o "cargo-binstall-${target}.zip"
unzip "cargo-binstall-${target}.zip"
rm "cargo-binstall-${target}.zip"
else
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "$url" | tar xzf -
fi
mkdir -p "{cargo_bin}/"
base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/v${binstall_version}/cargo-binstall"
case "${OSTYPE}" in
cygwin* | msys*) mv cargo-binstall.exe "${cargo_bin}/" ;;
*) mv cargo-binstall "${cargo_bin}/" ;;
linux*) url="${base_url}-${host_arch}-unknown-linux-musl.tgz" ;;
darwin*) url="${base_url}-${host_arch}-apple-darwin.zip" ;;
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for cargo-binstall" ;;
esac
else
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall"
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
info "cargo-binstall installed at $(type -P "cargo-binstall${exe}")"
x cargo binstall -V
fi
}
cargo_binstall() {
tool="$1"
version="$2"
local tool="$1"
local version="$2"
info "install-action does not support ${tool}, fallback to cargo-binstall"
install_cargo_binstall
# By default, cargo-binstall enforce downloads over secure transports only.
# As a result, http will be disabled, and it will also set
# min tls version to be 1.2
case "${version}" in
latest)
cargo binstall --no-confirm "$tool"
;;
*)
cargo binstall --no-confirm --version "$version" "$tool"
;;
latest) cargo binstall --force --no-confirm "${tool}" ;;
*) cargo binstall --force --no-confirm --version "${version}" "${tool}" ;;
esac
}
apt_update() {
if type -P sudo &>/dev/null; then
retry sudo apt-get -o Acquire::Retries=10 -qq update
else
retry apt-get -o Acquire::Retries=10 -qq update
fi
apt_updated=1
}
apt_install() {
if [[ -z "${apt_updated:-}" ]]; then
apt_update
fi
if type -P sudo &>/dev/null; then
retry sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends "$@"
else
retry apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends "$@"
fi
}
apt_remove() {
if type -P sudo &>/dev/null; then
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y "$@"
else
apt-get -qq -o Dpkg::Use-Pty=0 remove -y "$@"
fi
}
snap_install() {
if type -P sudo &>/dev/null; then
retry sudo snap install "$@"
else
retry snap install "$@"
fi
}
apk_install() {
if type -P doas &>/dev/null; then
doas apk add "$@"
else
apk add "$@"
fi
}
dnf_install() {
if type -P sudo &>/dev/null; then
retry sudo "${dnf}" install -y "$@"
else
retry "${dnf}" install -y "$@"
fi
}
sys_install() {
case "${base_distro}" in
debian) apt_install "$@" ;;
alpine) apk_install "$@" ;;
fedora) dnf_install "$@" ;;
esac
}
@@ -106,52 +201,196 @@ export DEBIAN_FRONTEND=noninteractive
# Inputs
tool="${INPUT_TOOL:-}"
tools=()
if [[ -n "${tool}" ]]; then
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
fi
# Refs: https://github.com/rust-lang/rustup/blob/HEAD/rustup-init.sh
case "$(uname -m)" in
aarch64 | arm64) host_arch="aarch64" ;;
xscale | arm | armv6l | armv7l | armv8l)
# Ignore arm for now, as we need to consider the version and whether hard-float is supported.
# https://github.com/rust-lang/rustup/pull/593
# https://github.com/cross-rs/cross/pull/1018
# Does it seem only armv7l is supported?
# https://github.com/actions/runner/blob/6b9e8a6be411a6e63d5ccaf3c47e7b7622c5ec49/src/Misc/externals.sh#L174
bail "32-bit ARM runner is not supported yet by this action"
;;
# GitHub Actions Runner supports Linux (x86_64, aarch64, arm), Windows (x86_64, aarch64),
# and macOS (x86_64, aarch64).
# https://github.com/actions/runner
# https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#supported-architectures-and-operating-systems-for-self-hosted-runners
# So we can assume x86_64 unless it is aarch64 or arm.
*) host_arch="x86_64" ;;
esac
base_distro=""
exe=""
case "${OSTYPE}" in
linux*)
host_env="gnu"
if (ldd --version 2>&1 || true) | grep -q 'musl'; then
host_env="musl"
fi
if grep -q '^ID_LIKE=' /etc/os-release; then
base_distro="$(grep '^ID_LIKE=' /etc/os-release | sed 's/^ID_LIKE=//')"
case "${base_distro}" in
*debian*) base_distro=debian ;;
*alpine*) base_distro=alpine ;;
*fedora*) base_distro=fedora ;;
esac
else
base_distro="$(grep '^ID=' /etc/os-release | sed 's/^ID=//')"
fi
case "${base_distro}" in
fedora)
dnf=dnf
if ! type -P dnf &>/dev/null; then
if type -P microdnf &>/dev/null; then
# fedora-based distributions have "minimal" images that
# use microdnf instead of dnf.
dnf=microdnf
else
# If neither dnf nor microdnf is available, it is
# probably an RHEL7-based distribution that does not
# have dnf installed by default.
dnf=yum
fi
fi
;;
esac
;;
cygwin* | msys*) exe=".exe" ;;
esac
cargo_bin="${CARGO_HOME:-"${HOME}/.cargo"}/bin"
if [[ ! -d "${cargo_bin}" ]]; then
cargo_bin=/usr/local/bin
fi
if ! type -P curl &>/dev/null || ! type -P tar &>/dev/null; then
case "${base_distro}" in
debian | alpine | fedora) sys_install ca-certificates curl tar ;;
esac
fi
for tool in "${tools[@]}"; do
if [[ "${tool}" == *"@"* ]]; then
version="${tool#*@}"
if [[ ! "${version}" =~ ^([1-9][0-9]*(\.[0-9]+(\.[0-9]+)?)?|0\.[1-9][0-9]*(\.[0-9]+)?|^0\.0\.[0-9]+)(-[0-9A-Za-z\.-]+)?(\+[0-9A-Za-z\.-]+)?$|^latest$ ]]; then
bail "install-action does not support semver operators"
fi
else
version="latest"
fi
tool="${tool%@*}"
bin="${tool}${exe}"
info "installing ${tool}@${version}"
case "${tool}" in
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
case "${tool}" in
# https://github.com/taiki-e/cargo-hack/releases
cargo-hack) latest_version="0.5.14" ;;
cargo-hack) latest_version="0.5.24" ;;
# https://github.com/taiki-e/cargo-llvm-cov/releases
cargo-llvm-cov) latest_version="0.4.8" ;;
cargo-llvm-cov) latest_version="0.5.3" ;;
# https://github.com/taiki-e/cargo-minimal-versions/releases
cargo-minimal-versions) latest_version="0.1.4" ;;
cargo-minimal-versions) latest_version="0.1.8" ;;
# https://github.com/taiki-e/parse-changelog/releases
parse-changelog) latest_version="0.4.8" ;;
parse-changelog) latest_version="0.5.2" ;;
*) exit 1 ;;
esac
repo="taiki-e/${tool}"
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-musl" ;;
darwin*) target="x86_64-apple-darwin" ;;
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
case "${OSTYPE}" in
linux*) target="${host_arch}-unknown-linux-musl" ;;
darwin*) target="${host_arch}-apple-darwin" ;;
cygwin* | msys*)
case "${tool}" in
cargo-llvm-cov) target="x86_64-pc-windows-msvc" ;;
*) target="${host_arch}-pc-windows-msvc" ;;
esac
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
cargo-udeps)
# https://github.com/est31/cargo-udeps/releases
latest_version="0.1.35"
repo="est31/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
case "${OSTYPE}" in
linux*)
target="x86_64-unknown-linux-gnu"
url="${base_url}-${target}.tar.gz"
;;
darwin*)
target="x86_64-apple-darwin"
url="${base_url}-${target}.tar.gz"
;;
cygwin* | msys*)
target="x86_64-pc-windows-msvc"
url="${base_url}-${target}.zip"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
# leading `./` is required for cargo-udeps to work
download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}"
;;
cargo-valgrind)
# https://github.com/jfrimmel/cargo-valgrind/releases
latest_version="2.1.0"
repo="jfrimmel/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-${version}"
case "${OSTYPE}" in
linux*)
target="x86_64-unknown-linux-musl"
url="${base_url}-${target}.tar.gz"
;;
darwin*)
target="x86_64-apple-darwin"
url="${base_url}-${target}.tar.gz"
;;
cygwin* | msys*)
target="x86_64-pc-windows-msvc"
url="${base_url}-${target}.zip"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
cargo-deny)
# https://github.com/EmbarkStudios/cargo-deny/releases
latest_version="0.13.5"
repo="EmbarkStudios/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-musl" ;;
darwin*) target="${host_arch}-apple-darwin" ;;
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
url="https://github.com/${repo}/releases/download/${version}/${tool}-${version}-${target}.tar.gz"
download "${url}" "${cargo_bin}" "${tool}-${version}-${target}/${tool}${exe}"
;;
cross)
# https://github.com/cross-rs/cross/releases
latest_version="0.2.1"
repo="cross-rs/cross"
latest_version="0.2.4"
repo="cross-rs/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-musl" ;;
darwin*) target="x86_64-apple-darwin" ;;
@@ -159,137 +398,256 @@ for tool in "${tools[@]}"; do
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
0.1.* | 0.2.[0-1]) url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}-${target}.tar.gz" ;;
*) url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/cross-v${version}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
nextest)
nextest | cargo-nextest)
bin="cargo-nextest"
# https://nexte.st/book/pre-built-binaries.html
case "${OSTYPE}" in
linux*) url="https://get.nexte.st/${version}/linux" ;;
linux*)
# musl build of nextest is slow, so use glibc build if host_env is gnu.
# https://github.com/taiki-e/install-action/issues/13
case "${host_env}" in
gnu) url="https://get.nexte.st/${version}/linux" ;;
*) url="https://get.nexte.st/${version}/linux-musl" ;;
esac
;;
darwin*) url="https://get.nexte.st/${version}/mac" ;;
cygwin* | msys*) url="https://get.nexte.st/${version}/windows-tar" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
info "downloading ${url}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" \
| tar xzf - -C "${cargo_bin}"
;;
protoc)
# https://github.com/protocolbuffers/protobuf/releases
latest_version="3.21.12"
repo="protocolbuffers/protobuf"
case "${version}" in
latest) version="${latest_version}" ;;
esac
miner_patch_version="${version#*.}"
base_url="https://github.com/${repo}/releases/download/v${miner_patch_version}/protoc-${miner_patch_version}"
# Copying files to /usr/local/include requires sudo, so do not use it.
bin_dir="${HOME}/.install-action/bin"
include_dir="${HOME}/.install-action/include"
if [[ ! -d "${bin_dir}" ]]; then
mkdir -p "${bin_dir}"
mkdir -p "${include_dir}"
echo "${bin_dir}" >>"${GITHUB_PATH}"
export PATH="${PATH}:${bin_dir}"
fi
case "${OSTYPE}" in
linux*) url="${base_url}-linux-${host_arch/aarch/aarch_}.zip" ;;
darwin*) url="${base_url}-osx-${host_arch/aarch/aarch_}.zip" ;;
cygwin* | msys*) url="${base_url}-win64.zip" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
if ! type -P unzip &>/dev/null; then
case "${base_distro}" in
debian | alpine | fedora) sys_install unzip ;;
esac
fi
mkdir -p .install-action-tmp
(
cd .install-action-tmp
info "downloading ${url}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
unzip tmp.zip
mv "bin/protoc${exe}" "${bin_dir}/"
mkdir -p "${include_dir}/"
cp -r include/. "${include_dir}/"
case "${OSTYPE}" in
cygwin* | msys*) bin_dir=$(sed <<<"${bin_dir}" 's/^\/c\//C:\\/') ;;
esac
if [[ -z "${PROTOC:-}" ]]; then
info "setting PROTOC environment variable"
echo "PROTOC=${bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
fi
)
rm -rf .install-action-tmp
;;
shellcheck)
# https://github.com/koalaman/shellcheck/releases
latest_version="0.8.0"
repo="koalaman/shellcheck"
latest_version="0.9.0"
repo="koalaman/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
bin="${tool}-v${version}/${tool}${exe}"
case "${OSTYPE}" in
linux*)
if type -P shellcheck &>/dev/null; then
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y shellcheck
apt_remove shellcheck
fi
target="linux"
url="${base_url}.linux.${host_arch}.tar.xz"
;;
darwin*) url="${base_url}.darwin.x86_64.tar.xz" ;;
cygwin* | msys*)
url="${base_url}.zip"
bin="${tool}${exe}"
;;
darwin*) target="darwin" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/shellcheck-v${version}.${target}.x86_64.tar.xz"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xJf - --strip-components 1 -C /usr/local/bin "shellcheck-v${version}/shellcheck"
download "${url}" /usr/local/bin "${bin}"
;;
shfmt)
# https://github.com/mvdan/sh/releases
latest_version="3.5.1"
latest_version="3.6.0"
repo="mvdan/sh"
case "${OSTYPE}" in
linux*) target="linux_amd64" ;;
darwin*) target="darwin_amd64" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/shfmt_v${version}_${target}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused -o /usr/local/bin/shfmt "${url}"
chmod +x /usr/local/bin/shfmt
bin_dir="/usr/local/bin"
case "${OSTYPE}" in
linux*)
case "${host_arch}" in
aarch64) target="linux_arm64" ;;
*) target="linux_amd64" ;;
esac
;;
darwin*)
case "${host_arch}" in
aarch64) target="darwin_arm64" ;;
*) target="darwin_amd64" ;;
esac
;;
cygwin* | msys*)
target="windows_amd64"
bin_dir="${HOME}/.install-action/bin"
if [[ ! -d "${bin_dir}" ]]; then
mkdir -p "${bin_dir}"
echo "${bin_dir}" >>"${GITHUB_PATH}"
export PATH="${PATH}:${bin_dir}"
fi
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}_v${version}_${target}${exe}"
info "downloading ${url}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 -o "${bin_dir}/${tool}${exe}" "${url}"
case "${OSTYPE}" in
linux* | darwin*) chmod +x "${bin_dir}/${tool}${exe}" ;;
esac
;;
valgrind)
case "${version}" in
latest) ;;
*) warn "specifying the version of ${tool} is not supported yet by this action" ;;
esac
case "${OSTYPE}" in
linux*) ;;
darwin* | cygwin* | msys*) bail "${tool} for non-linux is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) ;;
*) warn "specifying the version of ${tool} is not supported yet by this action" ;;
esac
retry sudo apt-get -o Acquire::Retries=10 -qq update
# libc6-dbg is needed to run Valgrind
retry sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y libc6-dbg
apt_install libc6-dbg
# Use snap to install the latest Valgrind
# https://snapcraft.io/install/valgrind/ubuntu
retry sudo snap install valgrind --classic
snap_install valgrind --classic
;;
wasm-pack)
# https://rustwasm.github.io/wasm-pack/installer
# https://github.com/rustwasm/wasm-pack/releases
latest_version="0.10.3"
repo="rustwasm/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
case "${OSTYPE}" in
linux* | darwin*) ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
linux*) target="${host_arch}-unknown-linux-musl" ;;
darwin*) target="x86_64-apple-darwin" ;;
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}-${target}.tar.gz"
download "${url}" "${cargo_bin}" "${tool}-v${version}-${target}/${tool}${exe}"
;;
wasmtime)
# https://github.com/bytecodealliance/wasmtime/releases
latest_version="0.37.0"
repo="bytecodealliance/wasmtime"
case "${OSTYPE}" in
linux*) target="x86_64-linux" ;;
darwin*) target="x86_64-macos" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
latest_version="4.0.0"
repo="bytecodealliance/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/bytecodealliance/wasmtime/releases/download/v${version}/wasmtime-v${version}-${target}.tar.xz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xJf - --strip-components 1 -C ${CARGO_HOME:-~/.cargo}/bin "wasmtime-v${version}-${target}/wasmtime"
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
case "${OSTYPE}" in
linux*)
target="${host_arch}-linux"
url="${base_url}-${target}.tar.xz"
;;
darwin*)
target="${host_arch}-macos"
url="${base_url}-${target}.tar.xz"
;;
cygwin* | msys*)
target="x86_64-windows"
url="${base_url}-${target}.zip"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
download "${url}" "${cargo_bin}" "${tool}-v${version}-${target}/${tool}${exe}"
;;
mdbook)
# https://github.com/rust-lang/mdBook/releases
latest_version="0.4.18"
latest_version="0.4.25"
repo="rust-lang/mdBook"
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-gnu" ;;
darwin*) target="x86_64-apple-darwin" ;;
# TODO: mdbook has windows binaries, but they use `.zip` and not `.tar.gz`.
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
case "${OSTYPE}" in
linux*)
case "${version}" in
0.[1-3].* | 0.4.? | 0.4.1? | 0.4.2[0-1]) url="${base_url}-x86_64-unknown-linux-gnu.tar.gz" ;;
*) url="${base_url}-${host_arch}-unknown-linux-musl.tar.gz" ;;
esac
;;
darwin*) url="${base_url}-x86_64-apple-darwin.tar.gz" ;;
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
mdbook-linkcheck)
# https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases
latest_version="0.7.7"
repo="Michael-F-Bryan/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-gnu" ;;
darwin*) target="x86_64-apple-darwin" ;;
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}.${target}.zip"
download "${url}" "${cargo_bin}" "${tool}${exe}"
case "${OSTYPE}" in
linux* | darwin*) chmod +x "${cargo_bin}/${tool}${exe}" ;;
esac
;;
cargo-binstall)
install_cargo_binstall
echo
continue
;;
cargo-binstall) install_cargo_binstall ;;
*)
cargo_binstall "$tool" "$version"
cargo_binstall "${tool}" "${version}"
continue
;;
esac
info "${tool} installed at $(type -P "${tool}")"
case "${tool}" in
cargo-* | nextest) x cargo "${tool#cargo-}" --version ;;
info "${tool} installed at $(type -P "${bin}")"
case "${bin}" in
"cargo-udeps${exe}") x cargo udeps --help | head -1 ;; # cargo-udeps v0.1.30 does not support --version option
"cargo-valgrind${exe}") x cargo valgrind --help ;; # cargo-valgrind v2.1.0 does not support --version option
cargo-*) x cargo "${tool#cargo-}" --version ;;
*) x "${tool}" --version ;;
esac
echo

View File

@@ -3,13 +3,16 @@ set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..
# shellcheck disable=SC2154
trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR
# Publish a new release.
#
# USAGE:
# ./tools/publish.sh <VERSION>
#
# Note:
# - This script requires parse-changelog <https://github.com/taiki-e/parse-changelog>
# Note: This script requires the following tools:
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
bail() {
echo >&2 "error: $*"
@@ -77,19 +80,25 @@ if [[ -n "${tags}" ]]; then
fi
tools=(
cargo-binstall
cargo-deny
cargo-hack
cargo-llvm-cov
cargo-minimal-versions
parse-changelog
cargo-nextest
cargo-udeps
cargo-valgrind
cross
mdbook
mdbook-linkcheck
nextest
parse-changelog
protoc
shellcheck
shfmt
valgrind
wasm-pack
wasmtime
mdbook
cargo-binstall
)
(
@@ -99,16 +108,16 @@ tools=(
git push origin main
git push origin --tags
version_tag="v${version%%.*}"
git checkout -b "${version_tag}"
git push origin refs/heads/"${version_tag}"
if git --no-pager tag | grep -Eq "^${version_tag}$"; then
git tag -d "${version_tag}"
git push --delete origin refs/tags/"${version_tag}"
major_version_tag="v${version%%.*}"
git checkout -b "${major_version_tag}"
git push origin refs/heads/"${major_version_tag}"
if git --no-pager tag | grep -Eq "^${major_version_tag}$"; then
git tag -d "${major_version_tag}"
git push --delete origin refs/tags/"${major_version_tag}"
fi
git tag "${version_tag}"
git tag "${major_version_tag}"
git checkout main
git branch -d "${version_tag}"
git branch -d "${major_version_tag}"
)
for tool in "${tools[@]}"; do

View File

@@ -4,60 +4,165 @@ set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..
# shellcheck disable=SC2154
trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR
# USAGE:
# ./tools/tidy.sh
#
# Note: This script requires the following tools:
# - shfmt
# - prettier
# - shellcheck
# - npm
# - jq and yq (if this repository uses bors)
# - clang-format (if any of C/C++ exists)
#
# This script is shared with other repositories, so there may also be
# checks for files not included in this repository, but they will be
# skipped if the corresponding files do not exist.
x() {
local cmd="$1"
shift
if [[ -n "${verbose:-}" ]]; then
(
set -x
"${cmd}" "$@"
)
else
(
set -x
"${cmd}" "$@"
)
}
check_diff() {
if [[ -n "${CI:-}" ]]; then
if ! git --no-pager diff --exit-code "$@"; then
should_fail=1
fi
else
if ! git --no-pager diff --exit-code "$@" &>/dev/null; then
should_fail=1
fi
fi
}
warn() {
echo >&2 "warning: $*"
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
echo "::warning::$*"
else
echo >&2 "warning: $*"
fi
should_fail=1
}
if [[ "${1:-}" == "-v" ]]; then
shift
verbose=1
fi
if [[ $# -gt 0 ]]; then
cat <<EOF
USAGE:
$0 [-v]
$0
EOF
exit 1
fi
prettier=prettier
if type -P npm &>/dev/null && type -P "$(npm bin)/prettier" &>/dev/null; then
prettier="$(npm bin)/prettier"
# C/C++ (if exists)
if [[ -n "$(git ls-files '*.c')$(git ls-files '*.cpp')" ]]; then
if [[ ! -e .clang-format ]]; then
warn "could not fount .clang-format in the repository root"
fi
if type -P clang-format &>/dev/null; then
x clang-format -i $(git ls-files '*.c') $(git ls-files '*.cpp')
check_diff $(git ls-files '*.c') $(git ls-files '*.cpp')
else
warn "'clang-format' is not installed"
fi
fi
# YAML/JavaScript/JSON (if exists)
if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')" ]]; then
if type -P npm &>/dev/null; then
x npx prettier -l -w $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json')
check_diff $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json')
else
warn "'npm' is not installed"
fi
if [[ -e .github/workflows/ci.yml ]] && grep -q '# tidy:needs' .github/workflows/ci.yml && ! grep -Eq '# *needs: \[' .github/workflows/ci.yml; then
if type -P jq &>/dev/null && type -P yq &>/dev/null; then
# shellcheck disable=SC2207
jobs_actual=($(yq '.jobs' .github/workflows/ci.yml | jq -r 'keys_unsorted[]'))
unset 'jobs_actual[${#jobs_actual[@]}-1]'
# shellcheck disable=SC2207
jobs_expected=($(yq -r '.jobs."ci-success".needs[]' .github/workflows/ci.yml))
if [[ "${jobs_actual[*]}" != "${jobs_expected[*]+"${jobs_expected[*]}"}" ]]; then
printf -v jobs '%s, ' "${jobs_actual[@]}"
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" .github/workflows/ci.yml
check_diff .github/workflows/ci.yml
warn "please update 'needs' section in 'ci-success' job"
fi
else
warn "'jq' or 'yq' is not installed"
fi
fi
fi
if [[ -n "$(git ls-files '*.yaml')" ]]; then
warn "please use '.yml' instead of '.yaml' for consistency"
git ls-files '*.yaml'
fi
# Shell scripts
if type -P shfmt &>/dev/null; then
x shfmt -l -w $(git ls-files '*.sh')
check_diff $(git ls-files '*.sh')
else
warn "'shfmt' is not installed"
fi
if type -P "${prettier}" &>/dev/null; then
x "${prettier}" -l -w $(git ls-files '*.yml')
x "${prettier}" -l -w $(git ls-files '*.js')
else
warn "'prettier' is not installed"
fi
if type -P shellcheck &>/dev/null; then
x shellcheck $(git ls-files '*.sh')
if ! x shellcheck $(git ls-files '*.sh'); then
should_fail=1
fi
if [[ -n "$(git ls-files '*Dockerfile')" ]]; then
# SC2154 doesn't seem to work on dockerfile.
if ! x shellcheck -e SC2148,SC2154,SC2250 $(git ls-files '*Dockerfile'); then
should_fail=1
fi
fi
else
warn "'shellcheck' is not installed"
fi
# Spell check (if config exists)
if [[ -f .cspell.json ]]; then
if type -P npm &>/dev/null; then
if [[ -f Cargo.toml ]]; then
metadata=$(cargo metadata --format-version=1 --all-features --no-deps)
dependencies=''
for id in $(jq <<<"${metadata}" '.workspace_members[]'); do
dependencies+=$'\n'
dependencies+=$(jq <<<"${metadata}" ".packages[] | select(.id == ${id})" | jq -r '.dependencies[].name')
done
cat >.github/.cspell/rust-dependencies.txt <<EOF
// This file is @generated by $(basename "$0").
// It is not intended for manual editing.
EOF
# shellcheck disable=SC2001
sed <<<"${dependencies}" 's/[0-9_-]/\n/g' | LC_ALL=C sort -f -u | (grep -E '.{4,}' || true) >>.github/.cspell/rust-dependencies.txt
check_diff .github/.cspell/rust-dependencies.txt
else
touch .github/.cspell/rust-dependencies.txt
fi
x npx cspell --no-progress $(git ls-files)
for dictionary in .github/.cspell/*.txt; do
if [[ "${dictionary}" == .github/.cspell/project-dictionary.txt ]]; then
continue
fi
dup=$(sed '/^$/d' .github/.cspell/project-dictionary.txt "${dictionary}" | LC_ALL=C sort -f | uniq -d -i | (grep -v '//.*' || true))
if [[ -n "${dup}" ]]; then
warn "duplicated words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
echo "======================================="
echo "${dup}"
echo "======================================="
fi
done
else
warn "'npm' is not installed"
fi
fi
if [[ -n "${should_fail:-}" ]]; then
exit 1
fi