Skip to content

Commit c4ed189

Browse files
committedJan 3, 2025·
Setup goreleaser
1 parent 88a8c7b commit c4ed189

File tree

4 files changed

+82
-1
lines changed

4 files changed

+82
-1
lines changed
 

‎.github/workflows/release.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version: ">=1.21.0"
24+
cache: true
25+
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v5
28+
with:
29+
distribution: goreleaser
30+
version: latest
31+
args: release --clean
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ mcphost
77
.idea
88
test/
99
build/
10-
scripts/
10+
scripts/
11+
dist/

‎.goreleaser.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
goarch:
13+
- amd64
14+
- arm64
15+
ignore:
16+
- goos: windows
17+
goarch: arm64
18+
binary: mcphost
19+
ldflags:
20+
- -s -w -X main.version={{.Version}}
21+
22+
archives:
23+
- format: tar.gz
24+
name_template: >-
25+
{{ .ProjectName }}_
26+
{{- title .Os }}_
27+
{{- if eq .Arch "amd64" }}x86_64
28+
{{- else }}{{ .Arch }}{{ end }}
29+
{{- if .Arm }}v{{ .Arm }}{{ end }}
30+
format_overrides:
31+
- goos: windows
32+
format: zip
33+
34+
checksum:
35+
name_template: "checksums.txt"
36+
37+
changelog:
38+
sort: asc
39+
filters:
40+
exclude:
41+
- "^docs:"
42+
- "^test:"
43+
- "^ci:"
44+
- Merge pull request
45+
- Merge branch

‎main.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package main
22

33
import "github.com/mark3labs/mcphost/cmd"
44

5+
var version = "dev"
6+
57
func main() {
68
cmd.Execute()
79
}

0 commit comments

Comments
 (0)
Please sign in to comment.