diff --git a/.goreleaser.yml b/.goreleaser.yml index f3f8d6be7..40bee8674 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -72,7 +72,7 @@ builds: - -trimpath mod_timestamp: '{{ .CommitTimestamp }}' ldflags: - - "{{ .Env.CLIENT_LDFLAGS }}" + - "{{ .Env.CLI_LDFLAGS }}" signs: - id: rekor diff --git a/Makefile b/Makefile index bbab4ef03..56e869968 100644 --- a/Makefile +++ b/Makefile @@ -30,23 +30,10 @@ RUNTIME_IMAGE ?= gcr.io/distroless/static # Set version variables for LDFLAGS GIT_VERSION ?= $(shell git describe --tags --always --dirty) GIT_HASH ?= $(shell git rev-parse HEAD) -GIT_TAG ?= dirty-tag -DATE_FMT = +%Y-%m-%dT%H:%M:%SZ -SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) -ifdef SOURCE_DATE_EPOCH - BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") -else - BUILD_DATE ?= $(shell date "$(DATE_FMT)") -endif -GIT_TREESTATE = "clean" -DIFF = $(shell git diff --quiet >/dev/null 2>&1; if [ $$? -eq 1 ]; then echo "1"; fi) -ifeq ($(DIFF), 1) - GIT_TREESTATE = "dirty" -endif KO_PREFIX ?= gcr.io/projectsigstore export KO_DOCKER_REPO=$(KO_PREFIX) -REKOR_YAML ?= rekor-$(GIT_TAG).yaml +REKOR_YAML ?= rekor-$(GIT_VERSION).yaml GHCR_PREFIX ?= ghcr.io/sigstore/rekor GOBIN ?= $(shell go env GOPATH)/bin @@ -54,10 +41,7 @@ GOBIN ?= $(shell go env GOPATH)/bin SWAGGER := $(TOOLS_BIN_DIR)/swagger GO-FUZZ-BUILD := $(TOOLS_BIN_DIR)/go-fuzz-build -REKOR_LDFLAGS=-X sigs.k8s.io/release-utils/version.gitVersion=$(GIT_VERSION) \ - -X sigs.k8s.io/release-utils/version.gitCommit=$(GIT_HASH) \ - -X sigs.k8s.io/release-utils/version.gitTreeState=$(GIT_TREESTATE) \ - -X sigs.k8s.io/release-utils/version.buildDate=$(BUILD_DATE) +REKOR_LDFLAGS=-X sigs.k8s.io/release-utils/version.gitVersion=$(GIT_VERSION) CLI_LDFLAGS=$(REKOR_LDFLAGS) SERVER_LDFLAGS=$(REKOR_LDFLAGS) @@ -69,7 +53,6 @@ Makefile.swagger: $(SWAGGER) $(OPENAPIDEPS) @echo "# This file is generated after swagger runs as part of the build; do not edit!" > Makefile.swagger @echo "SWAGGER_GEN=`find pkg/generated/client pkg/generated/models/ pkg/generated/restapi/ -iname '*.go' | grep -v 'configure_rekor_server' | sort -d | tr '\n' ' ' | sed 's/ $$//'`" >> Makefile.swagger; - lint: $(GOBIN)/golangci-lint run -v ./... diff --git a/release/cloudbuild.yaml b/release/cloudbuild.yaml index 2fc4c1258..2837eda11 100644 --- a/release/cloudbuild.yaml +++ b/release/cloudbuild.yaml @@ -32,7 +32,7 @@ steps: echo "Checking out ${_GIT_TAG}" git checkout ${_GIT_TAG} -- name: 'gcr.io/projectsigstore/cosign:v1.8.0@sha256:12b4d428529654c95a7550a936cbb5c6fe93a046ea7454676cb6fb0ce566d78c' +- name: 'gcr.io/projectsigstore/cosign:v1.9.0@sha256:ef2d14e16dbb7786d8713e4898a8512e69ace4105f5b371a9c115ffcc3e85d84' dir: "go/src/sigstore/rekor" env: - COSIGN_EXPERIMENTAL=true diff --git a/release/release.mk b/release/release.mk index ab343bb5e..19dc18209 100644 --- a/release/release.mk +++ b/release/release.mk @@ -5,12 +5,12 @@ # used when releasing together with GCP CloudBuild .PHONY: release release: - CLIENT_LDFLAGS="$(CLI_LDFLAGS)" SERVER_LDFLAGS="$(SERVER_LDFLAGS)" goreleaser release --rm-dist --timeout 60m + CLI_LDFLAGS="$(CLI_LDFLAGS)" SERVER_LDFLAGS="$(SERVER_LDFLAGS)" goreleaser release --rm-dist --timeout 60m # used when need to validate the goreleaser .PHONY: snapshot snapshot: - CLIENT_LDFLAGS="$(CLI_LDFLAGS)" SERVER_LDFLAGS="$(SERVER_LDFLAGS)" goreleaser release --skip-sign --skip-publish --snapshot --rm-dist + CLI_LDFLAGS="$(CLI_LDFLAGS)" SERVER_LDFLAGS="$(SERVER_LDFLAGS)" goreleaser release --skip-sign --skip-publish --snapshot --rm-dist ########################### # sign section