feat: provide the function and design scheme of release

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
pull/407/head
Xinwei Xiong(cubxxw) 2 years ago
parent 0a220da80b
commit 920c1f00eb

@ -18,6 +18,7 @@
## copyright.help: Show copyright help ## copyright.help: Show copyright help
.PHONY: go.help .PHONY: go.help
go.help: script/make-rules/golang.mk go.help: script/make-rules/golang.mk

@ -0,0 +1,41 @@
# Copyright © 2023 OpenIMSDK.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Makefile helper functions for release
#
## release: release the project
.PHONY: release.run
release.run: release.verify release.ensure-tag
@scripts/release.sh
## release.verify: Check if a tool is installed and install it
.PHONY: release.verify
release.verify: tools.verify.git-chglog tools.verify.github-release tools.verify.coscmd
## release.tag: release the project
.PHONY: release.tag
release.tag: tools.verify.gsemver release.ensure-tag
@git push origin `git describe --tags --abbrev=0`
## release.ensure-tag: ensure tag
.PHONY: release.ensure-tag
release.ensure-tag: tools.verify.gsemver
@scripts/ensure_tag.sh
## release.help: Display help information about the release package
.PHONY: release.help
release.help: script/make-rules/release.mk
$(call smallhelp)

@ -25,12 +25,14 @@ ANALYSIS_TOOLS = golangci-lint goimports golines go-callvis kube-score
GENERATION_TOOLS = deepcopy-gen conversion-gen protoc-gen-go cfssl rts codegen GENERATION_TOOLS = deepcopy-gen conversion-gen protoc-gen-go cfssl rts codegen
# Testing tools # Testing tools
TEST_TOOLS = ginkgo go-junit-report gotests TEST_TOOLS = ginkgo go-junit-report gotests
# cos tools
COS_TOOLS = coscli coscmd
# Version control tools # Version control tools
VERSION_CONTROL_TOOLS = addlicense go-gitlint git-chglog github-release gsemver VERSION_CONTROL_TOOLS = addlicense go-gitlint git-chglog github-release gsemver
# Utility tools # Utility tools
UTILITY_TOOLS = go-mod-outdated mockgen gothanks richgo kubeconform UTILITY_TOOLS = go-mod-outdated mockgen gothanks richgo kubeconform
# All tools # All tools
ALL_TOOLS ?= $(ANALYSIS_TOOLS) $(GENERATION_TOOLS) $(TEST_TOOLS) $(VERSION_CONTROL_TOOLS) $(UTILITY_TOOLS) ALL_TOOLS ?= $(ANALYSIS_TOOLS) $(GENERATION_TOOLS) $(TEST_TOOLS) $(VERSION_CONTROL_TOOLS) $(UTILITY_TOOLS) $(COS_TOOLS)
## tools.install: Install a must tools ## tools.install: Install a must tools
.PHONY: tools.install .PHONY: tools.install
@ -129,6 +131,17 @@ install.git-chglog:
install.github-release: install.github-release:
@$(GO) install github.com/github-release/github-release@latest @$(GO) install github.com/github-release/github-release@latest
## install.coscli: Install coscli, used to upload files to cos
.PHONY: install.coscli
install.coscli:
@wget -q https://github.com/tencentyun/coscli/releases/download/v0.10.2-beta/coscli-linux -O ${HOME}/bin/coscli
@chmod +x ${HOME}/bin/coscli
## install.coscmd: Install coscmd, used to upload files to cos
.PHONY: install.coscmd
install.coscmd:
@if which pip &>/dev/null; then pip install coscmd; else pip3 install coscmd; fi
## install.gvm: Install gvm, gvm is a Go version manager, built on top of the official go tool. ## install.gvm: Install gvm, gvm is a Go version manager, built on top of the official go tool.
.PHONY: install.gvm .PHONY: install.gvm
install.gvm: install.gvm:

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#Include shell font styles and some basic information #Include shell font styles and some basic information
source ./style_info.cfg source ./style_info.cfg
source ./path_info.cfg source ./path_info.cfg

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Copyright © 2023 OpenIMSDK.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Makefile helper functions for release
#
# Build a OpenIM release. This will build the binaries, create the Docker
# images and other build artifacts.
Loading…
Cancel
Save