Skip to content

Commit 155a217

Browse files
authored
PMM-7 update goreleaser version and config (#931)
1 parent bc52a76 commit 155a217

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Run GoReleaser
4646
uses: goreleaser/goreleaser-action@v6
4747
with:
48-
version: v1.18.2
49-
args: release --rm-dist
48+
version: "~> v2"
49+
args: release --clean
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
dist: build
2+
version: 2
23
builds:
34
- binary: mongodb_exporter
45
env:
56
- CGO_ENABLED=0
67
goos:
78
- linux
89
- darwin
10+
- windows
911
goarch:
1012
- amd64
1113
- arm
@@ -23,9 +25,9 @@ archives:
2325
- name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{ .Arch }}"
2426
wrap_in_directory: true
2527
snapshot:
26-
name_template: "{{ .ShortCommit }}"
28+
version_template: "{{ .ShortCommit }}"
2729
changelog:
28-
skip: true
30+
use: github
2931
release:
3032
github:
3133
owner: percona
@@ -77,8 +79,9 @@ docker_manifests:
7779
image_templates:
7880
- ghcr.io/percona/mongodb_exporter:{{.Version}}-arm64v8
7981
- ghcr.io/percona/mongodb_exporter:{{.Version}}-amd64
82+
8083
nfpms:
81-
- file_name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{ .Arch }}"
84+
- file_name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{- if eq .Arch `amd64` }}64-bit{{- else }}{{ .Arch }}{{ end }}"
8285
homepage: https://www.percona.com/
8386
description: MongoDB exporter for Prometheus
8487
maintainer: Percona
@@ -88,8 +91,6 @@ nfpms:
8891
- deb
8992
- rpm
9093
bindir: /usr/bin
91-
replacements:
92-
amd64: 64-bit
9394
scripts:
9495
postinstall: ".scripts/postinst"
9596
contents:

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ build: ## Compile using plain go build
7676
release: ## Build the binaries using goreleaser
7777
docker run --rm --privileged \
7878
-v ${PWD}:/go/src/github.com/user/repo \
79+
-v /var/run/docker.sock:/var/run/docker.sock \
7980
-w /go/src/github.com/user/repo \
80-
goreleaser/goreleaser release --snapshot --skip-publish --rm-dist
81+
goreleaser/goreleaser release --snapshot --skip=publish --clean
8182

8283
FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
8384

0 commit comments

Comments
 (0)