diff --git a/.gitignore b/.gitignore index 978ea61..ff171e0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ dist tmp /piaasconfig.yml +.version diff --git a/.release-it.json b/.release-it.json index 9a51700..3c7c4c2 100644 --- a/.release-it.json +++ b/.release-it.json @@ -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"] } } diff --git a/Makefile b/Makefile index c53bcce..7ab665a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ +include .version +export + # Go parameters PROJECT_NAME=PIAAS -VERSION=v0.0.4 GOCMD=go GOBUILD=$(GOCMD) build GOCLEAN=$(GOCMD) clean @@ -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 ..