From dfefd2ea4e9d44187b4f861bc202970247dd34c8 Mon Sep 17 00:00:00 2001 From: Christopher Angelo Phillips <32073428+spiffcs@users.noreply.github.com> Date: Mon, 10 Jan 2022 14:52:31 -0500 Subject: [PATCH] update goreleaser with windows checksums (#740) * update goreleaser with windows checksums Signed-off-by: Christopher Phillips * update format to be closer to our previous implementation Signed-off-by: Christopher Phillips * remove linux replacement Signed-off-by: Christopher Phillips * typo Signed-off-by: Christopher Phillips --- .goreleaser.yaml | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 43f7f9695..76c38d61b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,28 +13,10 @@ builds: - CGO_ENABLED=0 goos: - linux - goarch: - - amd64 - - arm64 - # Set the modified timestamp on the output binary to the git timestamp (to ensure a reproducible build) - mod_timestamp: '{{ .CommitTimestamp }}' - ldflags: | - -w - -s - -extldflags '-static' - -X github.com/anchore/syft/internal/version.version={{.Version}} - -X github.com/anchore/syft/internal/version.gitCommit={{.Commit}} - -X github.com/anchore/syft/internal/version.buildDate={{.Date}} - -X github.com/anchore/syft/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}} - - - binary: syft - id: syft-win - env: - - CGO_ENABLED=0 - goos: - windows goarch: - amd64 + - arm64 # Set the modified timestamp on the output binary to the git timestamp (to ensure a reproducible build) mod_timestamp: '{{ .CommitTimestamp }}' ldflags: | @@ -68,14 +50,19 @@ builds: -X github.com/anchore/syft/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}} archives: - - format: tar.gz - builds: - - syft # i.e. Linux only + - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + id: syft + replacements: + windows: Windows + amd64: x86_64 + format_overrides: + - goos: windows + format: zip + - format: zip # This is a hack for syft-macos! We don't actually intend to use _this_ ZIP file, we just need goreleaser to consider the ZIP file produced by gon (which will have the same file name) to be an artifact so we can use it downstream in publishing (e.g. to a homebrew tap) - id: syft-zip + id: syft-exception builds: - syft-macos - - syft-win signs: - artifacts: checksum @@ -109,8 +96,11 @@ brews: - tap: owner: anchore name: homebrew-syft + ids: + - syft homepage: *website description: *description + license: "Apache License 2.0" dockers: - image_templates: