Skip to content

Commit

Permalink
push latest tag when building a release (sigstore#1636)
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Mar 20, 2022
1 parent c31e5fe commit f9fe6a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ env:
- CGO_ENABLED=1
- DOCKER_CLI_EXPERIMENTAL=enabled
- COSIGN_EXPERIMENTAL=true
- LATEST_TAG="--tags latest"

# Prevents parallel builds from stepping on each others toes downloading modules
before:
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ KO_PREFIX ?= gcr.io/projectsigstore
export KO_DOCKER_REPO=$(KO_PREFIX)
GHCR_PREFIX ?= ghcr.io/sigstore/cosign
COSIGNED_YAML ?= cosign-$(GIT_TAG).yaml
LATEST_TAG ?=

.PHONY: all lint test clean cosign cross
all: cosign
Expand Down Expand Up @@ -146,20 +147,20 @@ ko:
$(create_kocache_path)
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
KOCACHE=$(KOCACHE_PATH) ko build --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) $(LATEST_TAG)\
$(ARTIFACT_HUB_LABELS) \
github.com/sigstore/cosign/cmd/cosign

# cosigned
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
KO_DOCKER_REPO=$(KO_PREFIX)/cosigned ko resolve --bare \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) $(LATEST_TAG) \
--filename config/ > $(COSIGNED_YAML)

# sget
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
KOCACHE=$(KOCACHE_PATH) ko build --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) $(LATEST_TAG)\
$(ARTIFACT_HUB_LABELS) \
github.com/sigstore/cosign/cmd/sget

Expand Down
1 change: 0 additions & 1 deletion release/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@ copy-sget-signed-release-to-ghcr:

.PHONY: copy-signed-release-to-ghcr
copy-signed-release-to-ghcr: copy-cosign-signed-release-to-ghcr copy-cosigned-signed-release-to-ghcr copy-sget-signed-release-to-ghcr

0 comments on commit f9fe6a4

Please sign in to comment.