github.com/rohankumardubey/nomad@v0.11.8/scripts/release/Makefile.linux (about) 1 2 NOMAD_VERSION = 0.9.0-dev 3 4 NOMAD_MAIN_VERSION := $(shell echo $(NOMAD_VERSION) | cut -d- -f1) 5 NOMAD_PRERELEASE_VERSION := $(shell echo $(NOMAD_VERSION) | sed 's|^[^-]*-\{0,1\}||g' ) 6 7 update_version: 8 @echo "updating version to $(NOMAD_MAIN_VERSION)-$(NOMAD_PRERELEASE_VERSION)" 9 @sed -i.bak -e 's|\(Version * = *"\)[^"]*|\1$(NOMAD_MAIN_VERSION)|g' version/version.go 10 @sed -i.bak -e 's|\(VersionPrerelease * = *"\)[^"]*|\1$(NOMAD_PRERELEASE_VERSION)|g' version/version.go 11 @rm -rf version/version.go.bak 12 13 PRERELEASE_TARGET = prerelease 14 RELEASE_TARGET = release 15 16 build_releases: 17 @echo "======>> installing dependencies" 18 $(MAKE) deps 19 20 @echo "======>> pre-releasing" 21 $(MAKE) $(PRERELEASE_TARGET) 22 23 @echo "======>> committing generated files" 24 git add -A . 25 # skip comitting files if there are no generated files 26 # if prerelease process was a no-op 27 if ! git diff-index --quiet HEAD --; \ 28 then \ 29 git commit --author 'Nomad Release bot <nomad@hashicorp.com>' \ 30 --message "Generate files for $(NOMAD_VERSION) release"; \ 31 fi 32 33 @echo "======>> building release artifacts" 34 $(MAKE) $(RELEASE_TARGET)