Skip to content
Snippets Groups Projects
Verified Commit 80415d68 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

release and publish to npm

Bump version to 2.0.14
fix makefile and publishing
parent c304545c
No related branches found
No related tags found
No related merge requests found
Showing
with 448 additions and 71 deletions
#############################################################################################
#############################################################################################
##
## REQMAN
##
#############################################################################################
#############################################################################################
REQMAN_BIN ?= $(VENDOR_PATH)reqman
#############################################################################################
#############################################################################################
##
## ADD SPDX LICENSES
##
## For commercial projects, it is not necessary to add the SPDX license identifier.
## The license header in each file is only for open-source projects, for example under
## the AGPL 3.0 license.
##
#############################################################################################
#############################################################################################
ifeq ($(ADDLICENSE_BIN),)
$(error "addlicense is not installed. Please check your makefile and include the licenses.mk")
endif
.PHONY: add-licenses
## Add license headers to all go files
add-licenses:
$(ECHOMARKER) "Add license headers to all sourche files"
ifeq ($(LICENSE_FILE_PATTERN),)
$(error "LICENSE_FILE_PATTERN is not set. Please check your makefile and include the licenses.mk")
endif
ifndef SPDX_LICENSE_ID
$(error "SPDX_LICENSE_ID is not defined. Please check your makefile and include the licenses.mk")
endif
$(QUIET) $(ADDLICENSE_BIN) -c "$(COPYRIGHT_OWNER)" -s -l "$(SPDX_LICENSE_ID)" $(LICENSE_FILE_PATTERN)
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## SERVER CONAN
##
#############################################################################################
#############################################################################################
ifeq ($(CONAN_BIN),)
$(error $(ERRORMARKER) Conan is not defined, check your Makefile if conan.mk is included)
endif
$(CONAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(CONAN_BIN) http://download.schukai.com/tools/conan/conan-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(CONAN_BIN)
.PHONY: run-conan
## run conan webserver
run-conan: $(CONAN_BIN) $(CONAN_CONFIG)
$(QUIET) $(CONAN_BIN) server serve --config $(CONAN_CONFIG)
...@@ -18,3 +18,5 @@ deploy: compile ...@@ -18,3 +18,5 @@ deploy: compile
## overview-to-s3 ## overview-to-s3
overview-to-s3: overview-to-s3:
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL) $(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.css $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.js $(UPLOAD_TOOL_URL)
\ No newline at end of file
...@@ -7,13 +7,20 @@ ...@@ -7,13 +7,20 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
ifeq ($(DOCMAN_BIN),)
$(error "$(DOCMAN_BIN) is not installed. Please check your makefile and include the docman.mk")
endif
$(DOCMAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(DOCMAN_BIN) http://download.schukai.com/tools/docman/docman-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(DOCMAN_BIN)
$(PROJECT_ROOT)deployment/build/manual.html: ~/.local/bin/docman $(PROJECT_ROOT)deployment/build/manual.html: $(DOCMAN_BIN)
docman document html --config $(PROJECT_ROOT)documentation/config.yaml $(DOCMAN_BIN) document html --config $(PROJECT_ROOT)documentation/config.yaml
$(PROJECT_ROOT)deployment/build/manual.pdf: ~/.local/bin/docman $(PROJECT_ROOT)deployment/build/manual.pdf: $(DOCMAN_BIN)
docman document pdf --config $(PROJECT_ROOT)documentation/config.yaml $(DOCMAN_BIN) document pdf --config $(PROJECT_ROOT)documentation/config.yaml
.PHONY: build-doc-pdf .PHONY: build-doc-pdf
## creating the documentation in pdf format ## creating the documentation in pdf format
...@@ -29,11 +36,3 @@ build-doc-html: $(PROJECT_ROOT)deployment/build/manual.html ...@@ -29,11 +36,3 @@ build-doc-html: $(PROJECT_ROOT)deployment/build/manual.html
build-doc: build-doc-pdf build-doc-html build-doc: build-doc-pdf build-doc-html
~/.local/bin/docman:
wget -O ~/.local/bin/docman https://download.schukai.com/tools/docman/docman-linux-amd64
chmod u+x ~/.local/bin/docman
.PHONY: install-docman
install-docman: ~/.local/bin/docman
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
EXECUTABLES = $(EXECUTABLES:-) uuidgen ifeq ($(GIT),)
$(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
endif
## Current Branch-GIT_TAG ## Current Branch-GIT_TAG
GIT_TAG := - GIT_TAG := -
...@@ -17,7 +19,6 @@ GIT_MESSAGE := current status ...@@ -17,7 +19,6 @@ GIT_MESSAGE := current status
.PHONY: git-branch .PHONY: git-branch
## create new branch (use GIT_TAG-Variable) ## create new branch (use GIT_TAG-Variable)
git-branch: git-branch:
$(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \ $(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \
$(QUIET) $(GIT) checkout -b $${BRANCH} && \ $(QUIET) $(GIT) checkout -b $${BRANCH} && \
RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \ RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \
...@@ -45,3 +46,13 @@ git-push: git-branch git-push-to-server ...@@ -45,3 +46,13 @@ git-push: git-branch git-push-to-server
## git create version tag ## git create version tag
git-tag: git-tag:
$(QUIET) $(GIT) tag -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)" $(QUIET) $(GIT) tag -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)"
.PHONY: git-prune-remote
## removes your local remote tracking branches where the branch no longer exists on the remote
git-prune-remote:
$(QUIET) $(GIT) remote prune origin
.PHONY: git-prune-local
## deletes local merged branches except the master branch
git-prune-local:
$(QUIET) $(GIT) branch --merged master | grep -v '^[ *]*master$$' | xargs git branch -d
\ No newline at end of file
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_RELEASE_PACKAGE_NAME ?= main
.PHONY: compile .PHONY: compile
## Compiling for every OS and Platform ## Compiling for every OS and Platform
compile: next-patch-version compile: next-patch-version
...@@ -14,9 +20,9 @@ compile: next-patch-version ...@@ -14,9 +20,9 @@ compile: next-patch-version
$(ECHO) "Build: $(PROJECT_BUILD_DATE)" $(ECHO) "Build: $(PROJECT_BUILD_DATE)"
$(QUIET) cd $(SOURCE_PATH) ; \ $(QUIET) cd $(SOURCE_PATH) ; \
GO111MODULE=on GOOS=linux GOARCH=arm $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm ; \ GO111MODULE=on GOOS=linux GOARCH=arm $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm ; \
GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-amd64 ; \ GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-amd64 ; \
GOOS=linux GOARCH=arm64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm64 ; \ GOOS=linux GOARCH=arm64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm64 ; \
GOOS=linux GOARCH=386 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-386 ; \ GOOS=linux GOARCH=386 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-386 ; \
GOOS=windows GOARCH=amd64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-windows ; \ GOOS=windows GOARCH=amd64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-windows ; \
cd $(PROJECT_ROOT); cd $(PROJECT_ROOT);
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_MOD_FILE := $(SOURCE_PATH)go.mod GO_MOD_FILE := $(SOURCE_PATH)go.mod
ifeq ($(shell test -e $(GO_MOD_FILE) && echo -n yes),yes) ifeq ($(shell test -e $(GO_MOD_FILE) && echo -n yes),yes)
...@@ -21,6 +25,6 @@ ifeq ($(GO_CURRENT_MODULE),) ...@@ -21,6 +25,6 @@ ifeq ($(GO_CURRENT_MODULE),)
$(QUIET) $(ECHOERRORMARKER) "no go.mod file found, skipping fetching licenses" $(QUIET) $(ECHOERRORMARKER) "no go.mod file found, skipping fetching licenses"
else else
$(ECHOMARKER) "Fetch licenses" $(ECHOMARKER) "Fetch licenses"
$(QUIET) cd $(SOURCE_PATH); go-licenses save $(GO_CURRENT_MODULE) $(GO_LICENSES_IGNORE_PACKAGES) --force --save_path $(DOCUMENTATION_PATH)licenses/ ; cd - $(QUIET) cd $(SOURCE_PATH); $(GO_LICENSES_BIN) save $(GO_CURRENT_MODULE) $(GO_LICENSES_IGNORE_PACKAGES) --force --save_path $(DOCUMENTATION_PATH)licenses/ ; cd -
endif endif
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
## ##
## INIT-TARGETS ## INIT-STANDARD
## ##
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
...@@ -9,12 +9,41 @@ ...@@ -9,12 +9,41 @@
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets # @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-standard .PHONY: init-standard
## init standard project
init-standard: .gitignore
# The default directories are defined in the # The default directories are defined in the
# directories-standard.mk file, but all other # directories-standard.mk file, but all other
# targets can define directories as well. # targets can define directories as well.
$(ECHOMARKER) "Run init-standard"
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\ $(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path))) $(shell $(MKDIR) -p $(path)))
## init standard project
init-standard: $(PROJECT_DIRECTORIES) .gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-standard"
$(ECHO) "Done" $(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUITE) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUITE) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## INIT-WEBCOMPONENTS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-webcomponent
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init standard project
init-webcomponent: $(PROJECT_DIRECTORIES) .gitignore $(DEVELOPMENT_PATH)package.json $(APPLICATION_PATH)package.json $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE $(APPLICATION_PATH)LICENSE
$(ECHOMARKER) "Run init-webcomponent"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUITE) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
export LICENSE_AGPL_FILE_CONTENT
$(APPLICATION_PATH)LICENSE:
$(QUITE) $(ECHO) "$$LICENSE_AGPL_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUITE) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## PACKAGE JSON
##
#############################################################################################
#############################################################################################
define WEBCOMPONENTS_PACKAGE_CONTENT
{
"name": "component-$(COMPONENT_SLUG)",
"version": "0.1.0",
"description": "component $(COMPONENT_NAME)",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"keywords": [
"web",
"dom",
"css",
"mobile-first",
"app",
"front-end",
"ui",
"form",
"templates",
"schukai",
"component",
"web-component",
"monster"
],
"dependencies": {
"@popperjs/core": "^2.9.2",
"@schukai/monster": "^2.0.8"
},
"main": "source/component.mjs",
"module": "source/component.mjs",
"type": "module",
"homepage": "https://monsterjs.org/",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"author": "schukai GmbH",
"license": "AGPL 3.0"
}
endef
export WEBCOMPONENTS_PACKAGE_CONTENT
$(APPLICATION_PATH)package.json:
$(QUITE) $(ECHO) "$$WEBCOMPONENTS_PACKAGE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## BUILD PACKAGE JSON
##
#############################################################################################
#############################################################################################
define WEBCOMPONENTS_BUILD_PACKAGE_CONTENT
{
"name": "component-$(COMPONENT_SLUG)",
"version": "0.1.0",
"description": "component $(COMPONENT_NAME)",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"scripts": {
"test": "npx mocha --recursive test/cases/",
"web-test": "script/web-test.sh",
"publish": "script/release-and-publish.sh",
"build-doc": "script/build-doc.sh"
},
"type": "module",
"author": "schukai GmbH",
"license": "see LICENSE file",
"dependencies": {
"@popperjs/core": "^2.11.2",
"@schukai/monster": "^2.0.8"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.0",
"btoa": "^1.2.1",
"c8": "^7.12.0",
"chai": "^4.3.6",
"chai-dom": "^1.11.0",
"clean-jsdoc-theme": "^4.1.6",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"esbuild": "^0.14.53",
"flow-bin": "^0.184.0",
"fs": "^0.0.1-security",
"graphviz": "^0.0.9",
"jsdoc": "^3.6.11",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdoc-plantuml": "^1.0.2",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.0.0",
"node-plantuml": "^0.9.0",
"sinon": "^14.0.0",
"url": "^0.11.0",
"url-exist": "3.0.0",
"util": "^0.12.4"
}
}
endef
export WEBCOMPONENTS_BUILD_PACKAGE_CONTENT
$(DEVELOPMENT_PATH)package.json:
$(QUITE) $(ECHO) "$$WEBCOMPONENTS_BUILD_PACKAGE_CONTENT" >> $@
######
...@@ -17,8 +17,7 @@ node-build: $(NODE_MODULES_MODIFIED) $(NODE_PACKAGES) ...@@ -17,8 +17,7 @@ node-build: $(NODE_MODULES_MODIFIED) $(NODE_PACKAGES)
$(ECHO) "Version: $(PROJECT_VERSION)" $(ECHO) "Version: $(PROJECT_VERSION)"
$(ECHO) "Source Path: $(SOURCE_PATH)" $(ECHO) "Source Path: $(SOURCE_PATH)"
$(QUIET) $(JQ) '.version = "$(PROJECT_VERSION)"' $(PACKAGE_JSON) | $(SPONGE) $(PACKAGE_JSON) $(QUIET) $(JQ) '.version = "$(PROJECT_VERSION)"' $(PACKAGE_JSON) | $(SPONGE) $(PACKAGE_JSON)
$(QUIET) for p in $(NODE_PACKAGES); do \ $(QUIET) for p in $(NODE_PACKAGES); do $(JQ) '.version = "$(PROJECT_VERSION)"' $${p} | $(SPONGE) $${p}; done
$(JQ) '.version = "$(PROJECT_VERSION)"' $${p} | $(SPONGE) $${p}; \ $(QUIET) $(SCRIPTS_PATH)update-version.sh
done ; \
...@@ -8,25 +8,28 @@ ...@@ -8,25 +8,28 @@
.PHONY: npm-publish-major .PHONY: npm-publish-major
## release major version of package ## release major version of package
npm-publish-major: node-test npm-publish-major:
$(ECHOMARKER) "release major version" $(ECHOMARKER) "release major version"
$(QUIET) $(MAKE) next-major-version $(QUIET) $(MAKE) next-major-version
$(QUIET) $(MAKE) node-build $(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish $(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
.PHONY: npm-publish-minor .PHONY: npm-publish-minor
## release minor version of package ## release minor version of package
npm-publish-minor: node-test npm-publish-minor:
$(ECHOMARKER) "release minor version" $(ECHOMARKER) "release minor version"
$(QUIET) $(MAKE) next-minor-version $(QUIET) $(MAKE) next-minor-version
$(QUIET) $(MAKE) node-build $(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish $(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
.PHONY: npm-publish-patch .PHONY: npm-publish-patch
## release patch version of package ## release patch version of package
npm-publish-patch: node-test npm-publish-patch:
$(ECHOMARKER) "release patch version" $(ECHOMARKER) "release patch version"
$(QUIET) $(MAKE) next-patch-version $(QUIET) $(MAKE) next-patch-version
$(QUIET) $(MAKE) node-build $(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish $(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
#############################################################################################
#############################################################################################
##
## REQMAN-TARGETS
##
#############################################################################################
#############################################################################################
# @TODO not working, check if this is a bug in this definition!!!
ifeq ($(REQMAN_BIN),)
$(error "$(REQMAN_BIN) is not installed. Please check your makefile and include the reqman.mk")
endif
$(REQMAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(REQMAN_BIN) http://download.schukai.com/tools/reqman/reqman-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(REQMAN_BIN)
$(PROJECT_ROOT)deployment/build/manual.html: $(DOCMAN_BIN)
$(REQMAN_BIN) print html --config $(PROJECT_ROOT)requirement/config.yaml
$(PROJECT_ROOT)deployment/build/manual.pdf: $(DOCMAN_BIN)
$(REQMAN_BIN) print pdf --config $(PROJECT_ROOT)requirement/config.yaml
.PHONY: build-req-pdf
## creating the requirement in pdf format
build-req-pdf: $(PROJECT_ROOT)deployment/build/requirement.pdf
.PHONY: build-req-html
## creating the requirement in html format
build-req-html: $(PROJECT_ROOT)deployment/build/requirement.html
.PHONY: build-req
## creating the requirement in pdf and html format
build-req: build-req-pdf build-req-html
...@@ -6,14 +6,24 @@ ...@@ -6,14 +6,24 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
ifeq ($(GIT),)
$(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
endif
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets # @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: update-makefiles .PHONY: update-makefiles
ifeq ($(QUIET),)
_COPYVERBOSE = -v
endif
## update standard makefiles ## update standard makefiles
update-makefiles: update-makefiles:
$(ECHOMARKER) "update standard makefiles"
$(QUIET) $(eval TEMPD := $(shell mktemp -d)) $(QUIET) $(eval TEMPD := $(shell mktemp -d))
$(QUIET) $(GIT) clone --depth=1 https://gitlab.schukai.com/schukai/utilities/makefile.git/ "$(TEMPD)" > /dev/null $(QUIET) $(GIT) clone --quiet --depth=1 https://gitlab.schukai.com/schukai/utilities/makefile.git/ "$(TEMPD)"
$(QUIET) $(CP) -rv $(TEMPD)/makefiles/* $(MAKEFILE_IMPORT_PATH) $(QUIET) $(CP) -r $(_COPYVERBOSE) $(TEMPD)/makefiles/* $(MAKEFILE_IMPORT_PATH)
$(QUIET) $(CP) -r $(_COPYVERBOSE) $(TEMPD)/Makefile $(PROJECT_ROOT)Makefile.example
$(QUIET) $(RM) -rf $(TEMPD) $(QUIET) $(RM) -rf $(TEMPD)
......
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
.PHONY: variables .PHONY: variables
## Print all variables ## Print all variables
variables: variables:
@$(foreach v, $(.VARIABLES), $(if $(filter file,$(origin $(v))), $(info $(INFO)$(v)$(RESET)=$($(v))$(RESET)))) $(ECHOMARKER) "print all variables"
\ No newline at end of file $(QUIET) $(foreach v, $(.VARIABLES), $(if $(filter file,$(origin $(v))), $(info $(INFO)$(v)$(RESET)=$($(v))$(RESET))))
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## VARIABLES-TARGETS
##
#############################################################################################
#############################################################################################
ifeq ($(VERSION_BIN),)
$(error "$(VERSION_BIN) is not installed. Please check your makefile and include the version.mk")
endif
ifeq ($(GIT),)
$(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
endif
ifeq ($(GIT_CHGLOG_BIN),)
$(error $(ERRORMARKER) Chglog is not defined, check your Makefile if changelog.mk is included)
endif
$(VERSION_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(VERSION_BIN) http://download.schukai.com/tools/version/version-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(VERSION_BIN)
.PHONY: next-patch-version
next-patch-version: check-clean-repo $(VERSION_BIN)
$(ECHOMARKER) "Creating next version"
$(QUIET) $(VERSION_BIN) patch --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(GIT) add $(RELEASE_FILE) && $(GIT) commit -m "Bump version to $$(cat $(RELEASE_FILE) | jq -r .version)"
.PHONY: next-minor-version
next-minor-version: check-clean-repo $(VERSION_BIN)
$(ECHOMARKER) "Creating next minor version"
$(QUIET) $(VERSION_BIN) minor --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(GIT) add $(RELEASE_FILE) && $(GIT) commit -m "Bump version to $$( cat $(RELEASE_FILE) | jq -r .version)"
.PHONY: next-major-version
next-major-version: check-clean-repo $(VERSION_BIN)
$(ECHOMARKER) "Creating next minor version"
$(QUIET) $(VERSION_BIN) major --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(GIT) add $(RELEASE_FILE) && $(GIT) commit -m "Bump version to $$(cat $(RELEASE_FILE) | jq -r .version)"
.PHONY: check-clean-repo
check-clean-repo:
$(QUIET) $(GIT) diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1)
## tag repository with next patch version
tag-patch-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-patch-version
$(ECHOMARKER) "Tagging patch version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
$(QUIET) $(GIT) add $(CHANGELOG_FILE) && $(GIT) commit -m "Update changelog"
$(QUIET) $(GIT) tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
## tag repository with next minor version
tag-minor-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-patch-version next-minor-version
$(ECHOMARKER) "Tagging minor version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
$(QUIET) $(GIT) add $(CHANGELOG_FILE) && $(GIT) commit -m "Update changelog"
$(QUIET) $(GIT) tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
## tag repository with next major version
tag-major-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-patch-version next-major-version
$(ECHOMARKER) "Tagging major version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
$(QUIET) $(GIT) add $(CHANGELOG_FILE) && $(GIT) commit -m "Update changelog"
$(QUIET) $(GIT) tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
...@@ -28,15 +28,13 @@ RSYNC ?= rsync ...@@ -28,15 +28,13 @@ RSYNC ?= rsync
XARGS ?= xargs XARGS ?= xargs
GREP ?= grep GREP ?= grep
MAKE ?= make MAKE ?= make
GIT ?= git
LN ?= ln LN ?= ln
TOUCH ?= touch TOUCH ?= touch
TEST ?= test TEST ?= test
JQ ?= jq JQ ?= jq
EXECUTABLES = $(EXECUTABLES:-) $(JQ) $(AWK) $(CP) $(KILL) $(MV) $(SED) $(FIND) $(SORT) $(TOUCH) $(WGET) $(CHMOD) $(RSYNC) $(XARGS) $(GREP) $(MAKE) $(LN)
EXECUTABLES = $(EXECUTABLES:-) $(JQ) $(AWK) $(CP) $(KILL) $(MV) $(SED) $(FIND) $(SORT) $(TOUCH) $(WGET) $(CHMOD) $(RSYNC) $(XARGS) $(GREP) $(MAKE) $(GIT)
\ No newline at end of file
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
VERSION_BIN := version VERSION_BIN ?= $(VENDOR_PATH)version
EXECUTABLES = $(EXECUTABLES:-) $(VERSION_BIN)
RELEASE_FILE ?= $(PROJECT_ROOT)release.json RELEASE_FILE ?= $(PROJECT_ROOT)release.json
ifeq ("$(wildcard $(RELEASE_FILE))","") ifeq ("$(wildcard $(RELEASE_FILE))","")
...@@ -17,24 +15,3 @@ endif ...@@ -17,24 +15,3 @@ endif
PROJECT_VERSION ?= $(shell cat $(RELEASE_FILE) | jq -r .version) PROJECT_VERSION ?= $(shell cat $(RELEASE_FILE) | jq -r .version)
PROJECT_BUILD_DATE ?= $(shell $(VERSION_BIN) date) PROJECT_BUILD_DATE ?= $(shell $(VERSION_BIN) date)
.PHONY: next-patch-version
## create next patch version
next-patch-version:
$(ECHOMARKER) "Creating next version"
$(QUIET) $(VERSION_BIN) patch --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
.PHONY: next-minor-version
## create next minor version
next-minor-version:
$(ECHOMARKER) "Creating next minor version"
$(QUIET) $(VERSION_BIN) minor --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
.PHONY: next-major-version
## create next major version
next-major-version:
$(ECHOMARKER) "Creating next minor version"
$(QUIET) $(VERSION_BIN) major --path $(RELEASE_FILE) --selector "version"
$(QUIET) $(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
{ {
"name": "monster", "name": "monster",
"version": "2.0.8", "version": "2.0.14",
"description": "monster", "description": "monster",
"repository": { "repository": {
"type": "git", "type": "git",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment