diff --git a/.github/workflows/base-ci-goreleaser.yaml b/.github/workflows/base-ci-goreleaser.yaml index 81f1368e..f18dae23 100644 --- a/.github/workflows/base-ci-goreleaser.yaml +++ b/.github/workflows/base-ci-goreleaser.yaml @@ -14,7 +14,7 @@ on: type: string env: - GORELEASER_PRO_VERSION: v2.4.1 + GORELEASER_PRO_VERSION: v2.4.7 jobs: check-goreleaser: @@ -60,7 +60,7 @@ jobs: uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser-pro - version: v2.3.2 + version: ${{ env.GORELEASER_PRO_VERSION }} workdir: distributions/${{ inputs.distribution }} args: --snapshot --clean --skip=sign,sbom --timeout 2h --split env: diff --git a/.github/workflows/base-release.yaml b/.github/workflows/base-release.yaml index d7f97695..d7a0bffd 100644 --- a/.github/workflows/base-release.yaml +++ b/.github/workflows/base-release.yaml @@ -14,7 +14,7 @@ on: type: string env: - GORELEASER_PRO_VERSION: v2.4.1 + GORELEASER_PRO_VERSION: v2.4.7 jobs: prepare: @@ -77,7 +77,7 @@ jobs: uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser-pro - version: v2.3.2 + version: ${{ env.GORELEASER_PRO_VERSION }} workdir: distributions/${{ inputs.distribution }} args: release --clean --split --timeout 2h env: @@ -152,7 +152,7 @@ jobs: uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser-pro - version: v2.3.2 + version: ${{ env.GORELEASER_PRO_VERSION }} workdir: distributions/${{ inputs.distribution }} args: continue --merge --timeout 2h env: diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index 2c28bb78..f3d08c0c 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -29,6 +29,7 @@ import ( const ( ArmArch = "arm" + Arm64Arch = "arm64" CoreDistro = "otelcol" ImageName = "axoflow-otel-collector" ) @@ -36,6 +37,7 @@ const ( var ( ImagePrefixes = []string{"ghcr.io/axoflow/axoflow-otel-collector"} Architectures = []string{"amd64", "arm64"} + Arm64Versions = []string{"v8.0"} Goos = []string{"linux", "windows"} DefaultConfigDists = map[string]bool{ImageName: true} MSIWindowsDists = map[string]bool{ImageName: true} @@ -88,8 +90,9 @@ func Build(dist string) config.Build { Flags: []string{"-trimpath"}, Ldflags: []string{"-s", "-w"}, }, - Goos: Goos, - Goarch: Architectures, + Goos: Goos, + Goarch: Architectures, + Goarm64: Arm64Versions, Ignore: []config.IgnoredBuild{ {Goos: "windows", Goarch: "arm64"}, }, @@ -194,7 +197,14 @@ func Package(dist string) config.NFPM { func DockerImages(dist string) []config.Docker { r := make([]config.Docker, 0) for _, arch := range Architectures { - r = append(r, DockerImage(dist, arch, "")) + switch arch { + case Arm64Arch: + for _, vers := range Arm64Versions { + r = append(r, DockerImage(dist, arch, vers)) + } + default: + r = append(r, DockerImage(dist, arch, "")) + } } return r } @@ -203,9 +213,13 @@ func DockerImages(dist string) []config.Docker { // https://goreleaser.com/customization/docker/ func DockerImage(dist, arch, armVersion string) config.Docker { dockerArchName := archName(arch, armVersion) + dockerArchTag := dockerArchName imageTemplates := make([]string, 0) for _, prefix := range ImagePrefixes { - dockerArchTag := strings.ReplaceAll(dockerArchName, "/", "") + switch arch { + case Arm64Arch: + dockerArchTag = strings.ReplaceAll(dockerArchName, "/", "_") + } imageTemplates = append( imageTemplates, fmt.Sprintf("%s/%s:{{ .Version }}-%s", prefix, imageName(dist), dockerArchTag), @@ -256,10 +270,21 @@ func DockerManifests(dist string) []config.DockerManifest { func DockerManifest(prefix, version, dist string) config.DockerManifest { var imageTemplates []string for _, arch := range Architectures { - imageTemplates = append( - imageTemplates, - fmt.Sprintf("%s/%s:%s-%s", prefix, imageName(dist), version, arch), - ) + switch arch { + case Arm64Arch: + for _, arm64Vers := range Arm64Versions { + dockerArchTag := strings.ReplaceAll(archName(arch, arm64Vers), "/", "_") + imageTemplates = append( + imageTemplates, + fmt.Sprintf("%s/%s:%s-%s", prefix, imageName(dist), version, dockerArchTag), + ) + } + default: + imageTemplates = append( + imageTemplates, + fmt.Sprintf("%s/%s:%s-%s", prefix, imageName(dist), version, arch), + ) + } } return config.DockerManifest{ @@ -278,6 +303,8 @@ func archName(arch, armVersion string) string { switch arch { case ArmArch: return fmt.Sprintf("%s/v%s", arch, armVersion) + case Arm64Arch: + return fmt.Sprintf("%s/%s", arch, armVersion) default: return arch } diff --git a/distributions/axoflow-otel-collector/.goreleaser.yaml b/distributions/axoflow-otel-collector/.goreleaser.yaml index b83b6508..d965f1b6 100644 --- a/distributions/axoflow-otel-collector/.goreleaser.yaml +++ b/distributions/axoflow-otel-collector/.goreleaser.yaml @@ -18,6 +18,8 @@ builds: goarch: - amd64 - arm64 + goarm64: + - v8.0 ignore: - goos: windows goarch: arm64 @@ -86,15 +88,16 @@ dockers: use: buildx - goos: linux goarch: arm64 + goarm: v8.0 dockerfile: Dockerfile image_templates: - - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-arm64 - - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-arm64 + - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-arm64_v8.0 + - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-arm64_v8.0 extra_files: - config.yaml build_flag_templates: - --pull - - --platform=linux/arm64 + - --platform=linux/arm64/v8.0 - --label=org.opencontainers.image.created={{.Date}} - --label=org.opencontainers.image.name={{.ProjectName}} - --label=org.opencontainers.image.revision={{.FullCommit}} @@ -106,11 +109,11 @@ docker_manifests: - name_template: ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }} image_templates: - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-amd64 - - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-arm64 + - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-arm64_v8.0 - name_template: ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest image_templates: - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-amd64 - - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-arm64 + - ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-arm64_v8.0 signs: - cmd: cosign args: