Compare commits

..

16 Commits

Author SHA1 Message Date
Taiki Endo
7ef4fec011 Release 2.6.10 2023-04-07 13:34:39 +09:00
github-actions[bot]
a6cd5fac26 Update cargo-deny@latest to 0.13.8 (#99)
Co-authored-by: Taiki Endo <te316e89@gmail.com>
2023-04-07 13:08:04 +10:00
Taiki Endo
e0b88e5cc1 Release 2.6.9 2023-04-05 22:58:30 +09:00
Taiki Endo
2402df67ca Update tools/tidy.sh 2023-04-05 22:57:49 +09:00
Taiki Endo
4d6942468f Update cargo-llvm-cov@latest to 0.5.14 2023-04-05 22:56:47 +09:00
Taiki Endo
046c416559 Release 2.6.8 2023-04-05 13:28:24 +09:00
github-actions[bot]
88e9b610ea Update cargo-tarpaulin@latest to 0.25.2 (#97)
Co-authored-by: Taiki Endo <te316e89@gmail.com>
2023-04-05 13:22:48 +10:00
Taiki Endo
af69857b4d Release 2.6.7 2023-04-04 13:05:46 +09:00
Taiki Endo
e0569e0473 Update cspell dictionary 2023-04-04 13:05:24 +09:00
github-actions[bot]
5ba293a432 Update cargo-llvm-cov@latest to 0.5.13 (#96) 2023-04-04 13:49:06 +10:00
Taiki Endo
7282cc8708 Revert "Update release scripts"
This reverts commit 2336994aba.
2023-04-03 06:41:57 +09:00
Taiki Endo
02416c9844 Release 2.6.6 2023-04-03 06:32:46 +09:00
Taiki Endo
329d41893a Update cargo-llvm-cov@latest to 0.5.12 2023-04-03 06:31:57 +09:00
Taiki Endo
2336994aba Update release scripts 2023-04-03 05:52:57 +09:00
Taiki Endo
71ccc3978d Update cspell dictionary 2023-04-03 05:51:47 +09:00
Taiki Endo
28dd623da7 Ignore username in todo comment in spell-check 2023-03-30 22:39:28 +09:00
13 changed files with 235 additions and 157 deletions

View File

@@ -26,7 +26,7 @@
],
"ignoreRegExpList": [
// Copyright notice
"Copyright ((\\(c\\)|\\(C\\)|©) )?.*",
"Copyright .*",
// GHA actions/workflows
"uses: .+@",
// GHA context (repo name, owner name, etc.)
@@ -35,6 +35,8 @@
"( |\\[)@[\\w_-]+",
// Git config username
"git config user.name .*",
// Username in todo comment
"(TODO|FIXME)\\([\\w_., -]+\\)",
// Cargo.toml authors
"authors *= *\\[.*\\]",
"\".* <[\\w_.+-]+@[\\w.-]+>\""

View File

@@ -29,6 +29,7 @@ Zmiri
// Rust target triple
aarch
amdgpu
androideabi
armeb
armebv
@@ -61,10 +62,12 @@ musleabi
musleabihf
newlibeabihf
nvptx
ohos
openwrt
riscv
softfloat
sparcv
spirv
thumbeb
thumbebv
thumbv
@@ -85,19 +88,23 @@ acqrel
alloc
bools
builtins
bytecount
canonicalize
concat
consts
ctypes
dealloc
deque
docsrs
doctest
doctests
hasher
impls
inlateout
intrinsics
lateout
mclass
memcpy
msrv
nand
nomem
@@ -110,6 +117,7 @@ rclass
repr
rfind
rfold
rposition
rsplit
rustlib
seqcst
@@ -124,6 +132,8 @@ unsized
upcastable
// Other
armel
armhf
binutils
connrefused
cygwin
@@ -139,7 +149,9 @@ objdump
pipefail
powerset
proto
ranlib
readelf
shellcheckrc
SIGABRT
SIGILL
SIGINT

View File

@@ -1,5 +1,4 @@
binstall
bytecodealliance
coreutils
distro
doas
@@ -7,21 +6,15 @@ dprint
enablerepo
epel
grcov
jfrimmel
koalaman
libc
linkcheck
mdbook
microdnf
mvdan
nextest
protobuf
protoc
protocolbuffers
pwsh
quickinstall
rockylinux
rustwasm
shellcheck
shfmt
udeps

View File

@@ -29,4 +29,3 @@ jobs:
title: $version
branch: 'main|v[0-9]+'
token: ${{ secrets.GITHUB_TOKEN }}
- run: ci/publish.sh

View File

@@ -10,6 +10,26 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [2.6.10] - 2023-04-07
- Update `cargo-deny@latest` to 0.13.8.
## [2.6.9] - 2023-04-05
- Update `cargo-llvm-cov@latest` to 0.5.14.
## [2.6.8] - 2023-04-05
- Update `cargo-tarpaulin@latest` to 0.25.2.
## [2.6.7] - 2023-04-04
- Update `cargo-llvm-cov@latest` to 0.5.13.
## [2.6.6] - 2023-04-02
- Update `cargo-llvm-cov@latest` to 0.5.12.
## [2.6.5] - 2023-03-25
- Update `cargo-binstall@latest` to 0.22.0.
@@ -699,7 +719,12 @@ Note: This release is considered a breaking change because installing on version
Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.6.5...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.6.10...HEAD
[2.6.10]: https://github.com/taiki-e/install-action/compare/v2.6.9...v2.6.10
[2.6.9]: https://github.com/taiki-e/install-action/compare/v2.6.8...v2.6.9
[2.6.8]: https://github.com/taiki-e/install-action/compare/v2.6.7...v2.6.8
[2.6.7]: https://github.com/taiki-e/install-action/compare/v2.6.6...v2.6.7
[2.6.6]: https://github.com/taiki-e/install-action/compare/v2.6.5...v2.6.6
[2.6.5]: https://github.com/taiki-e/install-action/compare/v2.6.4...v2.6.5
[2.6.4]: https://github.com/taiki-e/install-action/compare/v2.6.3...v2.6.4
[2.6.3]: https://github.com/taiki-e/install-action/compare/v2.6.2...v2.6.3

View File

@@ -17,31 +17,3 @@ See JSON files in `tools/codegen/base` directory for examples of the manifest.
3\. Add tool name to test matrix in `.github/workflows/ci.yml`.
4\. Add tool name to table in "Supported tools" section in `README.md`.
## Release new version
Note: This is a guide for maintainers.
### Minor version vs patch version
Increase the patch version if only the following changes are included.
- Update the `@latest` version of the tool.
Rationale: Normally, tool versions are controlled by the `@<version>` syntax, which is explicitly separated from the versioning of the install-action itself.
Exception: If the major or minor version of the `cargo-binstall` is updated, the minor version should be increased because the behavior of the fallback may change slightly.
- Fix regressions or minor bugs.
Rationale: Semantic Versioning.
- Improve documentation or diagnostics.
Rationale: Semantic Versioning.
Increase the minor version otherwise.
### Release instructions
TODO: current release script assumes admin permissions

View File

@@ -3,15 +3,6 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..
bail() {
echo >&2 "error: $*"
exit 1
}
if [[ -z "${CI:-}" ]]; then
bail "this script is intended to call from release workflow on CI"
fi
git config user.name "Taiki Endo"
git config user.email "te316e89@gmail.com"

View File

@@ -1,74 +0,0 @@
#!/usr/bin/env bash
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
bail() {
echo >&2 "error: $*"
exit 1
}
if [[ -z "${CI:-}" ]]; then
bail "this script is intended to call from release workflow on CI"
fi
ref="${GITHUB_REF:-}"
if [[ "${ref}" != "refs/tags/"* ]]; then
bail "tag ref should start with 'refs/tags/'"
fi
tag="${ref#refs/tags/}"
git config user.name "Taiki Endo"
git config user.email "te316e89@gmail.com"
version="${tag}"
version="${version#v}"
tools=()
for tool in tools/codegen/base/*.json; do
tools+=("$(basename "${tool%.*}")")
done
# Aliases
tools+=(nextest)
# Not manifest-base
tools+=(valgrind)
(
set -x
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 "${major_version_tag}"
git checkout main
git branch -d "${major_version_tag}"
)
for tool in "${tools[@]}"; do
(
set -x
git checkout -b "${tool}"
sed -i -e "s/required: true/required: false/g" action.yml
sed -i -e "s/# default: #publish:tool/default: ${tool}/g" action.yml
git add action.yml
git commit -m "${tool}"
git push origin -f refs/heads/"${tool}"
if git --no-pager tag | grep -Eq "^${tool}$"; then
git tag -d "${tool}"
git push --delete origin refs/tags/"${tool}"
fi
git tag "${tool}"
git checkout main
git branch -D "${tool}"
)
done
set -x
git push origin --tags

View File

@@ -18,10 +18,24 @@
}
},
"latest": {
"version": "0.13.7"
"version": "0.13.8"
},
"0.13": {
"version": "0.13.7"
"version": "0.13.8"
},
"0.13.8": {
"x86_64_linux_musl": {
"checksum": "95b2b7eacc1e93b918969e8d9f25dad49ce079511401308b548f5fceeafeb896"
},
"x86_64_macos": {
"checksum": "950f36ddbb08c0686305f97196b450a99efd3bbea3553746b4f1b9942a5ab2b7"
},
"x86_64_windows": {
"checksum": "5cae60df4ab5a9c949a59f56cf101562b7a962fb2750b5e6aeb47e0d8799e962"
},
"aarch64_macos": {
"checksum": "6eeedd852be234c5b27359e7ce6c7da665511afb5d643c7ce8db660e08ca7bc1"
}
},
"0.13.7": {
"x86_64_linux_musl": {

View File

@@ -17,10 +17,61 @@
}
},
"latest": {
"version": "0.5.11"
"version": "0.5.14"
},
"0.5": {
"version": "0.5.11"
"version": "0.5.14"
},
"0.5.14": {
"x86_64_linux_musl": {
"checksum": "688e56f78611f7866842f5b86e27672225b28c8a536c75d6c0a3fd67082474ea"
},
"x86_64_macos": {
"checksum": "8d4a93175d5ba0710a46ccab007444cea4c53406b4c0b6c6ae6916d1192ac333"
},
"x86_64_windows": {
"checksum": "5773b119db63bbbcb975ecd3e0c71ae548506d85312248d6d3e94758cf88bba6"
},
"aarch64_linux_musl": {
"checksum": "61b22ff22d95ca6af9c668c780fe2a23a519a44d1fab3de01adadfbb36cea54d"
},
"aarch64_macos": {
"checksum": "f98c5d4bc2f7b67328a82028bb78f0a67436ae81a4e2a7911fd4f18f572c434b"
}
},
"0.5.13": {
"x86_64_linux_musl": {
"checksum": "e57875cba95527149d15d7f9c66b9d624d8154040f19aedbca96e2c6b7687ffb"
},
"x86_64_macos": {
"checksum": "f694bcaf714f352b76182b0aeec9626ca5280ceca275f949caa762a561030350"
},
"x86_64_windows": {
"checksum": "642046071c3c221748a3a6a08b5c7d71d7644928d4d7707fa30b38da8357f074"
},
"aarch64_linux_musl": {
"checksum": "d9173b2aae99f29276cd7d84ffdea9eb29f8831acd3f9d9de1c2af4366d917df"
},
"aarch64_macos": {
"checksum": "b9bb4d03065c4d7e52ed4148d71d36a4c890dee37108addfa9ba19771e46fa1d"
}
},
"0.5.12": {
"x86_64_linux_musl": {
"checksum": "998b1d9e630295459743fe7051a7e3d04e82836456171493eb5983dde710b07e"
},
"x86_64_macos": {
"checksum": "77faedad91c300b51d2d40040a6c61903a555da319047983ec56c81598cbea9b"
},
"x86_64_windows": {
"checksum": "5d0d3df674a431272f75e77dd2c07fdbc5ee83ade11c0839bbd0fdae35480351"
},
"aarch64_linux_musl": {
"checksum": "87c54166055d2d486620ceb27440442d34d71b364fdd6f6da57a210ae5f75e33"
},
"aarch64_macos": {
"checksum": "05c8f8e2210a3218b167dce33477785a0bc0c718fac7b15d2f4a428791234f03"
}
},
"0.5.11": {
"x86_64_linux_musl": {

View File

@@ -17,10 +17,27 @@
}
},
"latest": {
"version": "0.25.1"
"version": "0.25.2"
},
"0.25": {
"version": "0.25.1"
"version": "0.25.2"
},
"0.25.2": {
"x86_64_linux_musl": {
"checksum": "89f0f28baa818f445336da35c204206544b5e1160892ca0d5f50fe034abff771"
},
"x86_64_macos": {
"checksum": "fac48ad01a87435b35a0d04dbb5452929c72e3e28633ab0fb5740a50d113bf64"
},
"x86_64_windows": {
"checksum": "36cf0c7fcf1c1d589720e7409673535e46d734f9abf89ff179c964dbf24f56cc"
},
"aarch64_linux_musl": {
"checksum": "2600c6a6e8f6cdaf374fa492284ade31c4582f40f9c5ede1f726b743e144f9b6"
},
"aarch64_macos": {
"checksum": "3f615f38c18c32d10fdf85b73e5c5ee05c0308566d00d0b117c10175f659c504"
}
},
"0.25.1": {
"x86_64_linux_musl": {

View File

@@ -14,14 +14,6 @@ trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}
# Note: This script requires the following tools:
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
x() {
local cmd="$1"
shift
(
set -x
"${cmd}" "$@"
)
}
bail() {
echo >&2 "error: $*"
exit 1
@@ -48,7 +40,6 @@ if gh release view "${tag}" &>/dev/null; then
bail "tag '${tag}' has already been created and pushed"
fi
# Make sure that the release was created from an allowed branch.
if ! git branch | grep -q '\* main$'; then
bail "current branch is not 'main'"
fi
@@ -97,11 +88,57 @@ echo "======================================="
if [[ -n "${tags}" ]]; then
# Create a release commit.
x git add "${changelog}"
x git commit -m "Release ${version}"
git add "${changelog}"
git commit -m "Release ${version}"
fi
x git tag "${tag}"
# TODO: the following still assumes admin permissions
x git push origin main
x git push origin --tags
tools=()
for tool in tools/codegen/base/*.json; do
tools+=("$(basename "${tool%.*}")")
done
# Aliases
tools+=(nextest)
# Not manifest-base
tools+=(valgrind)
(
set -x
git tag "${tag}"
git push origin main
git push origin --tags
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 "${major_version_tag}"
git checkout main
git branch -d "${major_version_tag}"
)
for tool in "${tools[@]}"; do
(
set -x
git checkout -b "${tool}"
sed -i -e "s/required: true/required: false/g" action.yml
sed -i -e "s/# default: #publish:tool/default: ${tool}/g" action.yml
git add action.yml
git commit -m "${tool}"
git push origin -f refs/heads/"${tool}"
if git --no-pager tag | grep -Eq "^${tool}$"; then
git tag -d "${tool}"
git push --delete origin refs/tags/"${tool}"
fi
git tag "${tool}"
git checkout main
git branch -D "${tool}"
)
done
set -x
git push origin --tags

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT
# shellcheck disable=SC2046
set -euo pipefail
IFS=$'\n\t'
@@ -33,6 +34,9 @@ check_diff() {
fi
fi
}
info() {
echo >&2 "info: $*"
}
warn() {
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
echo "::warning::$*"
@@ -41,6 +45,14 @@ warn() {
fi
should_fail=1
}
error() {
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
echo "::error::$*"
else
echo >&2 "error: $*"
fi
should_fail=1
}
if [[ $# -gt 0 ]]; then
cat <<EOF
@@ -70,6 +82,11 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then
else
warn "'rustup' is not installed"
fi
cast_without_turbofish=$(grep -n -E '\.cast\(\)' $(git ls-files '*.rs') || true)
if [[ -n "${cast_without_turbofish}" ]]; then
error "please replace \`.cast()\` with \`.cast::<type_name>()\`:"
echo "${cast_without_turbofish}"
fi
fi
# C/C++ (if exists)
@@ -103,8 +120,8 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
permissions=$(yq '.permissions' "${workflow}" | jq -c)
case "${permissions}" in
'{"contents":"read"}' | '{"contents":"none"}' | '{}') ;;
null) warn "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
*) warn "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
null) error "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
*) error "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
esac
# Make sure the 'needs' section is not out of date.
if grep -q '# tidy:needs' "${workflow}" && ! grep -Eq '# *needs: \[' "${workflow}"; then
@@ -117,7 +134,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
printf -v jobs '%s, ' "${jobs_actual[@]}"
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" "${workflow}"
check_diff "${workflow}"
warn "${workflow}: please update 'needs' section in 'ci-success' job"
error "${workflow}: please update 'needs' section in 'ci-success' job"
fi
fi
done
@@ -127,7 +144,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
fi
fi
if [[ -n "$(git ls-files '*.yaml')" ]]; then
warn "please use '.yml' instead of '.yaml' for consistency"
error "please use '.yml' instead of '.yaml' for consistency"
git ls-files '*.yaml'
fi
@@ -158,7 +175,9 @@ fi
# Spell check (if config exists)
if [[ -f .cspell.json ]]; then
if type -P npm &>/dev/null; then
has_rust=''
if [[ -n "$(git ls-files '*Cargo.toml')" ]]; then
has_rust='1'
dependencies=''
for manifest_path in $(git ls-files '*Cargo.toml'); do
if [[ "${manifest_path}" != "Cargo.toml" ]] && ! grep -Eq '\[workspace\]' "${manifest_path}"; then
@@ -166,24 +185,27 @@ if [[ -f .cspell.json ]]; then
fi
metadata=$(cargo metadata --format-version=1 --all-features --no-deps --manifest-path "${manifest_path}")
for id in $(jq <<<"${metadata}" '.workspace_members[]'); do
dependencies+=$'\n'
dependencies+=$(jq <<<"${metadata}" ".packages[] | select(.id == ${id})" | jq -r '.dependencies[].name')
dependencies+="$(jq <<<"${metadata}" ".packages[] | select(.id == ${id})" | jq -r '.dependencies[].name')"$'\n'
done
done
# shellcheck disable=SC2001
dependencies=$(sed <<<"${dependencies}" 's/[0-9_-]/\n/g' | LC_ALL=C sort -f -u)
config_old=$(<.cspell.json)
config_new=$(grep <<<"${config_old}" -v ' *//' | jq 'del(.dictionaries[] | select(index("organization-dictionary") | not))' | jq 'del(.dictionaryDefinitions[] | select(.name == "organization-dictionary" | not))')
echo "${config_new}" >.cspell.json
words=$(npx <<<"${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true)
echo "${config_old}" >.cspell.json
fi
config_old=$(<.cspell.json)
config_new=$(grep <<<"${config_old}" -v ' *//' | jq 'del(.dictionaries[] | select(index("organization-dictionary") | not))' | jq 'del(.dictionaryDefinitions[] | select(.name == "organization-dictionary" | not))')
echo "${config_new}" >.cspell.json
if [[ -n "${has_rust}" ]]; then
dependencies_words=$(npx <<<"${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true)
fi
all_words=$(npx cspell --no-progress --no-summary --words-only --unique $(git ls-files | (grep -v '\.github/\.cspell/project-dictionary\.txt' || true)) || true)
# TODO: handle SIGINT
echo "${config_old}" >.cspell.json
cat >.github/.cspell/rust-dependencies.txt <<EOF
// This file is @generated by $(basename "$0").
// It is not intended for manual editing.
EOF
if [[ -n "${words:-}" ]]; then
echo $'\n'"${words}" >>.github/.cspell/rust-dependencies.txt
if [[ -n "${dependencies_words:-}" ]]; then
echo $'\n'"${dependencies_words}" >>.github/.cspell/rust-dependencies.txt
fi
check_diff .github/.cspell/rust-dependencies.txt
if ! grep -Eq "^\.github/\.cspell/rust-dependencies.txt linguist-generated" .gitattributes; then
@@ -191,20 +213,37 @@ EOF
fi
echo "+ npx cspell --no-progress --no-summary \$(git ls-files)"
npx cspell --no-progress --no-summary $(git ls-files)
if ! npx cspell --no-progress --no-summary $(git ls-files); then
error "spellcheck failed: please fix uses of above words or add to .github/.cspell/project-dictionary.txt if correct"
fi
# Make sure the project-specific dictionary does not contain duplicated words.
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"
error "duplicated words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
echo "======================================="
echo "${dup}"
echo "======================================="
fi
done
# Make sure the project-specific dictionary does not contain unused words.
unused=''
for word in $(grep -v '//.*' .github/.cspell/project-dictionary.txt || true); do
if ! grep <<<"${all_words}" -Eq -i "^${word}$"; then
unused+="${word}"$'\n'
fi
done
if [[ -n "${unused}" ]]; then
error "unused words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
echo "======================================="
echo -n "${unused}"
echo "======================================="
fi
else
warn "'npm' is not installed"
fi