Skip to content

Commit d66598b

Browse files
authored
Add binaries for macOS (#209)
* Add binaries for MacOS * Add Make target for GoReleaser
1 parent 9fd071e commit d66598b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
uses: goreleaser/goreleaser-action@v2
7777
with:
7878
version: latest
79-
args: --rm-dist --debug --skip-publish --snapshot
79+
args: build --snapshot --rm-dist
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8282
GOPATH: ${{ env.GOPATH }}

.goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ builds:
88
- CGO_ENABLED=0
99
goos:
1010
- linux
11+
- darwin
1112
goarch:
1213
- 386
1314
- amd64

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export DOCKER_BUILDKIT = 1
1414
nginx-prometheus-exporter:
1515
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(VERSION) -X main.commit=$(GIT_COMMIT) -X main.date=$(DATE)" -o nginx-prometheus-exporter
1616

17+
.PHONY: build-goreleaser
18+
build-goreleaser: ## Build all binaries using GoReleaser
19+
@goreleaser -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with GoReleaser. Follow the docs to install it https://goreleaser.com/install\n"; exit $$code)
20+
GOPATH=$(shell go env GOPATH) goreleaser build --rm-dist --debug --snapshot
21+
1722
.PHONY: lint
1823
lint:
1924
docker run --pull always --rm -v $(shell pwd):/nginx-prometheus-exporter -w /nginx-prometheus-exporter -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run

0 commit comments

Comments
 (0)