Skip to content

Commit fe03602

Browse files
artparclaude
andcommitted
Add goreleaser for Homebrew, Scoop, deb/rpm packages
- goreleaser v2 config with homebrew_casks, scoops, nfpms - GitHub Actions workflow uses goreleaser-action v7 - Go version from go.mod (go-version-file) - README updated with package manager install instructions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 03a867f commit fe03602

3 files changed

Lines changed: 106 additions & 71 deletions

File tree

.github/workflows/go.yml

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,33 @@ on:
66
tags: ['v*']
77
pull_request:
88

9+
permissions:
10+
contents: write
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-go@v5
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-go@v6
1518
with:
16-
go-version: '1.22'
17-
- name: Test
18-
run: go test -mod vendor -race ./...
19+
go-version-file: go.mod
20+
- run: go test -mod vendor -race ./...
1921

2022
release:
2123
needs: test
2224
if: startsWith(github.ref, 'refs/tags/v')
2325
runs-on: ubuntu-latest
24-
permissions:
25-
contents: write
26-
strategy:
27-
matrix:
28-
include:
29-
- goos: linux
30-
goarch: amd64
31-
- goos: linux
32-
goarch: arm64
33-
- goos: darwin
34-
goarch: amd64
35-
- goos: darwin
36-
goarch: arm64
37-
- goos: windows
38-
goarch: amd64
3926
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-go@v5
27+
- uses: actions/checkout@v6
4228
with:
43-
go-version: '1.22'
44-
45-
- name: Build
46-
env:
47-
GOOS: ${{ matrix.goos }}
48-
GOARCH: ${{ matrix.goarch }}
49-
CGO_ENABLED: '0'
50-
run: |
51-
EXT=""
52-
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
53-
OUTNAME="daptin-cli-${GOOS}-${GOARCH}${EXT}"
54-
go build -mod vendor -ldflags="-s -w -X main.version=${GITHUB_REF_NAME}" -o "dist/${OUTNAME}" .
55-
56-
- uses: actions/upload-artifact@v4
29+
fetch-depth: 0
30+
- uses: actions/setup-go@v6
5731
with:
58-
name: daptin-cli-${{ matrix.goos }}-${{ matrix.goarch }}
59-
path: dist/
60-
61-
publish:
62-
needs: release
63-
if: startsWith(github.ref, 'refs/tags/v')
64-
runs-on: ubuntu-latest
65-
permissions:
66-
contents: write
67-
steps:
68-
- uses: actions/download-artifact@v4
69-
with:
70-
path: dist/
71-
merge-multiple: true
72-
73-
- name: List artifacts
74-
run: ls -lR dist/
75-
76-
- uses: softprops/action-gh-release@v2
32+
go-version-file: go.mod
33+
- uses: goreleaser/goreleaser-action@v7
7734
with:
78-
files: dist/*
79-
generate_release_notes: true
35+
version: '~> v2'
36+
args: release --clean
8037
env:
8138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go test -mod vendor ./...
6+
7+
builds:
8+
- main: .
9+
binary: daptin-cli
10+
env:
11+
- CGO_ENABLED=0
12+
ldflags:
13+
- -s -w -X main.version={{.Version}}
14+
goos:
15+
- linux
16+
- darwin
17+
- windows
18+
goarch:
19+
- amd64
20+
- arm64
21+
mod_timestamp: "{{ .CommitTimestamp }}"
22+
23+
archives:
24+
- formats:
25+
- tar.gz
26+
format_overrides:
27+
- goos: windows
28+
formats:
29+
- zip
30+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
31+
32+
nfpms:
33+
- package_name: daptin-cli
34+
vendor: Daptin
35+
homepage: https://github.com/daptin/daptin-cli
36+
maintainer: "Daptin <hello@daptin.com>"
37+
description: CLI client for Daptin API server
38+
license: MIT
39+
formats:
40+
- deb
41+
- rpm
42+
43+
homebrew_casks:
44+
- name: daptin-cli
45+
binaries:
46+
- daptin-cli
47+
repository:
48+
owner: daptin
49+
name: homebrew-tap
50+
homepage: https://github.com/daptin/daptin-cli
51+
description: CLI client for Daptin API server
52+
53+
scoops:
54+
- repository:
55+
owner: daptin
56+
name: scoop-bucket
57+
homepage: https://github.com/daptin/daptin-cli
58+
description: CLI client for Daptin API server
59+
license: MIT
60+
61+
changelog:
62+
use: github-native
63+
64+
release:
65+
github:
66+
owner: daptin
67+
name: daptin-cli

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,43 @@ All Daptin entities are accessed uniformly via CRUD commands. All Daptin actions
66

77
## Install
88

9-
Download a binary from the [latest release](https://github.com/daptin/daptin-cli/releases/latest):
9+
### Homebrew (macOS / Linux)
1010

1111
```bash
12-
# macOS (Apple Silicon)
13-
curl -L https://github.com/daptin/daptin-cli/releases/latest/download/daptin-cli-darwin-arm64 -o daptin-cli
14-
chmod +x daptin-cli
12+
brew install daptin/tap/daptin-cli
13+
```
14+
15+
### Scoop (Windows)
16+
17+
```powershell
18+
scoop bucket add daptin https://github.com/daptin/scoop-bucket
19+
scoop install daptin-cli
20+
```
1521

16-
# macOS (Intel)
17-
curl -L https://github.com/daptin/daptin-cli/releases/latest/download/daptin-cli-darwin-amd64 -o daptin-cli
18-
chmod +x daptin-cli
22+
### Debian / Ubuntu
1923

20-
# Linux (amd64)
21-
curl -L https://github.com/daptin/daptin-cli/releases/latest/download/daptin-cli-linux-amd64 -o daptin-cli
22-
chmod +x daptin-cli
24+
Download the `.deb` from the [latest release](https://github.com/daptin/daptin-cli/releases/latest):
2325

24-
# Linux (arm64)
25-
curl -L https://github.com/daptin/daptin-cli/releases/latest/download/daptin-cli-linux-arm64 -o daptin-cli
26-
chmod +x daptin-cli
26+
```bash
27+
sudo dpkg -i daptin-cli_*.deb
2728
```
2829

29-
Or build from source:
30+
### RPM (Fedora / RHEL)
31+
32+
```bash
33+
sudo rpm -i daptin-cli_*.rpm
34+
```
35+
36+
### Go
3037

3138
```bash
3239
go install github.com/daptin/daptin-cli@latest
3340
```
3441

42+
### Binary download
43+
44+
Grab a binary from the [releases page](https://github.com/daptin/daptin-cli/releases/latest) for linux, macOS, or Windows (amd64 / arm64).
45+
3546
## Quick Start
3647

3748
```bash

0 commit comments

Comments
 (0)