add GoReleaser configuration and GitHub Actions workflow

This commit is contained in:
John Doe 2025-04-02 18:09:19 +03:00
parent d877986dfb
commit 828d57af90
3 changed files with 73 additions and 0 deletions

31
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: goreleaser
on:
pull_request:
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

40
.goreleaser.yaml Normal file
View file

@ -0,0 +1,40 @@
version: 2
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: .
binary: telegram-mcp
ldflags:
- -s -w
archives:
- name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
wrap_in_directory: false
files:
- none*
changelog:
use: github
sort: asc
groups:
- title: Release Notes
regexp: ".*"
filters:
exclude:
- ".*"
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
algorithm: sha256

View file

@ -22,6 +22,8 @@ tasks:
- go run ./. {{.CLI_ARGS}}
build:
env:
CGO_ENABLED: 0
cmds:
- mkdir -p ./bin
- go build -o ./bin/telegram-mcp ./.