From f14b2a20bf1959718ac796169e3775a7a36776f4 Mon Sep 17 00:00:00 2001 From: Mark Phelps Date: Thu, 19 Apr 2018 09:05:55 -0400 Subject: [PATCH] Verify the tagged version is referenced in the CHANGELOG (#48) --- .dockerignore | 2 -- Makefile | 13 +++++++++++++ codeship-steps.yml | 17 +++++++++++------ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 42b9788..ef28c57 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1,8 @@ -.git/ .gitignore .github/ LICENSE *.txt -*.md *.yml *.png *.jpg diff --git a/Makefile b/Makefile index 3f9caf8..c19331c 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ GOTOOLS = \ github.com/golang/dep/cmd/dep \ GOPACKAGES := $(go list ./... | grep -v /vendor/) +VERSION ?= $(shell git describe --abbrev=0 --tags) +CHANGELOG_VERSION = $(shell perl -ne '/^\#\# (\d+(\.\d+)+) / && print "$$1\n"' CHANGELOG.md | head -n1) .PHONY: setup setup: ## Install all the build and lint dependencies @@ -46,6 +48,17 @@ build: ## Build a version clean: ## Remove temporary files go clean +.PHONY: verify +verify: ## Verify the version is referenced in the CHANGELOG + @if [ "$(VERSION)" = "$(CHANGELOG_VERSION)" ]; then \ + echo "version: $(VERSION)"; \ + else \ + echo "Version number not found in CHANGELOG.md"; \ + echo "version: $(VERSION)"; \ + echo "CHANGELOG: $(CHANGELOG_VERSION)"; \ + exit 1; \ + fi + # Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html .PHONY: help help: diff --git a/codeship-steps.yml b/codeship-steps.yml index fc1737e..77c2cfd 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -1,19 +1,24 @@ - type: parallel name: "multi-version tests" steps: - - service: gov - name: "1.8.6 test" + - name: "1.8.6 test" + service: gov command: gov 1.8.6 test -v - - service: gov - name: "1.9.4 test" + - name: "1.9.4 test" + service: gov command: gov 1.9.4 test -v - name: "tests" service: test command: make ci -- service: integration - name: "integration tests" +- name: "integration tests" + service: integration tag: master command: make integration + +- name: "verify release" + service: test + tag: (\d+(\.\d+)+) + command: make verify