diff --git a/.releaserc.yml b/.releaserc.yml index 3dba357..ee6a628 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -4,4 +4,10 @@ branches: plugins: - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" - - "@semantic-release/github" + - - "@semantic-release/exec" + - prepareCmd: "make build-container-tarball VERSION=${nextRelease.version}" + - - "@semantic-release/github" + - assets: + - path: "target/sonic_exporter.tar.gz" + label: "Container tarball" + diff --git a/Makefile b/Makefile index 0f2e8f9..385e235 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,8 @@ LDFLAGS = -ldflags "-X main.Version=${VERSION} -X main.GitHash=${GIT_HASH} -X ma build: CGO_ENABLED=0 go build ${LDFLAGS} -v -o target/sonic_exporter . +.PHONY: build-container-tarball +build-container-tarball: + docker build -t sonic_exporter . + docker image save sonic_exporter -o target/sonic_exporter.tar + gzip target/sonic_exporter.tar