mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-11 15:10:24 +00:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a29ce630c | ||
|
|
acc0c0687d | ||
|
|
c98c0a5de9 | ||
|
|
b5a6a481a3 | ||
|
|
936bda0c55 | ||
|
|
e0abba697f | ||
|
|
320900e2b1 | ||
|
|
4ea8614f66 | ||
|
|
c4112353fe | ||
|
|
d14576d5ee | ||
|
|
54f239fc7f | ||
|
|
0c60ab7876 | ||
|
|
cb3ffa00b0 | ||
|
|
a68686a8a2 | ||
|
|
c5a36f2fba | ||
|
|
5e3287fe00 | ||
|
|
807aa14713 | ||
|
|
1ab447b34f | ||
|
|
d66f303732 | ||
|
|
59c6ff35e6 | ||
|
|
4dad9dd51d | ||
|
|
9ff3167a7f | ||
|
|
2a026de3a2 | ||
|
|
f69fae4162 | ||
|
|
c3ee7d751f | ||
|
|
ff96887f37 | ||
|
|
97334a704a | ||
|
|
83639e6b24 | ||
|
|
8bc4e50568 | ||
|
|
1fa8737224 | ||
|
|
a75cc5295d | ||
|
|
ee26d44cfa | ||
|
|
4eef07f07c | ||
|
|
bb72b7ab31 | ||
|
|
f80dd34cc7 | ||
|
|
a252073294 | ||
|
|
f4a1ca475e | ||
|
|
d33a0a9074 | ||
|
|
3594558506 | ||
|
|
bbcb7fd5c9 | ||
|
|
155e686da4 | ||
|
|
e5d84f2a67 | ||
|
|
0865eee0cd | ||
|
|
ab2d9d2b4f | ||
|
|
8666426bd7 | ||
|
|
5b5badbee3 | ||
|
|
8f358b0517 | ||
|
|
087b8bdbf4 | ||
|
|
22d12abbc7 | ||
|
|
c4dcfd4545 | ||
|
|
36e7fe7dbe | ||
|
|
d49da406cc | ||
|
|
d0f28d3db6 | ||
|
|
96c3fd376d | ||
|
|
4091e8ab02 | ||
|
|
956e75d2d4 | ||
|
|
44a0ddacb9 | ||
|
|
ce55513d1e | ||
|
|
d650d1426d | ||
|
|
9de731de5b | ||
|
|
8c5018c59c | ||
|
|
f5afcb464c | ||
|
|
b42a02cb11 | ||
|
|
c971aa51fb | ||
|
|
c0929bd53c | ||
|
|
dfd35942fe | ||
|
|
078ab003a2 | ||
|
|
ba4b012f19 | ||
|
|
6746ad0324 | ||
|
|
68642cc590 | ||
|
|
97df8adcf7 | ||
|
|
f021e393f7 | ||
|
|
0158edbfba | ||
|
|
e3981a6d57 | ||
|
|
1bc9250743 | ||
|
|
999ba40f44 | ||
|
|
b8a856acea | ||
|
|
9f3710a281 | ||
|
|
e85ee51dd0 | ||
|
|
c35547fc3a | ||
|
|
7e60635127 | ||
|
|
25db2c0373 | ||
|
|
eabd84cfdd | ||
|
|
c7aafffa95 | ||
|
|
93c0efda22 | ||
|
|
71ce4c0326 | ||
|
|
e380e63944 | ||
|
|
0f4d53b2aa | ||
|
|
ac22f2e031 | ||
|
|
c079fd141a | ||
|
|
edbd1909dc | ||
|
|
618bb235a3 | ||
|
|
93a94c2059 | ||
|
|
6bb27b4afe | ||
|
|
ca5df137f6 | ||
|
|
a7ac3cded3 | ||
|
|
2b9035e07b | ||
|
|
6c0394aa23 | ||
|
|
815f5e1266 | ||
|
|
d5d85f7b2e | ||
|
|
a0deac80c0 |
49
.cspell.json
Normal file
49
.cspell.json
Normal 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": []
|
||||||
|
}
|
||||||
109
.github/.cspell/organization-dictionary.txt
vendored
Normal file
109
.github/.cspell/organization-dictionary.txt
vendored
Normal 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
25
.github/.cspell/project-dictionary.txt
vendored
Normal 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
0
.github/.cspell/rust-dependencies.txt
vendored
Normal file
94
.github/workflows/ci.yml
vendored
94
.github/workflows/ci.yml
vendored
@@ -10,7 +10,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 1 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -18,24 +18,30 @@ defaults:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
tidy:
|
||||||
|
uses: taiki-e/workflows/.github/workflows/tidy-no-rust.yml@main
|
||||||
|
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
tool:
|
tool:
|
||||||
# Note: Specifying the version of valgrind is not supported.
|
|
||||||
# cargo-watch is supported by cargo-binstall (through quickinstall)
|
# cargo-watch is supported by cargo-binstall (through quickinstall)
|
||||||
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
- 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
|
||||||
- cargo-hack@0.5.18,cargo-llvm-cov@0.5.0,cargo-minimal-versions@0.1.5,parse-changelog@0.5.1,cargo-udeps@0.1.33,cargo-valgrind@2.1.0,cross@0.2.4,nextest@0.9.11,protoc@3.21.6,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@0.40.1,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1
|
|
||||||
# Nextest supports basic version ranges as well
|
|
||||||
- nextest@0.9
|
|
||||||
include:
|
include:
|
||||||
|
# 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
|
- os: macos-11
|
||||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,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
|
||||||
- os: windows-2019
|
- os: windows-2019
|
||||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,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 }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -45,20 +51,68 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
tool: ${{ matrix.tool }}
|
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
|
runs-on: ubuntu-latest
|
||||||
|
container: ${{ matrix.container }}
|
||||||
steps:
|
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
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: taiki-e/install-action@shellcheck
|
- uses: ./
|
||||||
- uses: taiki-e/install-action@shfmt
|
with:
|
||||||
- run: npm install prettier
|
tool: ${{ matrix.tool }}
|
||||||
- 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()
|
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
node_modules
|
target
|
||||||
package-lock.json
|
Cargo.lock
|
||||||
package.json
|
|
||||||
|
|
||||||
# For platform and editor specific settings, it is recommended to add to
|
# For platform and editor specific settings, it is recommended to add to
|
||||||
# a global .gitignore file.
|
# a global .gitignore file.
|
||||||
|
|||||||
161
CHANGELOG.md
161
CHANGELOG.md
@@ -10,6 +10,139 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [1.13.2] - 2022-09-16
|
||||||
|
|
||||||
- Update `cargo-udeps@latest` to 0.1.33.
|
- Update `cargo-udeps@latest` to 0.1.33.
|
||||||
@@ -328,7 +461,33 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.13.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.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.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.13.0]: https://github.com/taiki-e/install-action/compare/v1.12.4...v1.13.0
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -1,6 +1,6 @@
|
|||||||
# install-action
|
# install-action
|
||||||
|
|
||||||
[](https://github.com/taiki-e/install-action/actions)
|
[](https://github.com/taiki-e/install-action/actions)
|
||||||
|
|
||||||
GitHub Action for installing development tools (mainly from GitHub Releases).
|
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)
|
- [Example workflow](#example-workflow)
|
||||||
- [Supported tools](#supported-tools)
|
- [Supported tools](#supported-tools)
|
||||||
- [Security](#security)
|
- [Security](#security)
|
||||||
|
- [Compatibility](#compatibility)
|
||||||
- [Related Projects](#related-projects)
|
- [Related Projects](#related-projects)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ To install a specific version, use `@version` syntax:
|
|||||||
```yaml
|
```yaml
|
||||||
- uses: taiki-e/install-action@v1
|
- uses: taiki-e/install-action@v1
|
||||||
with:
|
with:
|
||||||
tool: cargo-hack@0.5.18
|
tool: cargo-hack@0.5.24
|
||||||
```
|
```
|
||||||
|
|
||||||
To install multiple tools:
|
To install multiple tools:
|
||||||
@@ -66,21 +67,22 @@ https://spdx.org/licenses
|
|||||||
|
|
||||||
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | License |
|
| Name | Where binaries will be installed | Where will it be installed from | Supported platform | 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-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-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-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-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) |
|
||||||
| [**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) |
|
| [**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) |
|
||||||
| [**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) |
|
|
||||||
| [**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) |
|
| [**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**](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) |
|
|
||||||
| [**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-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) |
|
| [**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) |
|
| [**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) |
|
| [**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) |
|
| [**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) |
|
| [**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) |
|
||||||
| [**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) |
|
|
||||||
| [**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) |
|
| [**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) |
|
| [**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) |
|
||||||
|
|
||||||
@@ -100,6 +102,14 @@ 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).
|
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
|
## Related Projects
|
||||||
|
|
||||||
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
|
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
|
||||||
|
|||||||
308
main.sh
308
main.sh
@@ -47,14 +47,34 @@ download() {
|
|||||||
local tar_args=()
|
local tar_args=()
|
||||||
case "${url}" in
|
case "${url}" in
|
||||||
*.tar.gz | *.tgz) tar_args+=("xzf") ;;
|
*.tar.gz | *.tgz) tar_args+=("xzf") ;;
|
||||||
*.tar.bz2 | *.tbz2) tar_args+=("xjf") ;;
|
*.tar.bz2 | *.tbz2)
|
||||||
*.tar.xz | *.txz) tar_args+=("xJf") ;;
|
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)
|
*.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
|
mkdir -p .install-action-tmp
|
||||||
(
|
(
|
||||||
cd .install-action-tmp
|
cd .install-action-tmp
|
||||||
info "downloading ${url}"
|
info "downloading ${url}"
|
||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" -o tmp.zip
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
|
||||||
unzip tmp.zip
|
unzip tmp.zip
|
||||||
mv "${bin}" "${bin_dir}/"
|
mv "${bin}" "${bin_dir}/"
|
||||||
)
|
)
|
||||||
@@ -70,45 +90,37 @@ download() {
|
|||||||
tar_args+=(--strip-components "${components}")
|
tar_args+=(--strip-components "${components}")
|
||||||
fi
|
fi
|
||||||
info "downloading ${url}"
|
info "downloading ${url}"
|
||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" \
|
||||||
| tar "${tar_args[@]}" -C "${bin_dir}" "${bin}"
|
| tar "${tar_args[@]}" -C "${bin_dir}" "${bin}"
|
||||||
}
|
}
|
||||||
host_triple() {
|
|
||||||
if [[ -z "${host:-}" ]]; then
|
|
||||||
host="$(rustc -vV | grep host | cut -c 7-)"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
install_cargo_binstall() {
|
install_cargo_binstall() {
|
||||||
if [[ ! -f "${cargo_bin}/cargo-binstall" ]]; then
|
# 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 [[ -n "${install_binstall}" ]]; then
|
||||||
info "installing cargo-binstall"
|
info "installing cargo-binstall"
|
||||||
|
|
||||||
host_triple
|
base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/v${binstall_version}/cargo-binstall"
|
||||||
base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall
|
case "${OSTYPE}" in
|
||||||
case "${host}" in
|
linux*) url="${base_url}-${host_arch}-unknown-linux-musl.tgz" ;;
|
||||||
x86_64-unknown-linux-gnu) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
|
darwin*) url="${base_url}-${host_arch}-apple-darwin.zip" ;;
|
||||||
x86_64-unknown-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
|
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
||||||
|
*) bail "unsupported OSTYPE '${OSTYPE}' for cargo-binstall" ;;
|
||||||
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) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
|
||||||
|
|
||||||
x86_64-apple-darwin | aarch64-apple-darwin | x86_64-pc-windows-msvc)
|
|
||||||
url="${base_url}-${host}.zip"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*) bail "unsupported target '${host}' for cargo-binstall" ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
|
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
|
||||||
info "cargo-binstall installed at $(type -P "cargo-binstall${exe}")"
|
info "cargo-binstall installed at $(type -P "cargo-binstall${exe}")"
|
||||||
x cargo binstall -V
|
x cargo binstall -V
|
||||||
else
|
|
||||||
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall, upgrading"
|
|
||||||
cargo binstall --secure --no-confirm --version '>=0.12.0' cargo-binstall
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
cargo_binstall() {
|
cargo_binstall() {
|
||||||
@@ -119,12 +131,65 @@ cargo_binstall() {
|
|||||||
|
|
||||||
install_cargo_binstall
|
install_cargo_binstall
|
||||||
|
|
||||||
# --secure mode enforce downloads over secure transports only.
|
# By default, cargo-binstall enforce downloads over secure transports only.
|
||||||
# As a result, http will be disabled, and it will also set
|
# As a result, http will be disabled, and it will also set
|
||||||
# min tls version to be 1.2
|
# min tls version to be 1.2
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) cargo binstall --force --secure --no-confirm "${tool}" ;;
|
latest) cargo binstall --force --no-confirm "${tool}" ;;
|
||||||
*) cargo binstall --force --secure --no-confirm --version "${version}" "${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
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,8 +206,60 @@ if [[ -n "${tool}" ]]; then
|
|||||||
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
|
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
|
||||||
fi
|
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=""
|
exe=""
|
||||||
case "${OSTYPE}" in
|
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" ;;
|
cygwin* | msys*) exe=".exe" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -151,9 +268,18 @@ if [[ ! -d "${cargo_bin}" ]]; then
|
|||||||
cargo_bin=/usr/local/bin
|
cargo_bin=/usr/local/bin
|
||||||
fi
|
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
|
for tool in "${tools[@]}"; do
|
||||||
if [[ "${tool}" == *"@"* ]]; then
|
if [[ "${tool}" == *"@"* ]]; then
|
||||||
version="${tool#*@}"
|
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
|
else
|
||||||
version="latest"
|
version="latest"
|
||||||
fi
|
fi
|
||||||
@@ -164,13 +290,13 @@ for tool in "${tools[@]}"; do
|
|||||||
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
|
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
|
||||||
case "${tool}" in
|
case "${tool}" in
|
||||||
# https://github.com/taiki-e/cargo-hack/releases
|
# https://github.com/taiki-e/cargo-hack/releases
|
||||||
cargo-hack) latest_version="0.5.18" ;;
|
cargo-hack) latest_version="0.5.24" ;;
|
||||||
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
||||||
cargo-llvm-cov) latest_version="0.5.0" ;;
|
cargo-llvm-cov) latest_version="0.5.3" ;;
|
||||||
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
||||||
cargo-minimal-versions) latest_version="0.1.5" ;;
|
cargo-minimal-versions) latest_version="0.1.8" ;;
|
||||||
# https://github.com/taiki-e/parse-changelog/releases
|
# https://github.com/taiki-e/parse-changelog/releases
|
||||||
parse-changelog) latest_version="0.5.1" ;;
|
parse-changelog) latest_version="0.5.2" ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
repo="taiki-e/${tool}"
|
repo="taiki-e/${tool}"
|
||||||
@@ -178,9 +304,14 @@ for tool in "${tools[@]}"; do
|
|||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
esac
|
esac
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) target="x86_64-unknown-linux-musl" ;;
|
linux*) target="${host_arch}-unknown-linux-musl" ;;
|
||||||
darwin*) target="x86_64-apple-darwin" ;;
|
darwin*) target="${host_arch}-apple-darwin" ;;
|
||||||
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
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}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
esac
|
esac
|
||||||
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
|
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
|
||||||
@@ -188,7 +319,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
cargo-udeps)
|
cargo-udeps)
|
||||||
# https://github.com/est31/cargo-udeps/releases
|
# https://github.com/est31/cargo-udeps/releases
|
||||||
latest_version="0.1.33"
|
latest_version="0.1.35"
|
||||||
repo="est31/${tool}"
|
repo="est31/${tool}"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
@@ -213,7 +344,7 @@ for tool in "${tools[@]}"; do
|
|||||||
download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}"
|
download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}"
|
||||||
;;
|
;;
|
||||||
cargo-valgrind)
|
cargo-valgrind)
|
||||||
# https://github.com/jfrimmel/cargo-valgrind
|
# https://github.com/jfrimmel/cargo-valgrind/releases
|
||||||
latest_version="2.1.0"
|
latest_version="2.1.0"
|
||||||
repo="jfrimmel/${tool}"
|
repo="jfrimmel/${tool}"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
@@ -237,6 +368,22 @@ for tool in "${tools[@]}"; do
|
|||||||
esac
|
esac
|
||||||
download "${url}" "${cargo_bin}" "${tool}${exe}"
|
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)
|
cross)
|
||||||
# https://github.com/cross-rs/cross/releases
|
# https://github.com/cross-rs/cross/releases
|
||||||
latest_version="0.2.4"
|
latest_version="0.2.4"
|
||||||
@@ -261,9 +408,10 @@ for tool in "${tools[@]}"; do
|
|||||||
# https://nexte.st/book/pre-built-binaries.html
|
# https://nexte.st/book/pre-built-binaries.html
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*)
|
linux*)
|
||||||
host_triple
|
# musl build of nextest is slow, so use glibc build if host_env is gnu.
|
||||||
case "${host}" in
|
# https://github.com/taiki-e/install-action/issues/13
|
||||||
*-linux-gnu*) url="https://get.nexte.st/${version}/linux" ;;
|
case "${host_env}" in
|
||||||
|
gnu) url="https://get.nexte.st/${version}/linux" ;;
|
||||||
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@@ -272,19 +420,19 @@ for tool in "${tools[@]}"; do
|
|||||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
esac
|
esac
|
||||||
info "downloading ${url}"
|
info "downloading ${url}"
|
||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" \
|
||||||
| tar xzf - -C "${cargo_bin}"
|
| tar xzf - -C "${cargo_bin}"
|
||||||
;;
|
;;
|
||||||
protoc)
|
protoc)
|
||||||
# https://github.com/protocolbuffers/protobuf/releases
|
# https://github.com/protocolbuffers/protobuf/releases
|
||||||
latest_version="3.21.6"
|
latest_version="3.21.12"
|
||||||
repo="protocolbuffers/protobuf"
|
repo="protocolbuffers/protobuf"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
esac
|
esac
|
||||||
miner_patch_version="${version#*.}"
|
miner_patch_version="${version#*.}"
|
||||||
base_url="https://github.com/${repo}/releases/download/v${miner_patch_version}/protoc-${miner_patch_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.
|
# Copying files to /usr/local/include requires sudo, so do not use it.
|
||||||
bin_dir="${HOME}/.install-action/bin"
|
bin_dir="${HOME}/.install-action/bin"
|
||||||
include_dir="${HOME}/.install-action/include"
|
include_dir="${HOME}/.install-action/include"
|
||||||
if [[ ! -d "${bin_dir}" ]]; then
|
if [[ ! -d "${bin_dir}" ]]; then
|
||||||
@@ -294,16 +442,21 @@ for tool in "${tools[@]}"; do
|
|||||||
export PATH="${PATH}:${bin_dir}"
|
export PATH="${PATH}:${bin_dir}"
|
||||||
fi
|
fi
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) url="${base_url}-linux-x86_64.zip" ;;
|
linux*) url="${base_url}-linux-${host_arch/aarch/aarch_}.zip" ;;
|
||||||
darwin*) url="${base_url}-osx-x86_64.zip" ;;
|
darwin*) url="${base_url}-osx-${host_arch/aarch/aarch_}.zip" ;;
|
||||||
cygwin* | msys*) url="${base_url}-win64.zip" ;;
|
cygwin* | msys*) url="${base_url}-win64.zip" ;;
|
||||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
esac
|
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
|
mkdir -p .install-action-tmp
|
||||||
(
|
(
|
||||||
cd .install-action-tmp
|
cd .install-action-tmp
|
||||||
info "downloading ${url}"
|
info "downloading ${url}"
|
||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" -o tmp.zip
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
|
||||||
unzip tmp.zip
|
unzip tmp.zip
|
||||||
mv "bin/protoc${exe}" "${bin_dir}/"
|
mv "bin/protoc${exe}" "${bin_dir}/"
|
||||||
mkdir -p "${include_dir}/"
|
mkdir -p "${include_dir}/"
|
||||||
@@ -320,7 +473,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
shellcheck)
|
shellcheck)
|
||||||
# https://github.com/koalaman/shellcheck/releases
|
# https://github.com/koalaman/shellcheck/releases
|
||||||
latest_version="0.8.0"
|
latest_version="0.9.0"
|
||||||
repo="koalaman/${tool}"
|
repo="koalaman/${tool}"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
@@ -330,9 +483,9 @@ for tool in "${tools[@]}"; do
|
|||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*)
|
linux*)
|
||||||
if type -P shellcheck &>/dev/null; then
|
if type -P shellcheck &>/dev/null; then
|
||||||
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y shellcheck
|
apt_remove shellcheck
|
||||||
fi
|
fi
|
||||||
url="${base_url}.linux.x86_64.tar.xz"
|
url="${base_url}.linux.${host_arch}.tar.xz"
|
||||||
;;
|
;;
|
||||||
darwin*) url="${base_url}.darwin.x86_64.tar.xz" ;;
|
darwin*) url="${base_url}.darwin.x86_64.tar.xz" ;;
|
||||||
cygwin* | msys*)
|
cygwin* | msys*)
|
||||||
@@ -345,15 +498,25 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# https://github.com/mvdan/sh/releases
|
# https://github.com/mvdan/sh/releases
|
||||||
latest_version="3.5.1"
|
latest_version="3.6.0"
|
||||||
repo="mvdan/sh"
|
repo="mvdan/sh"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
esac
|
esac
|
||||||
bin_dir="/usr/local/bin"
|
bin_dir="/usr/local/bin"
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) target="linux_amd64" ;;
|
linux*)
|
||||||
darwin*) target="darwin_amd64" ;;
|
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*)
|
cygwin* | msys*)
|
||||||
target="windows_amd64"
|
target="windows_amd64"
|
||||||
bin_dir="${HOME}/.install-action/bin"
|
bin_dir="${HOME}/.install-action/bin"
|
||||||
@@ -367,7 +530,7 @@ for tool in "${tools[@]}"; do
|
|||||||
esac
|
esac
|
||||||
url="https://github.com/${repo}/releases/download/v${version}/${tool}_v${version}_${target}${exe}"
|
url="https://github.com/${repo}/releases/download/v${version}/${tool}_v${version}_${target}${exe}"
|
||||||
info "downloading ${url}"
|
info "downloading ${url}"
|
||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused -o "${bin_dir}/${tool}${exe}" "${url}"
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 -o "${bin_dir}/${tool}${exe}" "${url}"
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux* | darwin*) chmod +x "${bin_dir}/${tool}${exe}" ;;
|
linux* | darwin*) chmod +x "${bin_dir}/${tool}${exe}" ;;
|
||||||
esac
|
esac
|
||||||
@@ -382,12 +545,11 @@ for tool in "${tools[@]}"; do
|
|||||||
darwin* | cygwin* | msys*) bail "${tool} for non-linux is not supported yet by this action" ;;
|
darwin* | cygwin* | msys*) bail "${tool} for non-linux is not supported yet by this action" ;;
|
||||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
esac
|
esac
|
||||||
retry sudo apt-get -o Acquire::Retries=10 -qq update
|
|
||||||
# libc6-dbg is needed to run Valgrind
|
# 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
|
# Use snap to install the latest Valgrind
|
||||||
# https://snapcraft.io/install/valgrind/ubuntu
|
# https://snapcraft.io/install/valgrind/ubuntu
|
||||||
retry sudo snap install valgrind --classic
|
snap_install valgrind --classic
|
||||||
;;
|
;;
|
||||||
wasm-pack)
|
wasm-pack)
|
||||||
# https://github.com/rustwasm/wasm-pack/releases
|
# https://github.com/rustwasm/wasm-pack/releases
|
||||||
@@ -397,7 +559,7 @@ for tool in "${tools[@]}"; do
|
|||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
esac
|
esac
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) target="x86_64-unknown-linux-musl" ;;
|
linux*) target="${host_arch}-unknown-linux-musl" ;;
|
||||||
darwin*) target="x86_64-apple-darwin" ;;
|
darwin*) target="x86_64-apple-darwin" ;;
|
||||||
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
||||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
@@ -407,7 +569,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
wasmtime)
|
wasmtime)
|
||||||
# https://github.com/bytecodealliance/wasmtime/releases
|
# https://github.com/bytecodealliance/wasmtime/releases
|
||||||
latest_version="0.40.1"
|
latest_version="4.0.0"
|
||||||
repo="bytecodealliance/${tool}"
|
repo="bytecodealliance/${tool}"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
@@ -415,11 +577,11 @@ for tool in "${tools[@]}"; do
|
|||||||
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
|
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*)
|
linux*)
|
||||||
target="x86_64-linux"
|
target="${host_arch}-linux"
|
||||||
url="${base_url}-${target}.tar.xz"
|
url="${base_url}-${target}.tar.xz"
|
||||||
;;
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
target="x86_64-macos"
|
target="${host_arch}-macos"
|
||||||
url="${base_url}-${target}.tar.xz"
|
url="${base_url}-${target}.tar.xz"
|
||||||
;;
|
;;
|
||||||
cygwin* | msys*)
|
cygwin* | msys*)
|
||||||
@@ -432,14 +594,19 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
mdbook)
|
mdbook)
|
||||||
# https://github.com/rust-lang/mdBook/releases
|
# https://github.com/rust-lang/mdBook/releases
|
||||||
latest_version="0.4.21"
|
latest_version="0.4.25"
|
||||||
repo="rust-lang/mdBook"
|
repo="rust-lang/mdBook"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
esac
|
esac
|
||||||
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
|
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) url="${base_url}-x86_64-unknown-linux-gnu.tar.gz" ;;
|
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" ;;
|
darwin*) url="${base_url}-x86_64-apple-darwin.tar.gz" ;;
|
||||||
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
||||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||||
@@ -448,7 +615,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
mdbook-linkcheck)
|
mdbook-linkcheck)
|
||||||
# https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases
|
# https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases
|
||||||
latest_version="0.7.6"
|
latest_version="0.7.7"
|
||||||
repo="Michael-F-Bryan/${tool}"
|
repo="Michael-F-Bryan/${tool}"
|
||||||
case "${version}" in
|
case "${version}" in
|
||||||
latest) version="${latest_version}" ;;
|
latest) version="${latest_version}" ;;
|
||||||
@@ -467,6 +634,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
cargo-binstall)
|
cargo-binstall)
|
||||||
install_cargo_binstall
|
install_cargo_binstall
|
||||||
|
echo
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -3,13 +3,16 @@ set -euo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR
|
||||||
|
|
||||||
# Publish a new release.
|
# Publish a new release.
|
||||||
#
|
#
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# ./tools/publish.sh <VERSION>
|
# ./tools/publish.sh <VERSION>
|
||||||
#
|
#
|
||||||
# Note:
|
# Note: This script requires the following tools:
|
||||||
# - This script requires parse-changelog <https://github.com/taiki-e/parse-changelog>
|
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
|
||||||
|
|
||||||
bail() {
|
bail() {
|
||||||
echo >&2 "error: $*"
|
echo >&2 "error: $*"
|
||||||
@@ -77,19 +80,20 @@ if [[ -n "${tags}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
tools=(
|
tools=(
|
||||||
|
cargo-binstall
|
||||||
|
cargo-deny
|
||||||
cargo-hack
|
cargo-hack
|
||||||
cargo-llvm-cov
|
cargo-llvm-cov
|
||||||
cargo-minimal-versions
|
cargo-minimal-versions
|
||||||
|
cargo-nextest
|
||||||
cargo-udeps
|
cargo-udeps
|
||||||
cargo-valgrind
|
cargo-valgrind
|
||||||
parse-changelog
|
|
||||||
cargo-binstall
|
|
||||||
cross
|
cross
|
||||||
mdbook
|
mdbook
|
||||||
mdbook-linkcheck
|
mdbook-linkcheck
|
||||||
protoc
|
|
||||||
nextest
|
nextest
|
||||||
cargo-nextest
|
parse-changelog
|
||||||
|
protoc
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
valgrind
|
valgrind
|
||||||
|
|||||||
151
tools/tidy.sh
151
tools/tidy.sh
@@ -4,60 +4,165 @@ set -euo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR
|
||||||
|
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# ./tools/tidy.sh
|
# ./tools/tidy.sh
|
||||||
#
|
#
|
||||||
# Note: This script requires the following tools:
|
# Note: This script requires the following tools:
|
||||||
# - shfmt
|
# - shfmt
|
||||||
# - prettier
|
|
||||||
# - shellcheck
|
# - 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() {
|
x() {
|
||||||
local cmd="$1"
|
local cmd="$1"
|
||||||
shift
|
shift
|
||||||
if [[ -n "${verbose:-}" ]]; then
|
(
|
||||||
(
|
set -x
|
||||||
set -x
|
|
||||||
"${cmd}" "$@"
|
|
||||||
)
|
|
||||||
else
|
|
||||||
"${cmd}" "$@"
|
"${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
|
fi
|
||||||
}
|
}
|
||||||
warn() {
|
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
|
if [[ $# -gt 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
USAGE:
|
USAGE:
|
||||||
$0 [-v]
|
$0
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prettier=prettier
|
# C/C++ (if exists)
|
||||||
if type -P npm &>/dev/null && type -P "$(npm bin)/prettier" &>/dev/null; then
|
if [[ -n "$(git ls-files '*.c')$(git ls-files '*.cpp')" ]]; then
|
||||||
prettier="$(npm bin)/prettier"
|
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
|
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
|
if type -P shfmt &>/dev/null; then
|
||||||
x shfmt -l -w $(git ls-files '*.sh')
|
x shfmt -l -w $(git ls-files '*.sh')
|
||||||
|
check_diff $(git ls-files '*.sh')
|
||||||
else
|
else
|
||||||
warn "'shfmt' is not installed"
|
warn "'shfmt' is not installed"
|
||||||
fi
|
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
|
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
|
else
|
||||||
warn "'shellcheck' is not installed"
|
warn "'shellcheck' is not installed"
|
||||||
fi
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user