diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 2f42b5c6..64c35f42 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -5,15 +5,18 @@ on: tags: - '*' +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + jobs: goreleaser: permissions: - contents: write - runs-on: - - environment=production - - size=xlarge - - provider=ethpandaops - - realm=platform + contents: read + packages: write + runs-on: ubuntu-latest steps: - name: Checkout @@ -63,11 +66,12 @@ jobs: with: endpoint: builders - - name: Login to DockerHub + name: Login to docker registry uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Update GoReleaser config run: | cp .goreleaser.yaml ../.goreleaser.yaml.new @@ -88,3 +92,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_SUFFIX: ${{ env.RELEASE_SUFFIX }} + REGISTRY: ${{ env.REGISTRY }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index adae0f31..47ab13c6 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -23,7 +23,7 @@ builds: ignore: - goarch: 386 ldflags: - - -s -w -X github.com/ethpandaops/checkpointz/pkg/version.Release={{.Tag}} -X github.com/ethpandaops/checkpointz/pkg/version.GitCommit={{.ShortCommit}} + - -s -w -X github.com/gnosischain/checkpointz/pkg/version.Release={{.Tag}} -X github.com/gnosischain/checkpointz/pkg/version.GitCommit={{.ShortCommit}} mod_timestamp: "{{ .CommitTimestamp }}" checksum: name_template: 'checksums.txt' @@ -43,10 +43,8 @@ dockers: goarch: amd64 dockerfile: goreleaser-scratch.Dockerfile image_templates: - - "samcm/{{ .ProjectName }}:{{ .Version }}-amd64" - - "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64" - - "ethpandaops/{{ .ProjectName }}:{{ .Version }}-amd64" - - "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-amd64" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64" build_flag_templates: - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" @@ -58,10 +56,8 @@ dockers: goarch: arm64 dockerfile: goreleaser-scratch.Dockerfile image_templates: - - "samcm/{{ .ProjectName }}:{{ .Version }}-arm64v8" - - "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8" - - "ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64v8" - - "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-arm64v8" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8" build_flag_templates: - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" @@ -74,10 +70,8 @@ dockers: goarch: amd64 dockerfile: goreleaser-debian.Dockerfile image_templates: - - "samcm/{{ .ProjectName }}:{{ .Version }}-debian-amd64" - - "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64" - - "ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-amd64" - - "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-amd64" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64" build_flag_templates: - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" @@ -89,10 +83,8 @@ dockers: goarch: arm64 dockerfile: goreleaser-debian.Dockerfile image_templates: - - "samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8" - - "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8" - - "ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8" - - "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8" + - "ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8" build_flag_templates: - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" @@ -101,50 +93,27 @@ dockers: - "--label=org.opencontainers.image.version={{.Version}}" docker_manifests: ## Scratch - - name_template: samcm/{{ .ProjectName }}:{{ .Version }} + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }} image_templates: - - samcm/{{ .ProjectName }}:{{ .Version }}-amd64 - - samcm/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - name_template: samcm/{{ .ProjectName }}:{{ .Version }}-arm64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-amd64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-arm64v8 + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-arm64 image_templates: - - samcm/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - name_template: samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-arm64v8 + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest image_templates: - - samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64 - - samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8 - - - name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }} - image_templates: - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-amd64 - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64 - image_templates: - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - name_template: ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest - image_templates: - - ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64 - - ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8 ## Debian - - name_template: samcm/{{ .ProjectName }}:{{ .Version }}-debian - image_templates: - - samcm/{{ .ProjectName }}:{{ .Version }}-debian-amd64 - - samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 - - name_template: samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64 - image_templates: - - samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 - - name_template: samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest - image_templates: - - samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64 - - samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8 - - name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian image_templates: - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-amd64 - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 - - name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-amd64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-arm64 image_templates: - - ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 - - name_template: ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8 + - name_template: ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest image_templates: - - ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64 - - ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64 + - ghcr.io/gnosischain/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8