diff --git a/.goreleaser.yml b/.goreleaser.yml index 3bb03d4bd..c85806537 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,6 +24,7 @@ builds: goos: - darwin - linux + - freebsd - windows goarch: - amd64 @@ -35,6 +36,16 @@ builds: goarm: - '7' ignore: + - goos: freebsd + goarch: arm64 + - goos: freebsd + goarch: arm + - goos: freebsd + goarch: ppc64le + - goos: freebsd + goarch: riscv64 + - goos: freebsd + goarch: s390x - goos: windows goarch: arm64 - goos: windows diff --git a/Makefile b/Makefile index 2261cebb0..ca72c5b4b 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null) GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean") GO_EXE = go -TARGET_OBJS ?= checksums.txt darwin_amd64.tar.gz darwin_arm64.tar.gz linux_amd64.tar.gz linux_arm64.tar.gz linux_armv7.tar.gz linux_s390x.tar.gz linux_ppc64le.tar.gz linux_riscv64.tar.gz windows_amd64.zip +TARGET_OBJS ?= checksums.txt darwin_amd64.tar.gz darwin_arm64.tar.gz linux_amd64.tar.gz linux_arm64.tar.gz linux_armv7.tar.gz linux_s390x.tar.gz linux_ppc64le.tar.gz linux_riscv64.tar.gz windows_amd64.zip freebsd_amd64.tar.gz LDFLAGS = -w ifdef VERSION @@ -112,6 +112,14 @@ build-windows-arm64: ## build for windows arm64 GOARCH=arm64 CGO_ENABLED=0 GOOS=windows $(GO_EXE) build -v --ldflags="$(LDFLAGS)" \ -o bin/windows/arm64/$(CLI_EXE).exe $(CLI_PKG) +.PHONY: build-freebsd +build-freebsd: build-freebsd-amd64 ## build all freebsd architectures + +.PHONY: build-freebsd-amd64 +build-freebsd-amd64: ## build for freebsd amd64 + GOARCH=amd64 CGO_ENABLED=0 GOOS=freebsd $(GO_EXE) build -v --ldflags="$(LDFLAGS)" \ + -o bin/freebsd/amd64/$(CLI_EXE) $(CLI_PKG) + .PHONY: check-encoding check-encoding: ## check file CR/LF encoding ! find cmd internal -name "*.go" -type f -exec file "{}" ";" | grep CRLF diff --git a/test/e2e/suite/command/attach.go b/test/e2e/suite/command/attach.go index 3fece16c2..1b4523876 100644 --- a/test/e2e/suite/command/attach.go +++ b/test/e2e/suite/command/attach.go @@ -127,8 +127,8 @@ var _ = Describe("1.1 registry users:", func() { subjectRef := RegistryRef(ZOTHost, testRepo, foobar.Tag) CopyZOTRepo(ImageRepo, testRepo) // test - delimitter := "|" - output := ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia), "--export-manifest", exportName, "--format", fmt.Sprintf("{{.Ref%s.ArtifactType}}", delimitter)). + delimitter := "---" + output := ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia), "--export-manifest", exportName, "--format", fmt.Sprintf("{{.Ref}}%s{{.ArtifactType}}", delimitter)). WithWorkDir(tempDir).Exec().Out.Contents() ref, artifactType, _ := strings.Cut(string(output), delimitter) // validate