feat: add Homebrew installation support for hapi CLI

- Update CI workflow to package release artifacts with correct naming (hapi-* prefix)
- Generate SHA256 checksums for all artifacts
- Auto-update homebrew-tap repository on release
- Add Installation section to README with Homebrew, npm, and binary options
- Simplify .release-it.json config as CI now handles release process
- Add update-homebrew-formula script to update formula in homebrew-tap
- Add release-artifacts directory to .gitignore

Users can now install via: brew install tiann/tap/hapi
This commit is contained in:
weishu
2025-12-25 10:23:16 +08:00
parent 5a3f10078e
commit 90cb7dae05
6 changed files with 289 additions and 19 deletions
+22 -7
View File
@@ -16,17 +16,26 @@ jobs:
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build:single-exe:all
- name: Package binaries
- name: Package release artifacts
run: |
cd cli/dist-exe
mkdir -p ../release-artifacts
for dir in bun-*/; do
name="${dir%/}"
if [[ "$name" == *"windows"* ]]; then
zip -r "${name}.zip" "$dir"
target="${dir%/}"
# bun-darwin-arm64 -> hapi-darwin-arm64
name="hapi-${target#bun-}"
name="${name/windows/win32}"
if [[ "$target" == *"windows"* ]]; then
zip -j "../release-artifacts/${name}.zip" "$target"/hapi.exe
else
tar -czvf "${name}.tar.gz" "$dir"
tar -czvf "../release-artifacts/${name}.tar.gz" -C "$target" hapi
fi
done
cd ../release-artifacts
sha256sum * > checksums.txt
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -34,5 +43,11 @@ jobs:
gh release create "${GITHUB_REF#refs/tags/}" \
--title "Release ${GITHUB_REF#refs/tags/}" \
--generate-notes \
cli/dist-exe/*.tar.gz \
cli/dist-exe/*.zip
cli/release-artifacts/*
- name: Update Homebrew formula
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
cd cli && bun run update-homebrew-formula --version "$VERSION" --push