This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch before-release
in repository
https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git
The following commit(s) were added to refs/heads/before-release by this push:
new c9a4d7e2 feat: support release apache package by script
c9a4d7e2 is described below
commit c9a4d7e2e8ef58773208d1081840e951160182dc
Author: imbajin <[email protected]>
AuthorDate: Sun Dec 4 22:31:15 2022 +0800
feat: support release apache package by script
---
.gitignore | 5 +-
hugegraph-dist/scripts/apache-release.sh | 89 ++++++++++++++++++++++++++++++++
2 files changed, 91 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1fbbb5aa..4b93b6e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,6 @@ node_modules
upload-files/
demo*
gen-java
-build
### STS ###
.apt_generated
@@ -32,9 +31,9 @@ build
### NetBeans ###
/nbproject/private/
/nbbuild/
-/dist/
/nbdist/
/.nb-gradle/
+dist/
build/
### VS Code ###
@@ -80,7 +79,7 @@ output/
*.war
*.zip
*.tar
-*.tar.gz
+*.tar.gz*
tree.txt
*.versionsBackup
.flattened-pom.xml
diff --git a/hugegraph-dist/scripts/apache-release.sh
b/hugegraph-dist/scripts/apache-release.sh
new file mode 100755
index 00000000..c4342da6
--- /dev/null
+++ b/hugegraph-dist/scripts/apache-release.sh
@@ -0,0 +1,89 @@
+#!/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}-toolchain"
+# 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
+git archive --format=tar.gz \
+
--output="dist/apache-${repo}/apache-${repo}-${release_version}-incubating-src.tar.gz"
\
+ --prefix=apache-${repo}-"${release_version}"-incubating-src/ "${git_branch}"
|| 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
${group}-dist/target/apache-${repo}-"${release_version}"-incubating-bin.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" && gpg --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"
+ gpg --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
+svn_dir="${group}-svn-dev"
+cd ../
+rm -rfv ${svn_dir}
+
+svn co "https://dist.apache.org/repos/dist/dev/incubator/${group}" ${svn_dir}
+mkdir -p ${svn_dir}/"${release_version}"
+cp -v apache-${repo}/*tar.gz* "${svn_dir}/${release_version}"
+cd ${svn_dir} || exit
+
+# check status first
+svn status
+svn add "${release_version}"
+# 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! "