Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCOOP_BUCKET_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
npm:
needs: binaries
runs-on: ubuntu-latest
Expand Down
38 changes: 38 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,44 @@ archives:
- id: gorse-cli
formats: [binary]
name_template: "gorse-cli_{{ .Os }}_{{ .Arch }}"
- id: packages
formats: [tar.gz]
format_overrides:
- goos: windows
formats: [zip]
name_template: "gorse-cli_{{ .Os }}_{{ .Arch }}"
scoops:
- name: gorse-cli
ids: [packages]
repository:
owner: gorse-io
name: scoop-bucket
branch: main
token: "{{ .Env.SCOOP_BUCKET_TOKEN }}"
directory: bucket
homepage: "https://github.com/gorse-io/cli"
description: "Command-line tool for Gorse recommender system."
license: Apache-2.0
skip_upload: auto
brews:
- name: gorse-cli
ids: [packages]
repository:
owner: gorse-io
name: homebrew-tap
branch: main
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
directory: Formula
homepage: "https://github.com/gorse-io/cli"
description: "Command-line tool for Gorse cluster management"
license: Apache-2.0
skip_upload: auto
install: |
bin.install "gorse-cli"
test: |
output = shell_output("#{bin}/gorse-cli --version")
assert_match "Version:", output
assert_match version.to_s, output
checksum:
disable: true
release:
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,41 @@ Contexts and API keys remain in the system keyring under the existing

## Development

### Package manager release publishing

Stable releases automatically update `bucket/gorse-cli.json` on the `main`
branch of `gorse-io/scoop-bucket` through GoReleaser. The manifest includes
Windows amd64 and arm64 ZIP download URLs and SHA256 hashes. Existing standalone
release binaries remain available. Prerelease tags do not update the bucket.

Before publishing, configure the `SCOOP_BUCKET_TOKEN` Actions secret in this
repository with a fine-grained personal access token restricted to
`gorse-io/scoop-bucket`, with **Contents: Read and write** permission. The token
must be allowed to push to the bucket's `main` branch (and approved by the
organization if required). The default `GITHUB_TOKEN` remains responsible for
uploading CLI release assets; it cannot write to the separate bucket repository.

The same release also updates `Formula/gorse-cli.rb` on the `main` branch of
`gorse-io/homebrew-tap` for macOS arm64 and Linux amd64/arm64. Configure a second
Actions secret, `HOMEBREW_TAP_TOKEN`, restricted to that repository with
**Contents: Read and write** permission and access to push to `main`.
Prerelease tags do not update the tap either. Homebrew uses TAR.GZ archives;
Scoop uses ZIP archives, while standalone binaries remain unchanged.

The Homebrew publisher uses GoReleaser's deprecated but still supported `brews`
configuration to update the existing Formula in place. Migrating the tap to
Casks and adding tap migration metadata is outside this change.

Validate release artifacts locally without publishing:

```sh
goreleaser release --snapshot --clean
```

`goreleaser check` reports the intentional `brews` deprecation as a nonzero
exit; snapshot generation validates both package manager outputs without
publishing.

```sh
go test ./...
go vet ./...
Expand Down
Loading