diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e290868 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..5809795 --- /dev/null +++ b/.goreleaser.yaml @@ -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 \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index f43415f..f62c7dc 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -22,6 +22,8 @@ tasks: - go run ./. {{.CLI_ARGS}} build: + env: + CGO_ENABLED: 0 cmds: - mkdir -p ./bin - go build -o ./bin/telegram-mcp ./.