Skip to content

Commit

Permalink
Merge pull request #153 from philips-labs/fix-goreleaser
Browse files Browse the repository at this point in the history
fix goreleaser
  • Loading branch information
marcofranssen committed Sep 11, 2023
2 parents e86ba86 + 0913cac commit 6f2f394
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist ${{ (!startsWith(github.ref, 'refs/tags/') && '--snapshot') || '' }}
args: release --clean ${{ (!startsWith(github.ref, 'refs/tags/') && '--snapshot') || '' }}
env:
LDFLAGS: ${{ steps.release-vars.outputs.ldflags }}
GIT_HASH: ${{ steps.release-vars.outputs.git_hash }}
Expand Down
13 changes: 8 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ builds:
archives:
- id: archive
format: tar.gz
replacements:
darwin: macOS
files:
- LICENSE*
- README*
Expand All @@ -47,7 +45,7 @@ dockers:
- "ghcr.io/philips-labs/{{ .ProjectName }}:{{ .FullCommit }}"
build_flag_templates:
- "--pull"
- "--label=com.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.description={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
Expand All @@ -73,6 +71,7 @@ signs:
artifacts: checksum
args:
- sign-blob
- --yes
- --key
- cosign.key
- '--output-certificate=${certificate}'
Expand All @@ -85,6 +84,7 @@ signs:
artifacts: binary
args:
- sign-blob
- --yes
- --key
- cosign.key
- '--output-certificate=${certificate}'
Expand All @@ -97,18 +97,21 @@ signs:
artifacts: archive
args:
- sign-blob
- --yes
- --key
- cosign.key
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'

docker_signs:
- cmd: cosign
artifacts: all
- artifacts: all
cmd: cosign
stdin: '{{ .Env.COSIGN_PASSWORD }}'
output: true
args:
- 'sign'
- --yes
- --key
- cosign.key
- '${artifact}'
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ image: ## build the binary in a docker image
.

.PHONY: snapshot-release
snapshot-release: ## creates a snapshot release using goreleaser
LDFLAGS=$(LDFLAGS) GIT_TAG=$(GIT_TAG) GIT_HASH=$(GIT_HASH) goreleaser release --snapshot --rm-dist
snapshot-release: $(GO_PATH)/bin/goreleaser ## creates a snapshot release using goreleaser
LDFLAGS=$(LDFLAGS) GIT_TAG=$(GIT_TAG) GIT_HASH=$(GIT_HASH) goreleaser release --snapshot --clean

.PHONY: release
release: ## creates a release using goreleaser
release: $(GO_PATH)/bin/goreleaser ## creates a release using goreleaser
LDFLAGS=$(LDFLAGS) GIT_TAG=$(GIT_TAG) GIT_HASH=$(GIT_HASH) goreleaser release

release-vars: ## print the release variables for goreleaser
Expand All @@ -67,6 +67,9 @@ $(GO_PATH)/bin/goimports:
$(GO_PATH)/bin/golint:
go install golang.org/x/lint/golint@latest

$(GO_PATH)/bin/goreleaser:
go install github.com/goreleaser/goreleaser@latest

.PHONY: lint
lint: $(GO_PATH)/bin/goimports $(GO_PATH)/bin/golint ## runs linting
@echo Linting using golint
Expand Down

0 comments on commit 6f2f394

Please sign in to comment.