Skip to content

Commit f9c52d0

Browse files
authored
build: skip tip release when nothing release-relevant changed since last tip (#12989)
There's a [short discussion](https://discord.com/channels/1005603569187160125/1005603569711452192/1504521818495651910) about this in Discord, I don't any existing discussion or issues. ### AI Disclosure Claude implemented this, changes are looking good to me, but I could be wrong.
2 parents 136ced5 + 7595203 commit f9c52d0

1 file changed

Lines changed: 37 additions & 3 deletions

File tree

.github/workflows/release-tip.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,44 @@ jobs:
6565
if nix develop -c nu .github/scripts/ghostty-tip $GHOSTTY_COMMIT_LONG; then
6666
echo "Tip release already exists for commit $GHOSTTY_COMMIT_LONG"
6767
echo "should_skip=true" >> $GITHUB_OUTPUT
68-
else
69-
echo "No tip release found for commit $GHOSTTY_COMMIT_LONG"
70-
echo "should_skip=false" >> $GITHUB_OUTPUT
68+
exit 0
7169
fi
70+
echo "No tip release found for commit $GHOSTTY_COMMIT_LONG"
71+
72+
# Skip the release when nothing release-relevant changed since
73+
# the last tip (e.g. only VOUCHED.td or other .github metadata
74+
# changed). Files under .github don't affect the built artifacts,
75+
# with the exception of the release workflows and scripts, which
76+
# affect how the artifacts are built and should therefore be
77+
# exercised by a fresh build.
78+
#
79+
# This list is intentionally independent from the skip filter in
80+
# test.yml: that one gates CI jobs and must stay narrow so that
81+
# .github changes are still linted.
82+
#
83+
# Manual dispatches always build.
84+
if [ "$GITHUB_EVENT_NAME" = "workflow_run" ] &&
85+
git rev-parse -q --verify refs/tags/tip >/dev/null; then
86+
relevant=false
87+
while IFS= read -r path; do
88+
case "$path" in
89+
.github/workflows/release-*.yml | .github/scripts/*)
90+
relevant=true
91+
;;
92+
.github/*) ;;
93+
*)
94+
relevant=true
95+
;;
96+
esac
97+
done < <(git diff --name-only tip..HEAD)
98+
if [ "$relevant" = "false" ]; then
99+
echo "Only non-release files changed since the last tip, skipping"
100+
echo "should_skip=true" >> $GITHUB_OUTPUT
101+
exit 0
102+
fi
103+
fi
104+
105+
echo "should_skip=false" >> $GITHUB_OUTPUT
72106
73107
tag:
74108
runs-on: namespace-profile-ghostty-sm

0 commit comments

Comments
 (0)