Skip to content
Closed

fix #633

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .goreleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM gcr.io/distroless/static:nonroot
COPY fga /fga
ARG TARGETPLATFORM
COPY ${TARGETPLATFORM}/fga /fga
ENTRYPOINT ["/fga"]
77 changes: 19 additions & 58 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,68 +24,29 @@ builds:
- "-X github.com/openfga/cli/internal/build.Commit={{.Commit}}"
- "-X github.com/openfga/cli/internal/build.Date={{.Date}}"

dockers:
- goos: linux
goarch: amd64

dockerfile: .goreleaser.Dockerfile

image_templates:
- "openfga/cli:latest-amd64"
- "openfga/cli:{{ .Tag }}-amd64"
- "openfga/cli:v{{ .Version }}-amd64"
- "openfga/cli:v{{ .Major }}-amd64"
- "openfga/cli:v{{ .Major }}.{{ .Minor }}-amd64"
- "openfga/cli:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"

use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"

- goos: linux
goarch: arm64

dockers_v2:
- images:
- "openfga/cli"
dockerfile: .goreleaser.Dockerfile

image_templates:
- "openfga/cli:latest-arm64"
- "openfga/cli:{{ .Tag }}-arm64"
- "openfga/cli:v{{ .Version }}-arm64"
- "openfga/cli:v{{ .Major }}-arm64"
- "openfga/cli:v{{ .Major }}.{{ .Minor }}-arm64"
- "openfga/cli:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64"
platforms:
- linux/amd64
- linux/arm64

use: buildx
tags:
- "latest"
- "{{ .Tag }}"
- "v{{ .Version }}"
- "v{{ .Major }}"
- "v{{ .Major }}.{{ .Minor }}"
- "v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
Comment on lines +39 to +42
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tags list includes duplicates when releases are tagged as vX.Y.Z (the workflow triggers only on refs/tags/v*): {{ .Tag }} will equal v{{ .Version }} and also v{{ .Major }}.{{ .Minor }}.{{ .Patch }}. Consider keeping only one of these to avoid redundant/duplicate tag pushes and potential GoReleaser validation errors.

Suggested change
- "v{{ .Version }}"
- "v{{ .Major }}"
- "v{{ .Major }}.{{ .Minor }}"
- "v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "v{{ .Major }}"
- "v{{ .Major }}.{{ .Minor }}"

Copilot uses AI. Check for mistakes.

build_flag_templates:
- "--platform=linux/arm64"
labels:
"org.opencontainers.image.created": "{{.Date}}"
"org.opencontainers.image.title": "{{.ProjectName}}"
"org.opencontainers.image.revision": "{{.FullCommit}}"
"org.opencontainers.image.version": "{{.Version}}"

docker_manifests:
- name_template: openfga/cli:latest
image_templates:
- openfga/cli:latest-amd64
- openfga/cli:latest-arm64
- name_template: openfga/cli:v{{ .Version }}
image_templates:
- openfga/cli:v{{ .Version }}-amd64
- openfga/cli:v{{ .Version }}-arm64
- name_template: openfga/cli:v{{ .Major }}
image_templates:
- openfga/cli:v{{ .Major }}-amd64
- openfga/cli:v{{ .Major }}-arm64
- name_template: openfga/cli:v{{ .Major }}.{{ .Minor }}
image_templates:
- openfga/cli:v{{ .Major }}.{{ .Minor }}-amd64
- openfga/cli:v{{ .Major }}.{{ .Minor }}-arm64
- name_template: openfga/cli:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}
image_templates:
- openfga/cli:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- openfga/cli:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64

release:
github:
Expand Down Expand Up @@ -245,7 +206,7 @@ checksum:
- glob: manpages/*

snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"

report_sizes: true

Expand Down
Loading