Skip to content

Commit

Permalink
Use release-it hook to supply version number to make.
Browse files Browse the repository at this point in the history
release-it afterBump will create .version file and this will be used by
make for current version number.
  • Loading branch information
sohoffice committed May 23, 2019
1 parent a74a892 commit d5cd1df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
dist
tmp
/piaasconfig.yml
.version
6 changes: 5 additions & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"git": {
"tagName": "v${version}"
},
"scripts": {
"afterBump": "echo 'VERSION=${version}' > .version && make release",
"afterRelease": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
"github": {
"release": true,
"assets": ["dist/piaas"]
"assets": ["dist/**/piaas-*.zip"]
}
}
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include .version
export

# Go parameters
PROJECT_NAME=PIAAS
VERSION=v0.0.4
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
Expand Down Expand Up @@ -48,6 +50,8 @@ build-windows:
chmod a+x dist/windows_amd64/$(BINARY_NAME).exe
@echo " Built windows-amd64"

# Publish new release
publish: tests$(TESTMODE) build-all
release-it
# Create a new release for publish
release: clean tests$(TESTMODE) build-all
cd dist/darwin_amd64 && zip piaas-darwin-amd64-$(VERSION).zip * && cd ..
cd dist/linux_amd64 && zip piaas-linux-amd64-$(VERSION).zip * && cd ..
cd dist/windows_amd64 && zip piaas-windows-amd64-$(VERSION).zip * && cd ..

0 comments on commit d5cd1df

Please sign in to comment.