Add release workflow to sync Homebrew tap formula#856
Open
russellbrenner wants to merge 2 commits intoslopus:mainfrom
Open
Add release workflow to sync Homebrew tap formula#856russellbrenner wants to merge 2 commits intoslopus:mainfrom
russellbrenner wants to merge 2 commits intoslopus:mainfrom
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to automatically update the Homebrew tap formula for the happy CLI when a new happy-coder release is published (or when manually dispatched).
Changes:
- Introduces
.github/workflows/update-homebrew-tap.ymltriggered onrelease.publishedandworkflow_dispatch. - Computes the npm tarball SHA256 for a given version and updates the tap formula’s
urlandsha256. - Commits and pushes the updated formula to the configured tap repository.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| perl -pi -e 's#^ url "https://registry\.npmjs\.org/happy-coder/-/happy-coder-[^"]+\.tgz"$# url "'"${{ steps.meta.outputs.tarball_url }}"'"#' "${FORMULA_FILE}" | ||
| perl -pi -e 's#^ sha256 "[0-9a-f]{64}"$# sha256 "'"${{ steps.shasum.outputs.sha256 }}"'"#' "${FORMULA_FILE}" | ||
|
|
Comment on lines
+94
to
+108
| - name: Commit and push formula update | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| cd tap | ||
| if git diff --quiet; then | ||
| echo "No formula changes to commit." | ||
| exit 0 | ||
| fi | ||
|
|
||
| git config user.name "happy-bot" | ||
| git config user.email "actions@users.noreply.github.com" | ||
| git add "${FORMULA_PATH}" | ||
| git commit -m "chore(homebrew): bump happy to ${{ steps.meta.outputs.version }}" | ||
| git push origin HEAD:main |
Comment on lines
+32
to
+37
| VERSION="${VERSION#v}" | ||
| else | ||
| echo "Unable to determine version. Provide workflow_dispatch input 'version' or release tag." | ||
| exit 1 | ||
| fi | ||
|
|
Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Formula/happy.rbin the Homebrew tap when ahappy-coderrelease is publishedworkflow_dispatchwith an explicit versionConfiguration required
HOMEBREW_TAP_GITHUB_TOKEN(token with write access to the tap repo)HOMEBREW_TAP_REPOrussellbrenner/homebrew-happyslopus/homebrew-happyafter tap transferWhy
Automates the Homebrew formula bump so releases stay in sync with npm without manual edits.