ci: Fix release workflow

This commit is contained in:
Taiki Endo
2026-03-27 23:22:50 +09:00
parent a20bdf712d
commit 38b59bc959
3 changed files with 5 additions and 7 deletions

View File

@@ -155,7 +155,7 @@ jobs:
- run: env
- uses: ./
with:
# NB: Update alias list in tools/publish.rs, case for aliases in main.sh,
# NB: Update alias list in release.yml, case for aliases in main.sh,
# and match for alias for tools/codegen/src/tools-markdown.rs.
tool: |
nextest

View File

@@ -91,7 +91,6 @@ jobs:
printf '%s\n' "release-date=${release_date}" >>"${GITHUB_OUTPUT}"
# Get the current revision.
retry git fetch origin &>/dev/null
rev=$(git rev-parse HEAD)
printf '%s\n' "rev: ${rev}"
printf '%s\n' "rev=${rev}" >>"${GITHUB_OUTPUT}"
@@ -259,7 +258,7 @@ jobs:
release_date="${RELEASE_DATE}"
# Make sure the current revision is same as prepare step.
retry git fetch origin &>/dev/null
retry git fetch origin --unshallow &>/dev/null
rev=$(git rev-parse HEAD)
if [[ "${rev}" != "${PREPARE_REV}" ]]; then
bail "revision difference between prepare step"
@@ -324,12 +323,11 @@ jobs:
set -x
git tag "${tag}"
retry git push origin HEAD
retry git push origin refs/tags/"${tag}"
major_version_tag="v${version%%.*}"
git branch "releases/${major_version_tag}"
git tag -f "${major_version_tag}"
refs=("refs/heads/releases/${major_version_tag}" "+refs/tags/${major_version_tag}")
refs=("refs/tags/${tag}" "refs/heads/releases/${major_version_tag}" "+refs/tags/${major_version_tag}")
tools=()
for tool in tools/codegen/base/*.json; do
@@ -358,7 +356,7 @@ jobs:
git add action.yml
git commit -m "${tool}"
git tag -f "${tool}"
git checkout main
git checkout refs/tags/"${tag}"
refs+=("+refs/heads/releases/${tool}" "+refs/tags/${tool}")
branches+=("releases/${tool}")
done

View File

@@ -763,7 +763,7 @@ for tool in "${tools[@]}"; do
;;
*)
# Handle aliases.
# NB: Update alias list in tools/publish.rs, tool input option in test-alias in .github/workflows/ci.yml,
# NB: Update alias list in .github/workflows/release.yml, tool input option in test-alias in .github/workflows/ci.yml,
# and match for alias for tools/codegen/src/tools-markdown.rs.
# TODO(codegen): auto-detect cases where crate name and tool name are different.
case "${tool}" in