Skip to content

Commit

Permalink
Merge branch 'format-push' into format-pull-fetch-discover
Browse files Browse the repository at this point in the history
  • Loading branch information
qweeah committed Jan 25, 2024
2 parents e9879a4 + 4cc5bd0 commit d929bf0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ builds:
goos:
- darwin
- linux
- freebsd
- windows
goarch:
- amd64
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite/command/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d929bf0

Please sign in to comment.