Repository navigation
Add Homebrew support - #894
Merged
Merged
Conversation
ignite --version reads a hard-coded string, which had drifted from the tags (0.6.9 in code, 0.7.1 tagged). The release job now checks the tagged commit and stops before creating a Release or opening a Homebrew bump PR if they differ.
Merged
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.
Adds the pieces Ignite needs to be distributed through a maintainer-owned Homebrew tap. Refs #879.
Why
make install. A Homebrew formula makes that a two-line install and gives us a path to prebuilt bottles.ignite(a Cosmos blockchain tool), so a barebrew install ignitewould always pick that one, even with our tap added. The formula is therefore calledignite-swift. The installed command is stillignite.homebrew-igniterepo.Changes
ignite runfinds its server script reliablyRunCommandused to locateignite-server.pyfromargv[0]. That only works when the tool is invoked by path. Whenigniteis run fromPATH,argv[0]is justignite, so the lookup resolves against the current directory and fails. Homebrew symlinks binaries into its prefix, which makes this the normal case.The new
locateServerScript()checks, in order:Bundle.main.executableURL). This is wheremake installputs it.libexec/folder, which is where Homebrew installs support files.It also tries
argv[0]when that contains a slash. Behaviour formake installusers is unchanged.Two smaller fixes in the same function:
brew reinstall ignite-swift.Release workflow (
.github/workflows/release.yml)Runs on tags matching
[0-9]+.[0-9]+.[0-9]+.release: creates a GitHub Release with generated notes, unless one already exists for the tag. The latest Release today is 0.6.4, so tags since then have none.bump-homebrew-tap: checks out the tap using theHOMEBREW_TAP_TOKENsecret, updatesurlandsha256inFormula/ignite-swift.rb, drops the stalebottle doblock, pushesignite-swift-<tag>and opens a PR on the tap. The tap's own CI then builds bottles, and thepr-pulllabel publishes them. It does nothing if the formula is already at that tag, and fails with a clear error if the secret is missing.releasechecks that theversion:string inIgniteCLI.swiftequals the tag, and stops if not.ignite --versionreads that hard-coded string, and it had drifted from the tags (0.6.9 in code, 0.7.1 tagged). A release now needs a version-bump PR merged first.README
Adds a Homebrew install section above the build-from-source steps, with a note explaining the
ignite-swiftname.Before merging
HOMEBREW_TAP_TOKENsecret is set on this repo (fine-grained, limited to the tap, Contents and Pull requests read/write).Formula/ignite-swift.rb, otherwise the first bump PR has nothing to update.release.ymland the README point at the tap's current location.Testing
Not run end to end yet. The first tag after merge will exercise the workflow; the tap's
brew test-botrun on the resulting bump PR is the real install check.