Compare commits

...

6 Commits

Author SHA1 Message Date
Taiki Endo
57aaba576a Release 2.19.2 2023-09-30 12:17:23 +09:00
Taiki Endo
0876ec40d9 ci: Auto-merge auto-generated PR 2023-09-30 12:16:22 +09:00
Taiki Endo
7d0442ab06 Set errtrace in scripts 2023-09-30 10:42:06 +09:00
Taiki Endo
d2ffa16971 Update mdbook@latest to 0.4.35 (#241) 2023-09-30 00:19:56 +00:00
Taiki Endo
05c9797d84 Update manifest (#240)
* Update `cargo-deny@latest` to 0.14.3

* Update `cargo-dinghy@latest` to 0.6.8

* Update `parse-changelog@latest` to 0.6.3
2023-09-30 09:36:29 +10:00
Taiki Endo
75d87d548b tidy: Run markdownlint 2023-09-28 23:41:17 +09:00
14 changed files with 143 additions and 38 deletions

View File

@@ -160,6 +160,7 @@ esac
euxo euxo
gsub gsub
libc libc
markdownlint
moreutils moreutils
msys msys
noninteractive noninteractive

View File

@@ -118,13 +118,13 @@ jobs:
steps: steps:
- name: Install requirements (ubuntu/debian) - name: Install requirements (ubuntu/debian)
run: | run: |
set -euxo pipefail set -eEuxo pipefail
apt-get -o Acquire::Retries=10 -qq update apt-get -o Acquire::Retries=10 -qq update
apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian') if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
- name: Install requirements (fedora/almalinux/centos) - name: Install requirements (fedora/almalinux/centos)
run: | run: |
set -euxo pipefail set -eEuxo pipefail
if ! type -P dnf &>/dev/null && type -P microdnf &>/dev/null; then if ! type -P dnf &>/dev/null && type -P microdnf &>/dev/null; then
# tar and gzip are required for actions/checkout on *-minimal images # tar and gzip are required for actions/checkout on *-minimal images
microdnf install -y tar gzip microdnf install -y tar gzip
@@ -133,9 +133,7 @@ jobs:
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}" echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}"
if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'almalinux') || startsWith(matrix.container, 'centos') if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'almalinux') || startsWith(matrix.container, 'centos')
- name: Install requirements (alpine) - name: Install requirements (alpine)
run: | run: apk --no-cache add bash cargo
set -eux
apk --no-cache add bash cargo
shell: sh shell: sh
if: startsWith(matrix.container, 'alpine') if: startsWith(matrix.container, 'alpine')
- uses: actions/checkout@v3 # TODO: actions/checkout@v4 requires glibc 2.28+ - uses: actions/checkout@v3 # TODO: actions/checkout@v4 requires glibc 2.28+
@@ -183,12 +181,28 @@ jobs:
- id: diff - id: diff
run: tools/ci/manifest.sh run: tools/ci/manifest.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- uses: peter-evans/create-pull-request@v5 - name: Create PR
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with: with:
title: Update manifest title: Update manifest
body: | body: |
Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request).
This will be auto-merged when CI has passed because this is an auto-generated PR in a defined format and is usually considered no additional review is required.
branch: update-manifest branch: update-manifest
token: ${{ secrets.CREATE_PR_TOKEN }} token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Enable auto-merge for auto-generated PR
run: gh pr merge --rebase --auto "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' && steps.create-pull-request.outputs.pull-request-operation == 'created'
- name: Auto approve for auto-generated PR
run: gh pr review --approve "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' && steps.create-pull-request.outputs.pull-request-operation == 'created'
- run: git add -N . && git diff --exit-code - run: git add -N . && git diff --exit-code

6
.markdownlint.yml Normal file
View File

@@ -0,0 +1,6 @@
# https://github.com/DavidAnson/markdownlint#rules--aliases
MD013: false # line-length
MD024: false # no-duplicate-heading/no-duplicate-header
MD033: false # no-inline-html
MD036: false # no-emphasis-as-heading/no-emphasis-as-header

View File

@@ -10,6 +10,16 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased] ## [Unreleased]
## [2.19.2] - 2023-09-30
- Update `mdbook@latest` to 0.4.35.
- Update `parse-changelog@latest` to 0.6.3.
- Update `cargo-dinghy@latest` to 0.6.8.
- Update `cargo-deny@latest` to 0.14.3.
## [2.19.1] - 2023-09-28 ## [2.19.1] - 2023-09-28
- Update `cargo-binstall@latest` to 1.4.2. - Update `cargo-binstall@latest` to 1.4.2.
@@ -1267,7 +1277,8 @@ Note: This release is considered a breaking change because installing on version
Initial release Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.19.1...HEAD [Unreleased]: https://github.com/taiki-e/install-action/compare/v2.19.2...HEAD
[2.19.2]: https://github.com/taiki-e/install-action/compare/v2.19.1...v2.19.2
[2.19.1]: https://github.com/taiki-e/install-action/compare/v2.19.0...v2.19.1 [2.19.1]: https://github.com/taiki-e/install-action/compare/v2.19.0...v2.19.1
[2.19.0]: https://github.com/taiki-e/install-action/compare/v2.18.17...v2.19.0 [2.19.0]: https://github.com/taiki-e/install-action/compare/v2.18.17...v2.19.0
[2.18.17]: https://github.com/taiki-e/install-action/compare/v2.18.16...v2.18.17 [2.18.17]: https://github.com/taiki-e/install-action/compare/v2.18.16...v2.18.17

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
rx() { rx() {

View File

@@ -19,10 +19,24 @@
} }
}, },
"latest": { "latest": {
"version": "0.14.2" "version": "0.14.3"
}, },
"0.14": { "0.14": {
"version": "0.14.2" "version": "0.14.3"
},
"0.14.3": {
"x86_64_linux_musl": {
"checksum": "7a8b4ccaa6cadda7feea6c125a08f4b63f644fc4e42b09f0e4cdffc42f33f1c3"
},
"x86_64_macos": {
"checksum": "68543cdbb1b33cc42ca744e7914d33bde7eb117a26645e09ef3959992396a4c1"
},
"x86_64_windows": {
"checksum": "92c27d586f1929598e3adc09f8737011b0072817bc18e64c6d612627805aa93a"
},
"aarch64_macos": {
"checksum": "1890410b05c898233cc0025109d383dad412efe2d80ab05f7476e0db5fe721de"
}
}, },
"0.14.2": { "0.14.2": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -11,10 +11,18 @@
} }
}, },
"latest": { "latest": {
"version": "0.6.7" "version": "0.6.8"
}, },
"0.6": { "0.6": {
"version": "0.6.7" "version": "0.6.8"
},
"0.6.8": {
"x86_64_linux_musl": {
"checksum": "732752302dbd31dda85c93fd639d72122d138e913e3e7163b57b739c32832dc5"
},
"x86_64_macos": {
"checksum": "245d9ec0e0fe95f07c112375146edb6f559f7846f0b347f6632d49775e7b1fc3"
}
}, },
"0.6.7": { "0.6.7": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

18
manifests/mdbook.json generated
View File

@@ -18,10 +18,24 @@
} }
}, },
"latest": { "latest": {
"version": "0.4.34" "version": "0.4.35"
}, },
"0.4": { "0.4": {
"version": "0.4.34" "version": "0.4.35"
},
"0.4.35": {
"x86_64_linux_musl": {
"checksum": "574c2a4e03ee656999da506c4288084a690f234c589812e29825a7687af5942c"
},
"x86_64_macos": {
"checksum": "ca3281c2b5437a1ccd9079ed8121b3dd97c49be74dae32ea803b540a38c334bb"
},
"x86_64_windows": {
"checksum": "d306a09e552616c1d27f10cebe85848b96970881674ad28d9414cd259a949c39"
},
"aarch64_linux_musl": {
"checksum": "359af01b77fbd6bf6243a3f2b2491a37b5480bbb2674eb2d94f91354253b34f4"
}
}, },
"0.4.34": { "0.4.34": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -24,10 +24,30 @@
} }
}, },
"latest": { "latest": {
"version": "0.6.2" "version": "0.6.3"
}, },
"0.6": { "0.6": {
"version": "0.6.2" "version": "0.6.3"
},
"0.6.3": {
"x86_64_linux_musl": {
"checksum": "b01992d759aad7e861363e1d4bbb808b28d530844da1efbc9f8f0f54bad2f813"
},
"x86_64_macos": {
"checksum": "5d0fa26aa6e742b96d1ef8c7aeccdf63469512a706961921242bde2de7640d89"
},
"x86_64_windows": {
"checksum": "71f9367dd33b6ea754a71bdc59524470c955e78d9cf02ad2c09ec98a3ef44b81"
},
"aarch64_linux_musl": {
"checksum": "6aa06d96c2a7c89786f9925e6c54472c77fda0c813c335566f870ecb4ca34d8e"
},
"aarch64_macos": {
"checksum": "963e1b4614cd42a28090365522efc9d7a4f1220ffe9d7bc0b1da8ae29fa6fba9"
},
"aarch64_windows": {
"checksum": "67fb1af8515d0b531bcea8686570d600fbe80c95994cb0c4cf7216b21a48aac4"
}
}, },
"0.6.2": { "0.6.2": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
cd "$(dirname "$0")"/../.. cd "$(dirname "$0")"/../..

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
cd "$(dirname "$0")"/../.. cd "$(dirname "$0")"/../..

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
cd "$(dirname "$0")"/.. cd "$(dirname "$0")"/..

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
cd "$(dirname "$0")"/.. cd "$(dirname "$0")"/..

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0 OR MIT # SPDX-License-Identifier: Apache-2.0 OR MIT
# shellcheck disable=SC2046 # shellcheck disable=SC2046
set -euo pipefail set -eEuo pipefail
IFS=$'\n\t' IFS=$'\n\t'
cd "$(dirname "$0")"/.. cd "$(dirname "$0")"/..
@@ -81,7 +81,7 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then
fi fi
check_diff $(git ls-files '*.rs') check_diff $(git ls-files '*.rs')
else else
warn "'rustup' is not installed" warn "'rustup' is not installed; skipped Rust code style check"
fi fi
cast_without_turbofish=$(grep -n -E '\.cast\(\)' $(git ls-files '*.rs') || true) cast_without_turbofish=$(grep -n -E '\.cast\(\)' $(git ls-files '*.rs') || true)
if [[ -n "${cast_without_turbofish}" ]]; then if [[ -n "${cast_without_turbofish}" ]]; then
@@ -168,7 +168,7 @@ if [[ -n "$(git ls-files '*.c')$(git ls-files '*.cpp')" ]]; then
clang-format -i $(git ls-files '*.c') $(git ls-files '*.cpp') clang-format -i $(git ls-files '*.c') $(git ls-files '*.cpp')
check_diff $(git ls-files '*.c') $(git ls-files '*.cpp') check_diff $(git ls-files '*.c') $(git ls-files '*.cpp')
else else
warn "'clang-format' is not installed" warn "'clang-format' is not installed; skipped C/C++ code style check"
fi fi
fi fi
@@ -176,11 +176,11 @@ fi
if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')" ]]; then if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')" ]]; then
info "checking YAML/JavaScript/JSON code style" info "checking YAML/JavaScript/JSON code style"
if type -P npm &>/dev/null; then if type -P npm &>/dev/null; then
echo "+ npx prettier -l -w \$(git ls-files '*.yml') \$(git ls-files '*.js') \$(git ls-files '*.json')" echo "+ npx -y prettier -l -w \$(git ls-files '*.yml') \$(git ls-files '*.js') \$(git ls-files '*.json')"
npx prettier -l -w $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json') npx -y 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') check_diff $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json')
else else
warn "'npm' is not installed" warn "'npm' is not installed; skipped YAML/JavaScript/JSON code style check"
fi fi
# Check GitHub workflows. # Check GitHub workflows.
if [[ -d .github/workflows ]]; then if [[ -d .github/workflows ]]; then
@@ -190,7 +190,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
# The top-level permissions must be weak as they are referenced by all jobs. # The top-level permissions must be weak as they are referenced by all jobs.
permissions=$(yq '.permissions' "${workflow}" | jq -c) permissions=$(yq '.permissions' "${workflow}" | jq -c)
case "${permissions}" in case "${permissions}" in
'{"contents":"read"}' | '{"contents":"none"}' | '{}') ;; '{"contents":"read"}' | '{"contents":"none"}') ;;
null) error "${workflow}: top level permissions not found; it must be 'contents: read' or weaker 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" ;; *) 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 esac
@@ -210,7 +210,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
fi fi
done done
else else
warn "'jq' or 'yq' is not installed" warn "'jq' or 'yq' is not installed; skipped GitHub workflow check"
fi fi
fi fi
fi fi
@@ -219,6 +219,21 @@ if [[ -n "$(git ls-files '*.yaml')" ]]; then
git ls-files '*.yaml' git ls-files '*.yaml'
fi fi
# Markdown (if exists)
if [[ -n "$(git ls-files '*.md')" ]]; then
info "checking Markdown style"
if type -P npm &>/dev/null; then
echo "+ npx -y markdownlint-cli2 \$(git ls-files '*.md')"
npx -y markdownlint-cli2 $(git ls-files '*.md')
else
warn "'npm' is not installed; skipped Markdown style check"
fi
fi
if [[ -n "$(git ls-files '*.markdown')" ]]; then
error "please use '.md' instead of '.markdown' for consistency"
git ls-files '*.markdown'
fi
# Shell scripts # Shell scripts
info "checking Shell scripts" info "checking Shell scripts"
if type -P shfmt &>/dev/null; then if type -P shfmt &>/dev/null; then
@@ -226,7 +241,7 @@ if type -P shfmt &>/dev/null; then
shfmt -l -w $(git ls-files '*.sh') shfmt -l -w $(git ls-files '*.sh')
check_diff $(git ls-files '*.sh') check_diff $(git ls-files '*.sh')
else else
warn "'shfmt' is not installed" warn "'shfmt' is not installed; skipped Shell scripts style check"
fi fi
if type -P shellcheck &>/dev/null; then if type -P shellcheck &>/dev/null; then
echo "+ shellcheck \$(git ls-files '*.sh')" echo "+ shellcheck \$(git ls-files '*.sh')"
@@ -241,7 +256,7 @@ if type -P shellcheck &>/dev/null; then
fi fi
fi fi
else else
warn "'shellcheck' is not installed" warn "'shellcheck' is not installed; skipped Shell scripts style check"
fi fi
# License check # License check
@@ -268,9 +283,10 @@ if [[ -f tools/.tidy-check-license-headers ]]; then
fi fi
header_found='' header_found=''
for pre in "${prefix[@]}"; do for pre in "${prefix[@]}"; do
# TODO: check that the license is valid as SPDX and is allowed in this project.
if [[ "$(grep -E -n "${pre}SPDX-License-Identifier: " "${p}")" == "${line}:${pre}SPDX-License-Identifier: "* ]]; then if [[ "$(grep -E -n "${pre}SPDX-License-Identifier: " "${p}")" == "${line}:${pre}SPDX-License-Identifier: "* ]]; then
header_found='1' header_found='1'
continue break
fi fi
done done
if [[ -z "${header_found}" ]]; then if [[ -z "${header_found}" ]]; then
@@ -308,13 +324,14 @@ if [[ -f .cspell.json ]]; then
fi fi
config_old=$(<.cspell.json) 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))') config_new=$(grep <<<"${config_old}" -v ' *//' | jq 'del(.dictionaries[] | select(index("organization-dictionary") | not))' | jq 'del(.dictionaryDefinitions[] | select(.name == "organization-dictionary" | not))')
trap -- 'echo "${config_old}" >.cspell.json; echo >&2 "$0: trapped SIGINT"; exit 1' SIGINT
echo "${config_new}" >.cspell.json echo "${config_new}" >.cspell.json
if [[ -n "${has_rust}" ]]; then if [[ -n "${has_rust}" ]]; then
dependencies_words=$(npx <<<"${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true) dependencies_words=$(npx <<<"${dependencies}" -y cspell stdin --no-progress --no-summary --words-only --unique || true)
fi fi
all_words=$(npx cspell --no-progress --no-summary --words-only --unique $(git ls-files | (grep -v "${project_dictionary//\./\\.}" || true)) || true) all_words=$(npx -y cspell --no-progress --no-summary --words-only --unique $(git ls-files | (grep -v "${project_dictionary//\./\\.}" || true)) || true)
# TODO: handle SIGINT
echo "${config_old}" >.cspell.json echo "${config_old}" >.cspell.json
trap - SIGINT
cat >.github/.cspell/rust-dependencies.txt <<EOF cat >.github/.cspell/rust-dependencies.txt <<EOF
// This file is @generated by $(basename "$0"). // This file is @generated by $(basename "$0").
// It is not intended for manual editing. // It is not intended for manual editing.
@@ -327,8 +344,8 @@ EOF
echo "warning: you may want to mark .github/.cspell/rust-dependencies.txt linguist-generated" echo "warning: you may want to mark .github/.cspell/rust-dependencies.txt linguist-generated"
fi fi
echo "+ npx cspell --no-progress --no-summary \$(git ls-files)" echo "+ npx -y cspell --no-progress --no-summary \$(git ls-files)"
if ! npx cspell --no-progress --no-summary $(git ls-files); then if ! npx -y cspell --no-progress --no-summary $(git ls-files); then
error "spellcheck failed: please fix uses of above words or add to ${project_dictionary} if correct" error "spellcheck failed: please fix uses of above words or add to ${project_dictionary} if correct"
fi fi
@@ -360,7 +377,7 @@ EOF
echo "=======================================" echo "======================================="
fi fi
else else
warn "'npm' is not installed" warn "'npm' is not installed; skipped spell check"
fi fi
fi fi