From 1295d480a2186bb478668630f9ede1dd96b25f7c Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Fri, 28 Jun 2024 10:42:42 +0200 Subject: [PATCH] GoRelease attempt --- .github/goreleaser.yaml | 268 +++++++++++++-------------- .github/workflows/release-binary.yml | 11 +- 2 files changed, 140 insertions(+), 139 deletions(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index 889b86e..03099e5 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -14,9 +14,9 @@ builds: - linux - darwin goarch: - - amd64 + # - amd64 - arm64 - - arm + # - arm goarm: - 6 - 7 @@ -31,136 +31,136 @@ archives: - LICENSE - README.md -signs: - - cmd: cosign - env: - - COSIGN_EXPERIMENTAL=1 - certificate: '${artifact}.pem' - args: - - sign-blob - - '--output-certificate=${certificate}' - - '--output-signature=${signature}' - - '${artifact}' - - "--yes" # needed on cosign 2.0.0+ - artifacts: checksum - output: true - -dockers: - # https://goreleaser.com/customization/docker/ - - use: buildx - dockerfile: Dockerfile.release - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64" - build_flag_templates: - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - extra_files: - - scripts - - use: buildx - dockerfile: Dockerfile.release - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - extra_files: - - scripts - - use: buildx - dockerfile: Dockerfile.release - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6" - build_flag_templates: - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - extra_files: - - scripts - - use: buildx - dockerfile: Dockerfile.release - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7" - build_flag_templates: - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - extra_files: - - scripts - -docker_manifests: - # https://goreleaser.com/customization/docker_manifest/ - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:latest - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7 - -docker_signs: - - cmd: cosign - env: - - COSIGN_EXPERIMENTAL=1 - artifacts: images - output: true - args: - - 'sign' - - '${artifact}' - - "--yes" # needed on cosign 2.0.0+ - -checksum: - name_template: 'checksums.txt' - -changelog: - sort: asc - -source: - enabled: true - -sboms: - - artifacts: archive - - id: source # Two different sbom configurations need two different IDs - artifacts: source - -release: - draft: true - replace_existing_draft: true - prerelease: true - footer: | - ### Container Images - - https://ghcr.io/gnolang/{{ .ProjectName }}:{{ .Tag }} - - For example: - ``` - docker pull ghcr.io/gnolang/{{ .ProjectName }}:{{ .Tag }} - ``` +# signs: +# - cmd: cosign +# env: +# - COSIGN_EXPERIMENTAL=1 +# certificate: '${artifact}.pem' +# args: +# - sign-blob +# - '--output-certificate=${certificate}' +# - '--output-signature=${signature}' +# - '${artifact}' +# - "--yes" # needed on cosign 2.0.0+ +# artifacts: checksum +# output: true + +# dockers: +# # https://goreleaser.com/customization/docker/ +# - use: buildx +# dockerfile: Dockerfile.release +# goos: linux +# goarch: amd64 +# image_templates: +# - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" +# - "ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64" +# build_flag_templates: +# - "--platform=linux/amd64" +# - "--label=org.opencontainers.image.created={{.Date}}" +# - "--label=org.opencontainers.image.title={{.ProjectName}}" +# - "--label=org.opencontainers.image.revision={{.FullCommit}}" +# - "--label=org.opencontainers.image.version={{.Version}}" +# extra_files: +# - scripts +# - use: buildx +# dockerfile: Dockerfile.release +# goos: linux +# goarch: arm64 +# image_templates: +# - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" +# - "ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8" +# build_flag_templates: +# - "--platform=linux/arm64/v8" +# - "--label=org.opencontainers.image.created={{.Date}}" +# - "--label=org.opencontainers.image.title={{.ProjectName}}" +# - "--label=org.opencontainers.image.revision={{.FullCommit}}" +# - "--label=org.opencontainers.image.version={{.Version}}" +# extra_files: +# - scripts +# - use: buildx +# dockerfile: Dockerfile.release +# goos: linux +# goarch: arm +# goarm: 6 +# image_templates: +# - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" +# - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6" +# build_flag_templates: +# - "--platform=linux/arm/v6" +# - "--label=org.opencontainers.image.created={{.Date}}" +# - "--label=org.opencontainers.image.title={{.ProjectName}}" +# - "--label=org.opencontainers.image.revision={{.FullCommit}}" +# - "--label=org.opencontainers.image.version={{.Version}}" +# extra_files: +# - scripts +# - use: buildx +# dockerfile: Dockerfile.release +# goos: linux +# goarch: arm +# goarm: 7 +# image_templates: +# - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" +# - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7" +# build_flag_templates: +# - "--platform=linux/arm/v7" +# - "--label=org.opencontainers.image.created={{.Date}}" +# - "--label=org.opencontainers.image.title={{.ProjectName}}" +# - "--label=org.opencontainers.image.revision={{.FullCommit}}" +# - "--label=org.opencontainers.image.version={{.Version}}" +# extra_files: +# - scripts + +# docker_manifests: +# # https://goreleaser.com/customization/docker_manifest/ +# - name_template: ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }} +# image_templates: +# - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64 +# - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8 +# - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6 +# - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7 +# - name_template: ghcr.io/gnolang/{{ .ProjectName }}:latest +# image_templates: +# - ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64 +# - ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8 +# - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6 +# - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7 + +# docker_signs: +# - cmd: cosign +# env: +# - COSIGN_EXPERIMENTAL=1 +# artifacts: images +# output: true +# args: +# - 'sign' +# - '${artifact}' +# - "--yes" # needed on cosign 2.0.0+ + +# checksum: +# name_template: 'checksums.txt' + +# changelog: +# sort: asc + +# source: +# enabled: true + +# sboms: +# - artifacts: archive +# - id: source # Two different sbom configurations need two different IDs +# artifacts: source + +# release: +# draft: true +# replace_existing_draft: true +# prerelease: true +# footer: | +# ### Container Images + +# https://ghcr.io/gnolang/{{ .ProjectName }}:{{ .Tag }} + +# For example: +# ``` +# docker pull ghcr.io/gnolang/{{ .ProjectName }}:{{ .Tag }} +# ``` diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index abb403e..a6d09b9 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -7,8 +7,8 @@ permissions: on: push: - tags: - - "v*" + # tags: + # - "v*" jobs: binary: @@ -21,7 +21,7 @@ jobs: - uses: sigstore/cosign-installer@v3.5.0 - uses: anchore/sbom-action/download-syft@v0.16.0 - + - name: Checkout uses: actions/checkout@v4 with: @@ -32,8 +32,9 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up QEMU + + # build Multi-platform docker images + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Run GoReleaser