Skip to content

Publish upkeep to a self-hosted MacPorts port repo - #47

Merged
teknikqa merged 2 commits into
mainfrom
feat/macports-install
Sep 2, 2026
Merged

teknikqa merged 2 commits into
mainfrom
feat/macports-install

Conversation

@teknikqa

@teknikqa teknikqa commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Makes upkeep itself installable via sudo 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 a release.yml step after GoReleaser: downloads the tag's darwin_arm64/darwin_amd64 release tarballs, computes sha256/rmd160/size for each, and pushes an updated Portfile to the port repo.
  • README/CHANGELOG document the new install path.

Why a prebuilt binary, not a source build

First pass used PortGroup golang 1.0 (mirroring the official goreleaser port), but that PortGroup lives in the official ports tree's _resources/, which a bare custom repo doesn't have access to — portindex failed with PortGroup golang 1.0 could not be located. Switched to fetching the same prebuilt tarballs GoReleaser already publishes for Homebrew, picked by build_arch (pattern copied from the real lang/cabal port). No PortGroup dependency, and installs are instant instead of a Go compile.

Verified

Set up teknikqa/macports-upkeep with a CI workflow that builds MacPorts from source on macos-latest (no third-party Action, since the job needs write access to push the regenerated PortIndex), then actually runs sudo port install upkeep and upkeep --list against 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 with macportsuser root), and now passes: upkeep installs and its binary runs correctly on the CI runner.

scripts/update-macports-portfile.sh round-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.

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

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@teknikqa
teknikqa merged commit 2c1a5c8 into main Sep 2, 2026
11 checks passed
@teknikqa
teknikqa deleted the feat/macports-install branch September 2, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant