Skip to content

Commit 1ab1035

Browse files
committed
feat: add goreleaser config and CI workflow
Resolves #31.
1 parent 87de73d commit 1ab1035

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

.github/workflows/release.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: goreleaser
2+
3+
on:
4+
pull_request:
5+
push:
6+
# run only against tags
7+
tags:
8+
- "v*"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: stable
25+
# More assembly might be required: Docker logins, GPG, etc.
26+
# It all depends on your needs.
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v6
29+
with:
30+
# either 'goreleaser' (default) or 'goreleaser-pro'
31+
distribution: goreleaser
32+
# 'latest', 'nightly', or a semver
33+
version: "~> v2"
34+
args: release --clean
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
38+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
3+
version: 2
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
main: ./cmd/mcp-grafana
13+
goos:
14+
- linux
15+
- windows
16+
- darwin
17+
18+
archives:
19+
- formats: tar.gz
20+
# this name template makes the OS and Arch compatible with the results of `uname`.
21+
name_template: >-
22+
{{ .ProjectName }}_
23+
{{- title .Os }}_
24+
{{- if eq .Arch "amd64" }}x86_64
25+
{{- else if eq .Arch "386" }}i386
26+
{{- else }}{{ .Arch }}{{ end }}
27+
{{- if .Arm }}v{{ .Arm }}{{ end }}
28+
# use zip for windows archives
29+
format_overrides:
30+
- goos: windows
31+
formats: zip
32+
33+
changelog:
34+
sort: asc
35+
filters:
36+
exclude:
37+
- "^docs:"
38+
- "^test:"
39+
40+
release:
41+
footer: >-
42+
43+
---
44+
45+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

0 commit comments

Comments
 (0)