From 8fe68781be3e2045d331a2193ef1cc46804bef21 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 27 Sep 2025 14:34:23 +0200 Subject: [PATCH] Release workflow fixups (cherry picked from commit ce4aa7669d53a16b6c72135127da59379876f7e4) --- .github/workflows/release.yml | 5 ++- CHANGELOG.rst | 10 ++++-- build_tools/release-notes.sh | 43 ++++++++++++------------ build_tools/release.sh | 61 +++++++++++++++++------------------ 4 files changed, 63 insertions(+), 56 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c02f4c9ac..3a0de604e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6d092719d..6115b3cfe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -173,10 +173,14 @@ Changes to the :doc:`argparse ` builtin -------------- -fish 4.0.9 (released ???) -========================= +fish 4.0.9 (released September 27, 2025) +======================================== -This release fixes a regression in 4.0.6 that caused shifted keys to not be inserted on some terminals. +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 ` invocation. -------------- diff --git a/build_tools/release-notes.sh b/build_tools/release-notes.sh index 17de2e917..6a5074072 100755 --- a/build_tools/release-notes.sh +++ b/build_tools/release-notes.sh @@ -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 diff --git a/build_tools/release.sh b/build_tools/release.sh index eac6f13fa..638301be0 100755 --- a/build_tools/release.sh +++ b/build_tools/release.sh @@ -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,37 +144,33 @@ rm -rf "$tmpdir" " | sed 's,^\s*| \?,,')" ) - - # Approve macos-codesign # TODO what if current user can't approve? -sleep 5 -pending_deployments_endpoint=/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments -environment_id=$( - gh api \ +gh_pending_deployments() { + command gh api \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - "$pending_deployments_endpoint" | - jq .[].environment.id -) -if [ -n "$environment_id" ]; then - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "$pending_deployments_endpoint" \ - -X POST \ - -d ' - { - "environment_ids": ['"$environment_id"'], - "state": "approved", - "comment": "Approved via ./build_tools/release.sh" - } - ' -fi + "/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) \