ci,tools: Update config and scripts

This commit is contained in:
Taiki Endo
2026-05-03 04:02:20 +09:00
parent 9d6a9dded6
commit e565ba433e
5 changed files with 27 additions and 32 deletions

View File

@@ -15,7 +15,7 @@ updates:
- package-ecosystem: github-actions - package-ecosystem: github-actions
directory: / directory: /
schedule: schedule:
interval: weekly interval: monthly
cooldown: cooldown:
default-days: 14 default-days: 14
commit-message: commit-message:

View File

@@ -1,7 +1,6 @@
name: CI name: CI
permissions: permissions: {}
contents: read
on: on:
pull_request: pull_request:
@@ -33,20 +32,20 @@ concurrency:
jobs: jobs:
miri: miri:
uses: taiki-e/github-actions/.github/workflows/miri.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/miri.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
with: with:
# NB: sync with test job's --exclude option # NB: sync with test job's --exclude option
args: --exclude install-action-internal-codegen args: --exclude install-action-internal-codegen
msrv: msrv:
uses: taiki-e/github-actions/.github/workflows/msrv.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/msrv.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
test-manifest-schema: test-manifest-schema:
uses: taiki-e/github-actions/.github/workflows/test.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/test.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
with: with:
# NB: sync with miri job's --exclude option # NB: sync with miri job's --exclude option
test-args: --exclude install-action-internal-codegen test-args: --exclude install-action-internal-codegen
no-std: false no-std: false
tidy: tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/tidy.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
permissions: permissions:
contents: write # for creating branch for pr contents: write # for creating branch for pr
pull-requests: write # unused (used in `codegen-automerge: true` case) pull-requests: write # unused (used in `codegen-automerge: true` case)
@@ -151,7 +150,7 @@ jobs:
if: matrix.bash != 'cygwin' && matrix.os != 'windows-11-arm' if: matrix.bash != 'cygwin' && matrix.os != 'windows-11-arm'
test-alias: test-alias:
runs-on: ubuntu-latest runs-on: ubuntu-24.04
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
@@ -255,7 +254,7 @@ jobs:
- alpine:3.22 # musl 1.2.5 - alpine:3.22 # musl 1.2.5
- alpine:3.23 # musl 1.2.5 - alpine:3.23 # musl 1.2.5
# - openwrt/rootfs:x86-64-openwrt-24.10 # musl 1.2.5 # - openwrt/rootfs:x86-64-openwrt-24.10 # musl 1.2.5
runs-on: ubuntu-latest runs-on: ubuntu-24.04
timeout-minutes: 60 timeout-minutes: 60
container: ${{ matrix.container }} container: ${{ matrix.container }}
steps: steps:

View File

@@ -1,7 +1,6 @@
name: Manifest name: Manifest
permissions: permissions: {}
contents: read
on: on:
pull_request: pull_request:
@@ -33,7 +32,7 @@ concurrency:
jobs: jobs:
manifest: manifest:
uses: taiki-e/github-actions/.github/workflows/gen.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/gen.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
permissions: permissions:
contents: write # for creating branch for pr contents: write # for creating branch for pr
pull-requests: write # for gh pr review --approve pull-requests: write # for gh pr review --approve

View File

@@ -2,8 +2,7 @@ name: Release
# Adapted from https://github.com/taiki-e/github-actions/blob/HEAD/.github/workflows/action-release.yml. # Adapted from https://github.com/taiki-e/github-actions/blob/HEAD/.github/workflows/action-release.yml.
permissions: permissions: {}
contents: read
on: on:
workflow_dispatch: workflow_dispatch:
@@ -26,7 +25,7 @@ on:
defaults: defaults:
run: run:
shell: bash --noprofile --norc -CeEuxo pipefail {0} shell: bash --noprofile --norc -CeEuo pipefail {0}
concurrency: concurrency:
group: ${{ github.workflow }} group: ${{ github.workflow }}
@@ -35,7 +34,7 @@ concurrency:
jobs: jobs:
prepare: prepare:
if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action' if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action'
runs-on: ubuntu-latest runs-on: ubuntu-24.04
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
@@ -45,7 +44,6 @@ jobs:
fallback: none fallback: none
- id: check - id: check
run: | run: |
set +x
IFS=$'\n\t' IFS=$'\n\t'
trap -- 's=$?; printf >&2 "%s\n" "${0##*/}:${LINENO}: \`${BASH_COMMAND}\` exit with ${s}"; exit ${s}' ERR trap -- 's=$?; printf >&2 "%s\n" "${0##*/}:${LINENO}: \`${BASH_COMMAND}\` exit with ${s}"; exit ${s}' ERR
retry() { retry() {
@@ -70,23 +68,23 @@ jobs:
# shellcheck disable=SC2153 # shellcheck disable=SC2153
version="${VERSION}" version="${VERSION}"
printf '%s\n' "version(input): ${version}" printf 'version(input): %s\n' "${version}"
# shellcheck disable=SC2153 # shellcheck disable=SC2153
tag_prefix="${TAG_PREFIX}" tag_prefix="${TAG_PREFIX}"
printf '%s\n' "tag_prefix: ${tag_prefix}" printf 'tag_prefix: %s\n' "${tag_prefix}"
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changelog="${CHANGELOG}" changelog="${CHANGELOG}"
printf '%s\n' "changelog: ${changelog}" printf 'changelog: %s\n' "${changelog}"
# Get the current date. # Get the current date.
release_date=$(date -u '+%Y-%m-%d') release_date=$(date -u '+%Y-%m-%d')
printf '%s\n' "release-date: ${release_date}" printf 'release-date: %s\n' "${release_date}"
printf '%s\n' "release-date=${release_date}" >>"${GITHUB_OUTPUT}" printf 'release-date=%s\n' "${release_date}" >>"${GITHUB_OUTPUT}"
# Get the current revision. # Get the current revision.
rev=$(git rev-parse HEAD) rev=$(git rev-parse HEAD)
printf '%s\n' "rev: ${rev}" printf 'rev: %s\n' "${rev}"
printf '%s\n' "rev=${rev}" >>"${GITHUB_OUTPUT}" printf 'rev=%s\n' "${rev}" >>"${GITHUB_OUTPUT}"
prev_version=$(parse-changelog --title-no-link "${changelog}" | cut -d' ' -f1) prev_version=$(parse-changelog --title-no-link "${changelog}" | cut -d' ' -f1)
@@ -111,11 +109,11 @@ jobs:
if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z\.-]+)?(\+[0-9A-Za-z\.-]+)?$ ]]; then if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z\.-]+)?(\+[0-9A-Za-z\.-]+)?$ ]]; then
bail "invalid version format '${version}'" bail "invalid version format '${version}'"
fi fi
printf '%s\n' "version: ${version}" printf 'version: %s\n' "${version}"
printf '%s\n' "version=${version}" >>"${GITHUB_OUTPUT}" printf 'version=%s\n' "${version}" >>"${GITHUB_OUTPUT}"
tag="${tag_prefix}${version}" tag="${tag_prefix}${version}"
printf '%s\n' "tag: ${tag}" printf 'tag: %s\n' "${tag}"
printf '%s\n' "tag=${tag}" >>"${GITHUB_OUTPUT}" printf 'tag=%s\n' "${tag}" >>"${GITHUB_OUTPUT}"
# Make sure the same release has not been created in the past. # Make sure the same release has not been created in the past.
if gh release view "${tag}" &>/dev/null; then if gh release view "${tag}" &>/dev/null; then
@@ -199,7 +197,7 @@ jobs:
release: release:
if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action' if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action'
needs: prepare needs: prepare
runs-on: ubuntu-latest runs-on: ubuntu-24.04
timeout-minutes: 60 timeout-minutes: 60
environment: environment:
name: release name: release
@@ -220,7 +218,6 @@ jobs:
- name: Create and push release commit and tag - name: Create and push release commit and tag
id: push id: push
run: | run: |
set +x
IFS=$'\n\t' IFS=$'\n\t'
trap -- 's=$?; printf >&2 "%s\n" "${0##*/}:${LINENO}: \`${BASH_COMMAND}\` exit with ${s}"; exit ${s}' ERR trap -- 's=$?; printf >&2 "%s\n" "${0##*/}:${LINENO}: \`${BASH_COMMAND}\` exit with ${s}"; exit ${s}' ERR
retry() { retry() {
@@ -436,7 +433,7 @@ jobs:
release-manifest-schema: release-manifest-schema:
if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action-manifest-schema' if: github.repository_owner == 'taiki-e' && inputs.target == 'install-action-manifest-schema'
uses: taiki-e/github-actions/.github/workflows/rust-release.yml@3c1cac16ef654d1febb66f21f328fa167f0d2fef # main uses: taiki-e/github-actions/.github/workflows/rust-release.yml@5f549ff6b21e9a853f5f613784d5db27746fd2bc # main
permissions: permissions:
contents: write # for taiki-e/create-gh-release-action contents: write # for taiki-e/create-gh-release-action
id-token: write # for rust-lang/crates-io-auth-action id-token: write # for rust-lang/crates-io-auth-action

View File

@@ -27,7 +27,7 @@ fi
if [[ -n "${TIDY_DEV:-}" ]]; then if [[ -n "${TIDY_DEV:-}" ]]; then
image="ghcr.io/taiki-e/tidy:latest" image="ghcr.io/taiki-e/tidy:latest"
else else
image="ghcr.io/taiki-e/tidy@sha256:71def761a5585e83a2672c4051aee13cd886ad5571215aee52f193454bb3cdff" image="ghcr.io/taiki-e/tidy@sha256:c78ba09aa420feddc57ca76fca38b1d4c998a0ede37f76378f12df15a826cf59"
fi fi
user="$(id -u):$(id -g)" user="$(id -u):$(id -g)"
workdir=$(pwd) workdir=$(pwd)