Skip to content

Commit

Permalink
Merge pull request #286 from clcollins/goreleaser_updates
Browse files Browse the repository at this point in the history
adjust GoReleaser config
  • Loading branch information
openshift-merge-bot[bot] authored May 23, 2024
2 parents a453f61 + ee4032d commit 63189fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
13 changes: 9 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

version: 1

project_name: 'ocm-container'
before:
hooks:
# You may remove this if you don't use go modules.
Expand All @@ -15,6 +16,7 @@ before:
builds:
- env:
- CGO_ENABLED=0
- "GOFLAGS=-mod=readonly -trimpath" # trimpath helps with producing verifiable binaries
goos:
- linux
- darwin
Expand All @@ -32,10 +34,13 @@ archives:
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'sha256sum.txt'
algorithm: sha256

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
Expand Down
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ export CGO_ENABLED=0

GOLANGCI_LINT_VERSION=v1.51.2
GORELEASER_VERSION=v1.24.0
# TODO: Setup token for goreleaser
export GITHUB_TOKEN?=
GORELEASER_CONFIG=.goreleaser.yaml
# Number of cores to use when building assets
GORELEASER_CORES=4
GORELEASER_ADDITIONAL_ARGS=

export GITHUB_TOKEN?=

.Phony: checkEnv
checkEnv:
Expand Down Expand Up @@ -132,11 +135,15 @@ lint:

.PHONY: release
release:
goreleaser release --clean
ifndef GITHUB_TOKEN
$(error GITHUB_TOKEN is undefined)
endif
goreleaser check --config $(GORELEASER_CONFIG)
goreleaser release --clean --config $(GORELEASER_CONFIG) --parallelism $(GORELEASER_CORES) $(GORELEASER_ADDITIONAL_ARGS)

.PHONY: build-snapshot
build-snapshot:
goreleaser build --clean --snapshot --single-target=true
goreleaser build --clean --snapshot --single-target=true --config $(GORELEASER_CONFIG)

.PHONY: fmt
fmt:
Expand Down

0 comments on commit 63189fe

Please sign in to comment.