You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2022/06/02 04:36:48 UTC
[skywalking-banyandb] branch release created (now da72cee)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch release
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
at da72cee Build binary from sources package
This branch includes the following new commits:
new da72cee Build binary from sources package
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[skywalking-banyandb] 01/01: Build binary from sources package
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit da72cee2c86938d4bcaaf971069cc81aceaf0766
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Thu Jun 2 04:36:17 2022 +0000
Build binary from sources package
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
Makefile | 9 +++++--
docs/release.md | 2 +-
scripts/build/build.mk | 6 +++++
scripts/release.sh | 65 +++++++++++++++++++++++++++-----------------------
4 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/Makefile b/Makefile
index 6251aa2..c4c9326 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,11 @@ mk_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mk_dir := $(dir $(mk_path))
tool_bin := $(mk_dir)bin
+ifneq (,$(wildcard $(mk_dir).env))
+include $(mk_dir).env
+export
+endif
+
PROJECTS := banyand
##@ Build targets
@@ -145,7 +150,7 @@ include scripts/build/help.mk
RELEASE_SCRIPTS := $(mk_dir)/scripts/release.sh
-release-binary: release ## Package binary archive
+release-binary: release-source ## Package binary archive
${RELEASE_SCRIPTS} -b
release-source: clean ## Package source archive
@@ -155,7 +160,7 @@ release-sign: ## Sign artifacts
${RELEASE_SCRIPTS} -k bin
${RELEASE_SCRIPTS} -k src
-release-assembly: release-binary release-source release-sign ## Generate release package
+release-assembly: release-binary release-sign ## Generate release package
.PHONY: all $(PROJECTS) clean build release test test-race test-coverage lint default check format license-check license-fix pre-commit nuke
diff --git a/docs/release.md b/docs/release.md
index 9603320..d538672 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -75,7 +75,7 @@ Keys to verify the Release Candidate :
Guide to build the release from source :
- * https://github.com/apache/skywalking-banyandb/blob/v$VERSION/docs/release.md
+ * https://github.com/apache/skywalking-banyandb/blob/v$VERSION/docs/installation.md
Voting will start now and will remain open for at least 72 hours, all PMC members are required to give their votes.
diff --git a/scripts/build/build.mk b/scripts/build/build.mk
index 79bbe66..6ddbafd 100644
--- a/scripts/build/build.mk
+++ b/scripts/build/build.mk
@@ -33,8 +33,14 @@ SOURCE_DIR := $(if $(SUB_DIR),$(SUB_DIR)/$(NAME),$(NAME))
# Retrieve git versioning details so we can add to our binary assets
VERSION_PATH := github.com/apache/skywalking-banyandb/pkg/version
+ifdef RELEASE_VERSION
+VERSION_STRING := $(RELEASE_VERSION)
+GIT_BRANCH_NAME := release
+else
VERSION_STRING := $(shell git describe --tags --long $(shell git rev-list --tags --max-count=1))
GIT_BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD)
+endif
+
GO_LINK_VERSION := -X ${VERSION_PATH}.build=${VERSION_STRING}-${GIT_BRANCH_NAME}
##@ Build targets
diff --git a/scripts/release.sh b/scripts/release.sh
index 0f52e67..5696165 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -20,46 +20,51 @@ set -ex
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ROOTDIR=${SCRIPTDIR}/..
BUILDDIR=${ROOTDIR}/build
-BANYAND_BUILDDIR=${ROOTDIR}/banyand/build
RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
RELEASE_VERSION=${RELEASE_TAG#"v"}
+SOURCE_FILE=${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-src.tgz
+
binary(){
- pushd ${ROOTDIR}
- bindir=${BUILDDIR}/binary
- rm -rf ${bindir}
- mkdir -p ${bindir}
+ if [ ! -f "${SOURCE_FILE}" ]; then
+ echo "$FILE exists."
+ exit 1
+ fi
+ tmpdir=`mktemp -d`
+ trap "rm -rf ${tmpdir}" EXIT
+ pushd ${tmpdir}
+ tar -xvf ${SOURCE_FILE}
+ make release
+ bindir=./build
# Copy relevant files
- cp -Rfv ${BANYAND_BUILDDIR}/bin ${bindir}
- cp -Rfv ${ROOTDIR}/CHANGES.md ${bindir}
- cp -Rfv ${ROOTDIR}/README.md ${bindir}
- cp -Rfv ${ROOTDIR}/dist/* ${bindir}
+ cp -Rfv ./banyand/build ${bindir}
+ cp -Rfv ./CHANGES.md ${bindir}
+ cp -Rfv ./README.md ${bindir}
+ cp -Rfv ./dist/* ${bindir}
# Package
tar -czf ${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-bin.tgz -C ${bindir} .
- rm -rf ${bindir}
popd
}
source(){
# Package
- rm -rf ${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-src.tgz
+ mkdir -p ${BUILDDIR}
+ rm -rf ${SOURCE_FILE}
pushd ${ROOTDIR}
+ echo "RELEASE_VERSION=${RELEASE_VERSION}" >> .env
tar \
- --exclude=".DS_Store" \
- --exclude=".git" \
- --exclude=".github" \
- --exclude=".gitignore" \
- --exclude=".asf.yaml" \
- --exclude=".idea" \
- --exclude=".vscode" \
- --exclude="bin" \
- --exclude="banyand/build/bin" \
- --exclude="build" \
- --exclude="*.test" \
- --exclude="*.out" \
- -czf ${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-src.tgz \
- .
+ --exclude=".DS_Store" \
+ --exclude=".git" \
+ --exclude=".github" \
+ --exclude=".gitignore" \
+ --exclude=".asf.yaml" \
+ --exclude=".idea" \
+ --exclude=".vscode" \
+ --exclude="./build" \
+ --exclude="bin" \
+ -czf ${SOURCE_FILE} \
+ .
popd
}
@@ -67,8 +72,8 @@ sign(){
type=$1
pushd ${BUILDDIR}
gpg --batch --yes --armor --detach-sig skywalking-banyandb-${RELEASE_VERSION}-${type}.tgz
- shasum -a 512 skywalking-banyandb-${RELEASE_VERSION}-${type}.tgz > skywalking-banyandb-${RELEASE_VERSION}-${type}.tgz.sha512
- popd
+ shasum -a 512 skywalking-banyandb-${RELEASE_VERSION}-${type}.tgz > skywalking-banyandb-${RELEASE_VERSION}-${type}.tgz.sha512
+ popd
}
parseCmdLine(){
@@ -86,7 +91,7 @@ parseCmdLine(){
\?) usage ;;
esac
done
- return 0
+ return 0
}
@@ -101,7 +106,7 @@ Parameters:
-s Assemble the source package
-h Show this help.
EOF
-exit 1
+ exit 1
}
#
@@ -113,4 +118,4 @@ ret=0
parseCmdLine "$@"
ret=$?
[ $ret -ne 0 ] && exit $ret
-echo "Done release [RELEASE_VERSION] (exit $ret)"
+echo "Done release ${RELEASE_VERSION} (exit $ret)"