|
|
@ -6,8 +6,6 @@ Q=$(if $V,,@)
|
|
|
|
PREFIX?=
|
|
|
|
PREFIX?=
|
|
|
|
SRC=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
|
|
|
SRC=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
|
|
|
GOOS_OVERRIDE ?=
|
|
|
|
GOOS_OVERRIDE ?=
|
|
|
|
OUTPUT_ROOT=output/
|
|
|
|
|
|
|
|
RELEASE=./.releases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
all: lint test build
|
|
|
|
all: lint test build
|
|
|
|
|
|
|
|
|
|
|
@ -23,6 +21,8 @@ bootstra%:
|
|
|
|
$Q curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin latest
|
|
|
|
$Q curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin latest
|
|
|
|
$Q go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
$Q go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
$Q go install gotest.tools/gotestsum@latest
|
|
|
|
$Q go install gotest.tools/gotestsum@latest
|
|
|
|
|
|
|
|
$Q go install github.com/goreleaser/goreleaser@latest
|
|
|
|
|
|
|
|
$Q go install github.com/sigstore/cosign/v2/cmd/cosign@latest
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: bootstra%
|
|
|
|
.PHONY: bootstra%
|
|
|
|
|
|
|
|
|
|
|
@ -30,17 +30,8 @@ bootstra%:
|
|
|
|
# Determine the type of `push` and `version`
|
|
|
|
# Determine the type of `push` and `version`
|
|
|
|
#################################################
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
|
|
|
|
# If TRAVIS_TAG is set then we know this ref has been tagged.
|
|
|
|
|
|
|
|
ifdef TRAVIS_TAG
|
|
|
|
|
|
|
|
VERSION ?= $(TRAVIS_TAG)
|
|
|
|
|
|
|
|
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
|
|
|
|
|
|
|
|
ifeq ($(NOT_RC),)
|
|
|
|
|
|
|
|
PUSHTYPE := release-candidate
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
PUSHTYPE := release
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# GITHUB Actions
|
|
|
|
# GITHUB Actions
|
|
|
|
else ifdef GITHUB_REF
|
|
|
|
ifdef GITHUB_REF
|
|
|
|
VERSION ?= $(shell echo $(GITHUB_REF) | sed 's/^refs\/tags\///')
|
|
|
|
VERSION ?= $(shell echo $(GITHUB_REF) | sed 's/^refs\/tags\///')
|
|
|
|
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
|
|
|
|
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
|
|
|
|
ifeq ($(NOT_RC),)
|
|
|
|
ifeq ($(NOT_RC),)
|
|
|
@ -53,21 +44,14 @@ VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
|
|
|
|
# If we are not in an active git dir then try reading the version from .VERSION.
|
|
|
|
# If we are not in an active git dir then try reading the version from .VERSION.
|
|
|
|
# .VERSION contains a slug populated by `git archive`.
|
|
|
|
# .VERSION contains a slug populated by `git archive`.
|
|
|
|
VERSION := $(or $(VERSION),$(shell ./.version.sh .VERSION))
|
|
|
|
VERSION := $(or $(VERSION),$(shell ./.version.sh .VERSION))
|
|
|
|
ifeq ($(TRAVIS_BRANCH),master)
|
|
|
|
|
|
|
|
PUSHTYPE := master
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
PUSHTYPE := branch
|
|
|
|
PUSHTYPE := branch
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
VERSION := $(shell echo $(VERSION) | sed 's/^v//')
|
|
|
|
VERSION := $(shell echo $(VERSION) | sed 's/^v//')
|
|
|
|
DEB_VERSION := $(shell echo $(VERSION) | sed 's/-/./g')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ifdef V
|
|
|
|
ifdef V
|
|
|
|
$(info TRAVIS_TAG is $(TRAVIS_TAG))
|
|
|
|
|
|
|
|
$(info GITHUB_REF is $(GITHUB_REF))
|
|
|
|
$(info GITHUB_REF is $(GITHUB_REF))
|
|
|
|
$(info VERSION is $(VERSION))
|
|
|
|
$(info VERSION is $(VERSION))
|
|
|
|
$(info DEB_VERSION is $(DEB_VERSION))
|
|
|
|
|
|
|
|
$(info PUSHTYPE is $(PUSHTYPE))
|
|
|
|
$(info PUSHTYPE is $(PUSHTYPE))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
@ -169,23 +153,3 @@ run:
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
.PHONY: run
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
# Debian
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changelog:
|
|
|
|
|
|
|
|
$Q echo "step-ca ($(DEB_VERSION)) unstable; urgency=medium" > debian/changelog
|
|
|
|
|
|
|
|
$Q echo >> debian/changelog
|
|
|
|
|
|
|
|
$Q echo " * See https://github.com/smallstep/certificates/releases" >> debian/changelog
|
|
|
|
|
|
|
|
$Q echo >> debian/changelog
|
|
|
|
|
|
|
|
$Q echo " -- Smallstep Labs, Inc. <techadmin@smallstep.com> $(shell date -uR)" >> debian/changelog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debian: changelog
|
|
|
|
|
|
|
|
$Q mkdir -p $(RELEASE); \
|
|
|
|
|
|
|
|
OUTPUT=../step-ca*.deb; \
|
|
|
|
|
|
|
|
rm $$OUTPUT; \
|
|
|
|
|
|
|
|
dpkg-buildpackage -b -rfakeroot -us -uc && cp $$OUTPUT $(RELEASE)/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: changelog debian distclean
|
|
|
|
|
|
|
|