Release workflow fixups

This commit is contained in:
Johannes Altmanninger
2025-09-27 14:34:23 +02:00
parent af8d8d3d1b
commit ce4aa7669d
4 changed files with 53 additions and 45 deletions

View File

@@ -49,9 +49,12 @@ jobs:
mkdir /tmp/fish-built
FISH_ARTEFACT_PATH=/tmp/fish-built ./build_tools/make_tarball.sh
relnotes=/tmp/fish-built/release-notes.md
# Need history since the last release (i.e. tag) for stats.
git fetch --tags
git fetch --unshallow
sh -x ./build_tools/release-notes.sh >"$relnotes"
# Delete title
sed -n 1p "$relnotes" | grep -q "^# fish .*"
sed -n 1p "$relnotes" | grep -q "^## fish .*"
sed -n 2p "$relnotes" | grep -q '^$'
sed -i 1,2d "$relnotes"
- name: Upload tarball artifact

View File

@@ -1,7 +1,8 @@
fish 4.0.9 (released ???)
=========================
This release fixes
This release fixes:
- a regression in 4.0.6 causing shifted keys to not be inserted on some terminals (:issue:`11813`).
- a regression in 4.0.6 causing the build to fail on systems where ``char`` is unsigned (:issue:`11804`).
- a regression in 4.0.0 causing a crash on an invalid :doc:`bg <cmds/bg>` invocation.

View File

@@ -19,12 +19,13 @@ previous_version=$(
# Skip tags that have not been created yet..
system("git rev-parse --verify >/dev/null --quiet refs/tags/"$2) == 0 \
) {
print $2; exit
print $2; ok = 1; exit
}
END { exit !ok }
'
)
minor_version=${version%.*}
previous_minor_version=${minor_version%.*}
previous_minor_version=${previous_version%.*}
{
sed -n 1,2p <"$workspace_root/CHANGELOG.rst"
@@ -59,24 +60,26 @@ previous_minor_version=${minor_version%.*}
' | sed '$d')" |
sed -e '$s/^----*$//' # Remove spurious transitions at the end of the document.
JoinEscaped() {
sed 's/\S/\\&/g' |
awk '
NR != 1 { printf ", " }
{ printf "%s", $0 }
END { printf "\n" }
'
}
echo ""
echo "---"
echo ""
echo "Thanks to everyone who contributed through issue discussions, code reviews, or code changes."
echo
printf "Welcome our new committers: "
JoinEscaped <"$relnotes_tmp/committers-new"
echo
printf "Welcome back our returning committers: "
JoinEscaped <"$relnotes_tmp/committers-returning"
if [ "$minor_version" != "$previous_minor_version" ]; then
JoinEscaped() {
sed 's/\S/\\&/g' |
awk '
NR != 1 { printf ",\n" }
{ printf "%s", $0 }
END { printf "\n" }
'
}
echo ""
echo "---"
echo ""
echo "Thanks to everyone who contributed through issue discussions, code reviews, or code changes."
echo
printf "Welcome our new committers: "
JoinEscaped <"$relnotes_tmp/committers-new"
echo
printf "Welcome back our returning committers: "
JoinEscaped <"$relnotes_tmp/committers-returning"
fi
echo
echo "---"
echo

View File

@@ -54,9 +54,6 @@ integration_branch=$(
[ -n "$integration_branch" ] ||
git merge-base --is-ancestor $remote/master HEAD
release_flow=.github/workflows/release.yml
git diff --exit-code -- :/$release_flow $remote/master:$release_flow
sed -n 1p CHANGELOG.rst | grep -q '^fish .*(released .*)$'
sed -n 2p CHANGELOG.rst | grep -q '^===*$'
@@ -82,11 +79,14 @@ git tag --annotate --message="Release $version" $version
git push $remote $version
TIMEOUT=
gh() {
command gh --repo "$repository_owner/fish-shell" "$@"
command ${TIMEOUT:+timeout $TIMEOUT} \
gh --repo "$repository_owner/fish-shell" "$@"
}
gh workflow run release.yml --raw-field "version=$version"
gh workflow run release.yml --ref="$version" \
--raw-field="version=$version"
run_id=
while [ -z "$run_id" ] && sleep 5
@@ -108,7 +108,8 @@ while ! \
gh release download "$version" --dir="$tmpdir" \
--pattern="fish-$version.tar.xz"
do
timeout 30 gh run watch "$run_id" ||:
TIMEOUT=30 gh run watch "$run_id" ||:
sleep 5
done
actual_tag_oid=$(git ls-remote "$remote" |
awk '$2 == "refs/tags/'"$version"'" { print $1 }')
@@ -143,33 +144,33 @@ rm -rf "$tmpdir"
" | sed 's,^\s*| \?,,')"
)
# Approve macos-codesign
# TODO what if current user can't approve?
sleep 5
environment_id=$(
gh api \
gh_pending_deployments() {
command gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments |
jq .[].environment.id
)
gh api \
-X POST \
-H "Accept: application/vnd.github+json" \
"/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments" \
-d '
"/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments" \
"$@"
}
while {
environment_id=$(gh_pending_deployments | jq .[].environment.id)
[ -z "$environment_id" ]
}
do
sleep 5
done
echo '
{
"environment_ids": ['"$environment_id"'],
"state": "approved",
"comment": "Approved via ./build_tools/release.sh"
}
'
' |
gh_pending_deployments -XPOST --input=-
# # Uncomment this to wait the full workflow run (i.e. macOS packages).
# # Also note that --exit-status doesn't fail reliably.
# gh run view "$run_id" --verbose --log-failed --exit-status
# Await completion.
gh run watch "$run_id"
while {
! draft=$(gh release view "$version" --json=isDraft --jq=.isDraft) \