Skip to content

Commit

Permalink
feat(ci): publish GitHub release and Homebrew package
Browse files Browse the repository at this point in the history
This change updates the GitHub Actions workflow to publish the Vespa CLI to both GitHub Releases and Homebrew. The key changes are:

- Publish the GitHub release and capture the release URL
- Only publish to Homebrew if a GitHub release was successful
- Install the CLI package via Homebrew if a release was published
  • Loading branch information
esolitos authored and gitbutler-client committed Sep 20, 2024
1 parent e9d02c8 commit 317acc9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,24 @@ jobs:
brew install --quiet coreutils gh zip go
- name: Publish to GitHub Releases
id: github-release
env:
GH_TOKEN: ${{ github.token }}
run: |
# Release to Github directly, bypassing the diff check as we already perform this check in the "prepare" job.
make -- --dist-github
release_url="$(cat /tmp/vespa-cli-release-url.txt || true)"
echo "release-url=${release_url}" > "${GITHUB_OUTPUT}"
- name: Publish to Homebrew
if: steps.github-release.outputs.release-url != ''
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
run: |
# Release to Homebrew directly, bypassing the diff check as we already perform this check in the "prepare" job.
make -- --dist-homebrew
- name: Install via Homebrew
if: steps.github-release.outputs.release-url != ''
run: |
make install-brew
14 changes: 10 additions & 4 deletions client/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@ dist-homebrew:
#
# $ make dist-github
--dist-github: dist
gh release create v$(VERSION) --repo vespa-engine/vespa --notes-file $(CURDIR)/README.md --title "Vespa CLI $(VERSION)" \
$(DIST)/vespa-cli_$(VERSION)_sha256sums.txt \
$(DIST)/vespa-cli_$(VERSION)_*.zip \
$(DIST)/vespa-cli_$(VERSION)_*.tar.gz
RELEASE_URL="$(gh release create v$(VERSION)
--verify-tag
--repo vespa-engine/vespa
--notes-file $(CURDIR)/README.md
--title "Vespa CLI $(VERSION)"
$(DIST)/vespa-cli_$(VERSION)_sha256sums.txt
$(DIST)/vespa-cli_$(VERSION)_*.zip
$(DIST)/vespa-cli_$(VERSION)_*.tar.gz)"

echo $RELEASE_URL > /tmp/vespa-cli-release-url.txt

dist-github:
go run cond_make.go --dist-github
Expand Down

0 comments on commit 317acc9

Please sign in to comment.