bump goreleaser to v1.10.3 (#1123)

Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
Weston Steimel 2022-07-28 17:10:32 +00:00 committed by GitHub
parent d1729ee7e2
commit 62897fbc89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 5 deletions

View File

@ -32,7 +32,7 @@ BOOTSTRAP_CACHE="c7afb99ad"
DISTDIR=./dist
SNAPSHOTDIR=./snapshot
OS=$(shell uname | tr '[:upper:]' '[:lower:]')
SNAPSHOT_BIN=$(shell realpath $(shell pwd)/$(SNAPSHOTDIR)/$(OS)-build_$(OS)_amd64/$(BIN))
SNAPSHOT_BIN=$(shell realpath $(shell pwd)/$(SNAPSHOTDIR)/$(OS)-build_$(OS)_amd64_v1/$(BIN))
## Variable assertions
@ -109,7 +109,7 @@ bootstrap-tools: $(TEMPDIR)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TEMPDIR)/ v1.47.2
curl -sSfL https://raw.githubusercontent.com/wagoodman/go-bouncer/master/bouncer.sh | sh -s -- -b $(TEMPDIR)/ v0.3.0
curl -sSfL https://raw.githubusercontent.com/anchore/chronicle/main/install.sh | sh -s -- -b $(TEMPDIR)/ v0.3.0
.github/scripts/goreleaser-install.sh -d -b $(TEMPDIR)/ v1.4.1
.github/scripts/goreleaser-install.sh -d -b $(TEMPDIR)/ v1.10.3
GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/neilpa/yajsv@v1.4.0
GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/sigstore/cosign/cmd/cosign@v1.10.0

View File

@ -222,10 +222,16 @@ func getSyftBinaryLocation(t testing.TB) string {
}
func getSyftBinaryLocationByOS(t testing.TB, goOS string) string {
// note: for amd64 we need to update the snapshot location with the v1 suffix
// see : https://goreleaser.com/customization/build/#why-is-there-a-_v1-suffix-on-amd64-builds
archPath := runtime.GOARCH
if runtime.GOARCH == "amd64" {
archPath = fmt.Sprintf("%s_v1", archPath)
}
// note: there is a subtle - vs _ difference between these versions
switch goOS {
case "darwin", "linux":
return path.Join(repoRoot(t), fmt.Sprintf("snapshot/%s-build_%s_%s/syft", goOS, goOS, runtime.GOARCH))
return path.Join(repoRoot(t), fmt.Sprintf("snapshot/%s-build_%s_%s/syft", goOS, goOS, archPath))
default:
t.Fatalf("unsupported OS: %s", runtime.GOOS)
}

View File

@ -39,7 +39,7 @@ else
fi
# run syft
SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64/syft"
SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64_v1/syft"
chmod 755 "${SYFT_PATH}"
"${SYFT_PATH}" version
SYFT_CHECK_FOR_APP_UPDATE=0 "${SYFT_PATH}" packages docker-archive:${TEST_IMAGE_TAR} -vv -o json > "${REPORT}"

View File

@ -26,6 +26,12 @@ test_positive_snapshot_install_asset() {
expected_path="${install_dir}/${binary}"
assertFileExists "${expected_path}" "install_asset os=${os} arch=${arch} format=${format}"
# directory structure for arch has been updated as of go 1.18
# https://goreleaser.com/customization/build/#why-is-there-a-_v1-suffix-on-amd64-buildsjk
if [ $arch == "amd64" ]; then
arch="amd64_v1"
fi
assertFilesEqual \
"$(snapshot_dir)/${os}-build_${os}_${arch}/${binary}" \
"${expected_path}" \