Skip to content

Commit

Permalink
fix(ci): release container tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecmd committed Apr 22, 2023
1 parent 969bb4c commit 0dbea0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0dbea0f

Please # to comment.