From 8781f1b37453cec01b2ced65d539ea69fdf5c424 Mon Sep 17 00:00:00 2001 From: imbajin Date: Wed, 7 Dec 2022 20:40:57 +0800 Subject: [PATCH 1/2] chore: apache release --- .gitattributes | 14 +++ .gitignore | 7 +- .licenserc.yaml | 1 + BUILDING.md | 7 +- build.sh | 24 ----- .../apache/hugegraph/api/graph/VertexAPI.java | 4 +- hugegraph-dist/pom.xml | 2 +- hugegraph-dist/scripts/apache-release.sh | 95 +++++++++++++++++++ hugegraph-style.xml | 2 + pom.xml | 79 +++++++++------ 10 files changed, 173 insertions(+), 62 deletions(-) create mode 100755 .gitattributes delete mode 100644 build.sh create mode 100755 hugegraph-dist/scripts/apache-release.sh diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000000..e66a894fb1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# ignored file when package to source.tgz +.gitattributes export-ignore +.gitignore export-ignore +.asf.yaml export-ignore +checkstyle.xml export-ignore +apache-release.sh export-ignore +.licenserc.yaml export-ignore +.editorconfig export-ignore + +# ignored directory +.github/ export-ignore +hugegraph-dist/scripts/ export-ignore +style/ export-ignore +#assembly/ export-ignore diff --git a/.gitignore b/.gitignore index 782c85270f..47bbf40170 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ node_modules upload-files/ demo* gen-java -build *.class ### STS ### @@ -29,9 +28,9 @@ build ### NetBeans ### /nbproject/private/ /nbbuild/ -/dist/ /nbdist/ /.nb-gradle/ +dist/ build/ ### VS Code ### @@ -57,15 +56,17 @@ build/ *.pyc # maven ignore +apache-hugegraph-incubating-*/ output/ *.war *.zip *.tar -*.tar.gz +*.tar.gz* tree.txt *.versionsBackup .flattened-pom.xml + # eclipse ignore .settings/ diff --git a/.licenserc.yaml b/.licenserc.yaml index 953dad4f02..e79935c6fd 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -53,6 +53,7 @@ header: # `header` section is configurations for source codes license header. paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye. - '.gitignore' + - '.gitattributes' - 'LICENSE' - '**/*.versionsBackup' - '**/*.versionsBackup' diff --git a/BUILDING.md b/BUILDING.md index 3ac025a691..d99dda447c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -3,7 +3,7 @@ Building hugegraph Required: -* Java 8 (0.9 and later) +* Java 8/11 * Maven To build without executing tests: @@ -38,8 +38,7 @@ To build without executing tests: 1. Click on "File" -> "Open", choose your project location. 2. Open maven view by click "View" -> "Tool Windows" -> "Maven Projects". -3. Choose root module "hugegraph: Distributed Graph Database", unfold the -menu of "Lifecycle". +3. Choose root module "hugegraph: Distributed Graph Database", unfold the menu of "Lifecycle". 4. Click the "Toggle 'Skip Tests' Mode" button which is located on the top navibar of "Maven Projects" window to skip tests. -5. Double click "package" or "install" to build project. \ No newline at end of file +5. Double click "package" or "install" to build project. diff --git a/build.sh b/build.sh deleted file mode 100644 index 43191e263a..0000000000 --- a/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -export MAVEN_HOME=/home/scmtools/buildkit/maven/apache-maven-3.3.9/ -export JAVA_HOME=/home/scmtools/buildkit/java/jdk1.8.0_25/ -export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH - -mvn clean compile - diff --git a/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java b/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java index cb4854a85e..333cc74827 100644 --- a/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java +++ b/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java @@ -127,8 +127,8 @@ public String create(@Context HugeConfig config, /** * Batch update steps like: - * 1. Get all newVertices' ID & combine first - * 2. Get all oldVertices & update + * 1. Get all newVertices' ID & combine first + * 2. Get all oldVertices & update * 3. Add the final vertex together */ @PUT diff --git a/hugegraph-dist/pom.xml b/hugegraph-dist/pom.xml index 91a63e51d6..0de86248e6 100644 --- a/hugegraph-dist/pom.xml +++ b/hugegraph-dist/pom.xml @@ -178,7 +178,7 @@ - diff --git a/hugegraph-dist/scripts/apache-release.sh b/hugegraph-dist/scripts/apache-release.sh new file mode 100755 index 0000000000..db61d25d6e --- /dev/null +++ b/hugegraph-dist/scripts/apache-release.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# + +GROUP="hugegraph" +# current repository name +REPO="${GROUP}" +# release version (input by committer) +RELEASE_VERSION=$1 +# git release branch (check it carefully) +GIT_BRANCH="release-${RELEASE_VERSION}" + +RELEASE_VERSION=${RELEASE_VERSION:?"Please input the release version behind script"} + +WORK_DIR=$(cd "$(dirname "$0")" || exit; pwd) +cd "${WORK_DIR}" || exit +echo "In the work dir: $(pwd)" + +# clean old dir then build a new one +rm -rfv dist && mkdir -p dist/apache-${REPO} + +# step1: package the source code +cd ../../ +git archive --format=tar.gz \ + --output="hugegraph-dist/scripts/dist/apache-${REPO}/apache-${REPO}-incubating-${RELEASE_VERSION}-src.tar.gz" \ + --prefix=apache-${REPO}-"${RELEASE_VERSION}"-incubating-src/ "${GIT_BRANCH}" || exit +cd - || exit + +# step2: copy the binary file (Optional) +# Note: it's optional for project to generate binary package (skip this step if not need) +cp -v ../../apache-${REPO}-incubating-"${RELEASE_VERSION}".tar.gz \ + dist/apache-${REPO} || exit + +# step3: sign + hash +##### 3.1 sign in source & binary package +gpg --version 1>/dev/null || exit +cd ./dist/apache-${REPO} || exit +for i in *.tar.gz; do + echo "$i" && eval gpg "${GPG_OPT}" --armor --output "$i".asc --detach-sig "$i" +done + +##### 3.2 Generate SHA512 file +shasum --version 1>/dev/null || exit +for i in *.tar.gz; do + echo "$i" && shasum -a 512 "$i" >"$i".sha512 +done + +#### 3.3 check signature & sha512 +for i in *.tar.gz; do + echo "$i" + eval gpg "${GPG_OPT}" --verify "$i".asc "$i" || exit +done + +for i in *.tar.gz; do + echo "$i" + shasum -a 512 --check "$i".sha512 || exit +done + +# step4: upload to Apache-SVN +##### 4.1 download apache-SVN +SVN_DIR="${GROUP}-svn-dev" +cd ../ +rm -rfv ${SVN_DIR} + +svn co "https://dist.apache.org/repos/dist/dev/incubator/${GROUP}" ${SVN_DIR} + +##### 4.2 copy new release package to svn directory +mkdir -p ${SVN_DIR}/"${RELEASE_VERSION}" +cp -v apache-${REPO}/*tar.gz* "${SVN_DIR}/${RELEASE_VERSION}" +cd ${SVN_DIR} || exit + +##### 4.3 commit to svn +# check status first +svn status +svn add --parents ${RELEASE_VERSION}/apache-${REPO}-* +## check status again +svn status +## commit & push files +svn commit -m "submit files for ${REPO} ${RELEASE_VERSION}" + +echo "Finished all, please check all steps in script manually again!" diff --git a/hugegraph-style.xml b/hugegraph-style.xml index 440486babc..8536d5154c 100644 --- a/hugegraph-style.xml +++ b/hugegraph-style.xml @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. --> + + + org.apache.maven.plugins maven-clean-plugin @@ -377,7 +379,7 @@ *.tar *.tar.gz - *.zip + .flattened-pom.xml ${final.name}/** false