Merge pull request #254 from multica-ai/feat/homebrew-release
feat(release): add GoReleaser config and Homebrew tap support
This commit is contained in:
commit
04997b4011
7 changed files with 99 additions and 6 deletions
36
.github/workflows/release.yml
vendored
Normal file
36
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: server/go.mod
|
||||
cache-dependency-path: server/go.sum
|
||||
|
||||
- name: Run tests
|
||||
run: cd server && go test ./...
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: "~> v2"
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -24,7 +24,6 @@ server/bin/
|
|||
server/tmp/
|
||||
server/migrate
|
||||
server/daemon
|
||||
server/multica-cli
|
||||
server/multica
|
||||
|
||||
# Test artifacts
|
||||
|
|
|
|||
58
.goreleaser.yml
Normal file
58
.goreleaser.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
version: 2
|
||||
|
||||
project_name: multica
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- cd server && go mod tidy
|
||||
|
||||
builds:
|
||||
- id: multica
|
||||
main: ./cmd/multica
|
||||
dir: server
|
||||
binary: multica
|
||||
ldflags:
|
||||
- -s -w
|
||||
- -X main.version={{.Version}}
|
||||
- -X main.commit={{.ShortCommit}}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
archives:
|
||||
- id: default
|
||||
formats:
|
||||
- tar.gz
|
||||
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
- "^chore:"
|
||||
|
||||
brews:
|
||||
- name: multica
|
||||
repository:
|
||||
owner: multica-ai
|
||||
name: homebrew-tap
|
||||
branch: main
|
||||
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||
directory: Formula
|
||||
homepage: "https://github.com/multica-ai/super-multica"
|
||||
description: "Multica CLI — local agent runtime and management tool for the Multica platform"
|
||||
license: "MIT"
|
||||
install: |
|
||||
bin.install "multica"
|
||||
test: |
|
||||
system "#{bin}/multica", "version"
|
||||
2
Makefile
2
Makefile
|
|
@ -125,7 +125,7 @@ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
|||
|
||||
build:
|
||||
cd server && go build -o bin/server ./cmd/server
|
||||
cd server && go build -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)" -o bin/multica-cli ./cmd/multica
|
||||
cd server && go build -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)" -o bin/multica ./cmd/multica
|
||||
|
||||
test:
|
||||
$(REQUIRE_ENV)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func newAPIClient(cmd *cobra.Command) (*cli.APIClient, error) {
|
|||
workspaceID := resolveWorkspaceID(cmd)
|
||||
|
||||
if serverURL == "" {
|
||||
return nil, fmt.Errorf("server URL not set: use --server-url flag, MULTICA_SERVER_URL env, or 'multica-cli config set server_url <url>'")
|
||||
return nil, fmt.Errorf("server URL not set: use --server-url flag, MULTICA_SERVER_URL env, or 'multica config set server_url <url>'")
|
||||
}
|
||||
|
||||
return cli.NewAPIClient(serverURL, workspaceID), nil
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ var versionCmd = &cobra.Command{
|
|||
Use: "version",
|
||||
Short: "Print version information",
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
fmt.Printf("multica-cli %s (commit: %s)\n", version, commit)
|
||||
fmt.Printf("multica %s (commit: %s)\n", version, commit)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ var (
|
|||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "multica-cli",
|
||||
Use: "multica",
|
||||
Short: "Multica CLI — local agent runtime and management tool",
|
||||
Long: "multica-cli manages local agent runtimes and provides control commands for the Multica platform.",
|
||||
Long: "multica manages local agent runtimes and provides control commands for the Multica platform.",
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue