Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix goreleaser #153

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading