Repository navigation
Publish upkeep to a self-hosted MacPorts port repo - #47
Merged
Merged
Conversation
Adds scripts/update-macports-portfile.sh, run as a release.yml step after GoReleaser: it computes the sha256/rmd160/size of the tag's GitHub source tarball and pushes an updated Portfile to teknikqa/macports-upkeep (a plain Portfile repo, since MacPorts has no Homebrew-style tap mechanism). That repo regenerates its PortIndex via its own CI on every Portfile push. Requires a MACPORTS_TAP_GITHUB_TOKEN repo secret (PAT with write access to macports-upkeep) before the next release.
…y Portfile The Portfile no longer builds from source (PortGroup golang isn't resolvable from a bare port repo), so this script now computes checksums for both prebuilt darwin_arm64/darwin_amd64 release tarballs and rewrites the Portfile's two build_arch-conditional checksum blocks instead of a single go.setup source checksum.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Makes
upkeepitself installable viasudo port install upkeep, publishing to a new self-hosted port repo, teknikqa/macports-upkeep — MacPorts has no Homebrew-style tap, so this is a plain Portfile repo users add as a local source.What changed
scripts/update-macports-portfile.sh, run as arelease.ymlstep after GoReleaser: downloads the tag's darwin_arm64/darwin_amd64 release tarballs, computes sha256/rmd160/size for each, and pushes an updatedPortfileto the port repo.Why a prebuilt binary, not a source build
First pass used
PortGroup golang 1.0(mirroring the officialgoreleaserport), but that PortGroup lives in the official ports tree's_resources/, which a bare custom repo doesn't have access to —portindexfailed withPortGroup golang 1.0 could not be located. Switched to fetching the same prebuilt tarballs GoReleaser already publishes for Homebrew, picked bybuild_arch(pattern copied from the reallang/cabalport). No PortGroup dependency, and installs are instant instead of a Go compile.Verified
Set up
teknikqa/macports-upkeepwith a CI workflow that builds MacPorts from source onmacos-latest(no third-party Action, since the job needs write access to push the regeneratedPortIndex), then actually runssudo port install upkeepandupkeep --listagainst the Portfile as a real end-to-end check — not just a syntax parse. That caught a second real bug (MacPorts drops root to an unprivileged build user that can't read a source tree outside/opt/local; fixed withmacportsuser root), and now passes:upkeepinstalls and its binary runs correctly on the CI runner.scripts/update-macports-portfile.shround-trips against the real v0.11.0 release with no diff (checksums match what's already committed), confirming both the checksum computation and the Portfile rewrite logic are correct.