From 4e6671f8ed130de6ad0fb59fd5e3f005356c839c Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Mon, 6 Nov 2023 21:47:53 -0800 Subject: [PATCH] use dockers field in goreleaser (#329) --- .github/workflows/release.yml | 6 ++++++ .goreleaser.yml | 20 ++++++++------------ Dockerfile | 6 ++++++ 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e278dfa..145b2b1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,12 @@ jobs: with: cosign-release: 'v2.2.0' # optional - uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3 + - name: Login to GitHub Container Registry + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 with: version: latest diff --git a/.goreleaser.yml b/.goreleaser.yml index 4dcd6ed8..9bd15950 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,18 +17,14 @@ builds: goos: - linux goarch: - - amd64 - -kos: - - repository: ghcr.io/theparanoids/crypki - base_image: cgr.dev/chainguard/busybox - tags: - - '{{.Version}}' - - latest - bare: true - preserve_import_paths: false - platforms: - - linux/amd64 + - amd64 + +dockers: + - image_templates: + - "ghcr.io/theparanoids/{{ .ProjectName }}:latest" + - "ghcr.io/theparanoids/{{ .ProjectName }}:{{ .Version }}" + - "ghcr.io/theparanoids/{{ .ProjectName }}:{{ .ShortCommit }}" + dockerfile: Dockerfile signs: - cmd: cosign diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..64301d86 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +# Copyright 2023 Yahoo Inc. +# Licensed under the terms of the Apache License 2.0. Please see LICENSE file in project root for terms. +FROM cgr.dev/chainguard/busybox:latest +ENTRYPOINT ["/usr/bin/crypki"] +COPY crypki /usr/bin +