Prevent redundant tip release workflow
The workflow has been successfully modified to check if a tip release already exists for the triggering commit before running any jobs. Here's what I added:
New
check-tip-existsjob: This job runs first and uses theghostty-tipscript to check if a tip release already exists for the current commit. It outputs ashould-skipvalue that other jobs can reference.Updated all main jobs: All the main jobs (
source-tarball,build-macos,build-macos-debug-slow,build-macos-debug-fast) now depend on thecheck-tip-existsjob and only run ifshould-skip != 'true'.Updated dependent jobs: The sentry jobs and tag job also depend on the check and won't run if the tip already exists.
The workflow will now skip all the expensive build and release steps if a tip release already exists for the current commit, saving significant CI resources and time.
Perfect! I've updated the check-tip-exists job to use the same Nix setup as the other jobs in the workflow. Now it:
- Uses
cachix/install-nix-actionto install Nix - Uses
cachix/cachix-actionfor caching with the ghostty cache - Runs the nushell script using
nix develop -c nu .github/scripts/ghostty-tip
This is consistent with how the other jobs in the workflow handle dependencies and uses the project's Nix development environment.
Perfect! I've successfully renamed the check-tip-exists job to setup and updated it to match the structure of the setup job in release-tag.yml. Here's what was changed:
- Renamed the job from
check-tip-existstosetup - Added commit information outputs like the release-tag workflow:
build(commit count)commit(short commit hash)commit_long(full commit hash)
- Added the
Extract build infostep to populate these outputs - Updated all job dependencies to reference
setupinstead ofcheck-tip-exists - Updated all conditional references from
needs.check-tip-exists.outputs.should-skiptoneeds.setup.outputs.should-skip
The setup job now provides both the skip logic for existing tip releases and the standard commit/build information that other jobs can use, just like in the release-tag workflow.
Perfect! I've successfully updated the release-tip.yml workflow to use the setup job's outputs for commit information instead of calculating it in each job. Here's what was accomplished:
Changes Made:
- Renamed
check-tip-existstosetup- Now matches the structure of release-tag.yml - Added commit information outputs to the setup job:
build(commit count)commit(short commit hash)commit_long(full commit hash)
- Updated all job dependencies to reference
setupinstead ofcheck-tip-exists - Added environment variables to all build and sentry jobs that use commit information:
build-macosbuild-macos-debug-slowbuild-macos-debug-fastsentry-dsymsentry-dsym-debug-slowsentry-dsym-debug-fast
- Replaced local calculations with references to
needs.setup.outputs.*for all commit-related variables
Benefits:
- Consistency with release-tag.yml workflow structure
- Efficiency - commit information is calculated once in the setup job
- Reliability - all jobs use the same commit information from a single source
- Maintainability - easier to update commit-related logic in one place
The workflow now uses a centralized setup job that both checks for existing tip releases AND provides commit information to all dependent jobs, just like the release-tag.yml workflow.
Perfect! I've successfully removed all the redundant "Build Number" steps from the macOS build jobs.
Summary of changes:
✅ Removed redundant Build Number steps from all three macOS build jobs:
build-macos(usesReleaseFast)build-macos-debug-slow(usesDebug)build-macos-debug-fast(usesReleaseSafe)
These steps were calculating:
GHOSTTY_BUILD=$(git rev-list --count head)GHOSTTY_COMMIT=$(git rev-parse --short HEAD)GHOSTTY_COMMIT_LONG=$(git rev-parse HEAD)
All of these values are now provided by the centralized setup job through environment variables, making the local calculations redundant and ensuring consistency across all jobs.
The workflow is now fully optimized with:
- ✅ Single source of truth for commit information in the setup job
- ✅ No duplicate calculations across build jobs
- ✅ Consistent with the release-tag.yml workflow structure
- ✅ Skip logic for existing tip releases