Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
env_vars: GO_VERSION,TEST_MONGODB_IMAGE
fail_ci_if_error: false

- name: Dry-run GoReleaser
run: |
make release-dry-run

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will run on every matrix element which isn't great, let's make another job and rename current one to test instead of build

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah reworked them now.

- name: Run debug commands on failure
if: ${{ failure() }}
run: |
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ builds:
- binary: mongodb_exporter
id: mongodb_exporter
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build clean default help init test format check-license
.PHONY: all build clean default help init test format check-license release-dry-run
default: help

GO_TEST_PATH ?= ./...
Expand Down Expand Up @@ -83,6 +83,21 @@ release: ## Build the binaries using goreleaser
-w /go/src/github.com/user/repo \
goreleaser/goreleaser release --snapshot --skip=publish --clean

release-dry-run: ## Build cross-platform binaries locally without publishing
@echo "Building cross-platform binaries with GoReleaser..."
@if command -v goreleaser >/dev/null 2>&1; then \
goreleaser build --snapshot --clean; \
else \
echo "GoReleaser not found. Installing via Docker..."; \
docker run --rm --privileged \
-v ${PWD}:/go/src/github.com/percona/mongodb_exporter \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/percona/mongodb_exporter \
goreleaser/goreleaser build --snapshot --clean; \
fi
@find build -name mongodb_exporter -type f | sort


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

format: ## Format source code
Expand Down
Loading