mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
bump goreleaser to v1.10.3 (#1123)
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
d1729ee7e2
commit
62897fbc89
4
Makefile
4
Makefile
@ -32,7 +32,7 @@ BOOTSTRAP_CACHE="c7afb99ad"
|
|||||||
DISTDIR=./dist
|
DISTDIR=./dist
|
||||||
SNAPSHOTDIR=./snapshot
|
SNAPSHOTDIR=./snapshot
|
||||||
OS=$(shell uname | tr '[:upper:]' '[:lower:]')
|
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
|
## 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/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/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
|
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/neilpa/yajsv@v1.4.0
|
||||||
GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/sigstore/cosign/cmd/cosign@v1.10.0
|
GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/sigstore/cosign/cmd/cosign@v1.10.0
|
||||||
|
|
||||||
|
|||||||
@ -222,10 +222,16 @@ func getSyftBinaryLocation(t testing.TB) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSyftBinaryLocationByOS(t testing.TB, goOS string) 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
|
// note: there is a subtle - vs _ difference between these versions
|
||||||
switch goOS {
|
switch goOS {
|
||||||
case "darwin", "linux":
|
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:
|
default:
|
||||||
t.Fatalf("unsupported OS: %s", runtime.GOOS)
|
t.Fatalf("unsupported OS: %s", runtime.GOOS)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# run syft
|
# run syft
|
||||||
SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64/syft"
|
SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64_v1/syft"
|
||||||
chmod 755 "${SYFT_PATH}"
|
chmod 755 "${SYFT_PATH}"
|
||||||
"${SYFT_PATH}" version
|
"${SYFT_PATH}" version
|
||||||
SYFT_CHECK_FOR_APP_UPDATE=0 "${SYFT_PATH}" packages docker-archive:${TEST_IMAGE_TAR} -vv -o json > "${REPORT}"
|
SYFT_CHECK_FOR_APP_UPDATE=0 "${SYFT_PATH}" packages docker-archive:${TEST_IMAGE_TAR} -vv -o json > "${REPORT}"
|
||||||
|
|||||||
@ -53,4 +53,4 @@ ${ACC_DIR}/compare.py \
|
|||||||
${GOLDEN_REPORT} \
|
${GOLDEN_REPORT} \
|
||||||
${REPORT} | tee ${RESULTSDIR}/acceptance-${TEST_TYPE}.txt
|
${REPORT} | tee ${RESULTSDIR}/acceptance-${TEST_TYPE}.txt
|
||||||
|
|
||||||
EXIT_CODE=0
|
EXIT_CODE=0
|
||||||
|
|||||||
@ -26,6 +26,12 @@ test_positive_snapshot_install_asset() {
|
|||||||
expected_path="${install_dir}/${binary}"
|
expected_path="${install_dir}/${binary}"
|
||||||
assertFileExists "${expected_path}" "install_asset os=${os} arch=${arch} format=${format}"
|
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 \
|
assertFilesEqual \
|
||||||
"$(snapshot_dir)/${os}-build_${os}_${arch}/${binary}" \
|
"$(snapshot_dir)/${os}-build_${os}_${arch}/${binary}" \
|
||||||
"${expected_path}" \
|
"${expected_path}" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user