Skip to content

Commit dd1f82e

Browse files
authored
chore: add apache-release.sh & prepare release (#218)
1 parent 593a561 commit dd1f82e

File tree

6 files changed

+167
-29
lines changed

6 files changed

+167
-29
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ignored file when package to source.tgz
2+
.gitattributes export-ignore
3+
.gitignore export-ignore
4+
.asf.yaml export-ignore
5+
checkstyle.xml export-ignore
6+
apache-release.sh export-ignore
7+
.licenserc.yaml export-ignore
8+
9+
# ignored directory
10+
.github/ export-ignore
11+
computer-dist/src/assembly/ export-ignore
12+
computer-k8s-operator/crd-generate/bin/ export-ignore

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ node_modules
66
upload-files/
77
demo*
88
gen-java
9-
build
109
*.class
1110
**/dependency-reduced-pom.xml
1211
dist.sh
13-
*.flattened-pom.xml
1412

1513
### STS ###
1614
.apt_generated
@@ -32,9 +30,9 @@ dist.sh
3230
### NetBeans ###
3331
/nbproject/private/
3432
/nbbuild/
35-
/dist/
3633
/nbdist/
3734
/.nb-gradle/
35+
dist/
3836
build/
3937

4038
### VS Code ###
@@ -61,12 +59,14 @@ build/
6159

6260
# maven ignore
6361
output/
62+
apache-hugegraph-*-incubating-*/
6463
*.war
6564
*.zip
6665
*.tar
67-
*.tar.gz
66+
*.tar.gz*
6867
tree.txt
6968
*.versionsBackup
69+
*.flattened-pom.xml
7070

7171
# eclipse ignore
7272
.settings/

computer-dist/pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@
122122
<copy file="${top.level.dir}/computer-k8s-operator/target/hugegraph-computer-operator-${revision}.jar"
123123
tofile="${top.level.dir}/${final.name}/k8s-operator/hugegraph-computer-operator.jar"
124124
overwrite="true"/>
125-
<tar destfile="${top.level.dir}/${final.name}.tar.gz"
126-
basedir="${top.level.dir}"
127-
includes="${final.name}/**"
128-
compression="gzip"/>
125+
<tar destfile="${top.level.dir}/target/${final.name}.tar.gz"
126+
compression="gzip">
127+
<tarfileset dir="${top.level.dir}" filemode="755">
128+
<include name="${final.name}/**"/>
129+
</tarfileset>
130+
</tar>
129131
</target>
130132
</configuration>
131133
</execution>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
GROUP="hugegraph"
20+
# current repository name
21+
REPO="${GROUP}-computer"
22+
# release version (input by committer)
23+
RELEASE_VERSION=$1
24+
USERNAME=$2
25+
PASSWORD=$3
26+
# git release branch (check it carefully)
27+
GIT_BRANCH="release-${RELEASE_VERSION}"
28+
29+
RELEASE_VERSION=${RELEASE_VERSION:?"Please input the release version behind script"}
30+
31+
WORK_DIR=$(cd "$(dirname "$0")" || exit; pwd)
32+
cd "${WORK_DIR}" || exit
33+
echo "In the work dir: $(pwd)"
34+
35+
# clean old dir then build a new one
36+
rm -rfv dist && mkdir -p dist/apache-${REPO}
37+
38+
# step1: package the source code
39+
cd ../.../ || exit
40+
git archive --format=tar.gz \
41+
--output="computer-dist/scripts/dist/apache-${REPO}/apache-${REPO}-incubating-${RELEASE_VERSION}-src.tar.gz" \
42+
--prefix="apache-${REPO}-incubating-${RELEASE_VERSION}-src/" "${GIT_BRANCH}" || exit
43+
44+
cd - || exit
45+
# step2: copy the binary file (Optional)
46+
# Note: it's optional for project to generate binary package (skip this step if not need)
47+
cp -v ../../target/apache-${REPO}-incubating-"${RELEASE_VERSION}".tar.gz \
48+
dist/apache-${REPO} || exit
49+
50+
# step3: sign + hash
51+
##### 3.1 sign in source & binary package
52+
gpg --version 1>/dev/null || exit
53+
cd ./dist/apache-${REPO} || exit
54+
for i in *.tar.gz; do
55+
echo "$i" && gpg --armor --output "$i".asc --detach-sig "$i"
56+
done
57+
58+
##### 3.2 Generate SHA512 file
59+
shasum --version 1>/dev/null || exit
60+
for i in *.tar.gz; do
61+
echo "$i" && shasum -a 512 "$i" >"$i".sha512
62+
done
63+
64+
#### 3.3 check signature & sha512
65+
for i in *.tar.gz; do
66+
echo "$i"
67+
gpg --verify "$i".asc "$i" || exit
68+
done
69+
70+
for i in *.tar.gz; do
71+
echo "$i"
72+
shasum -a 512 --check "$i".sha512 || exit
73+
done
74+
75+
# step4: upload to Apache-SVN
76+
SVN_DIR="${GROUP}-svn-dev"
77+
cd ../
78+
rm -rfv ${SVN_DIR}
79+
80+
##### 4.1 pull from remote & copy files
81+
svn co "https://dist.apache.org/repos/dist/dev/incubator/${GROUP}" ${SVN_DIR}
82+
mkdir -p ${SVN_DIR}/"${RELEASE_VERSION}"
83+
cp -v apache-${REPO}/*tar.gz* "${SVN_DIR}/${RELEASE_VERSION}"
84+
cd ${SVN_DIR} || exit
85+
86+
##### 4.2 check status first
87+
svn status
88+
svn add --parents "${RELEASE_VERSION}"/apache-${REPO}-*
89+
# check status again
90+
svn status
91+
92+
##### 4.3 commit & push files
93+
if [ "$USERNAME" = "" ]; then
94+
svn commit -m "submit files for ${REPO} ${RELEASE_VERSION}"
95+
else
96+
svn commit -m "submit files for ${REPO} ${RELEASE_VERSION}" --username "${USERNAME}" --password "${PASSWORD}"
97+
fi
98+
99+
echo "Finished all, please check all steps in script manually again!"

computer-k8s/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<target>
117117
<!-- removing the generated Schema class -->
118118
<delete
119-
file="${project.build.directory}/generated-sources/src/gen/java/org/apache/hugegraph/computer/k8s/crd/model/crdSchema.java"
119+
file="${project.build.directory}/generated-sources/src/gen/java/org/apache/hugegraph/computer/k8s/crd/model/CrdSchema.java"
120120
verbose="true" />
121121
<delete
122122
file="${project.build.directory}/generated-sources/src/gen/java/org/apache/hugegraph/computer/k8s/crd/model/EnumSchema.java"

pom.xml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
<artifactId>hugegraph-computer</artifactId>
2929
<version>${revision}</version>
3030
<packaging>pom</packaging>
31-
<prerequisites>
32-
<maven>3.3.9</maven>
33-
</prerequisites>
3431
<name>hugegraph-computer</name>
3532
<url>https://github.com/apache/hugegraph-computer</url>
3633
<description>
@@ -46,12 +43,50 @@
4643
</license>
4744
</licenses>
4845

46+
<developers>
47+
<developer>
48+
<id>Apache Hugegraph(incubating)</id>
49+
<email>dev-subscribe@hugegraph.apache.org</email>
50+
<url>https://hugegraph.apache.org/</url>
51+
</developer>
52+
</developers>
53+
54+
<mailingLists>
55+
<mailingList>
56+
<name>Development List</name>
57+
<subscribe>dev-subscribe@hugegraph.apache.org</subscribe>
58+
<unsubscribe>dev-unsubscribe@hugegraph.apache.org</unsubscribe>
59+
<post>dev@hugegraph.incubator.apache.org</post>
60+
</mailingList>
61+
<mailingList>
62+
<name>Commits List</name>
63+
<subscribe>commits-subscribe@hugegraph.apache.org</subscribe>
64+
<unsubscribe>commits-unsubscribe@hugegraph.apache.org</unsubscribe>
65+
<post>commits@hugegraph.apache.org</post>
66+
</mailingList>
67+
<mailingList>
68+
<name>Issues List</name>
69+
<subscribe>issues-subscribe@hugegraph.apache.org</subscribe>
70+
<unsubscribe>issues-unsubscribe@hugegraph.apache.org</unsubscribe>
71+
<post>issues@hugegraph.apache.org</post>
72+
</mailingList>
73+
</mailingLists>
74+
75+
<issueManagement>
76+
<system>Github Issues</system>
77+
<url>https://github.com/apache/hugegraph-computer/issues</url>
78+
</issueManagement>
79+
4980
<scm>
5081
<url>https://github.com/apache/hugegraph-computer</url>
51-
<connection>https://github.com/apache/hugegraph-computer</connection>
52-
<developerConnection>https://github.com/apache/hugegraph-computer</developerConnection>
82+
<connection>scm:git:https://github.com/apache/hugegraph-computer.git</connection>
83+
<developerConnection>scm:git:https://github.com/apache/hugegraph-computer.git</developerConnection>
5384
</scm>
5485

86+
<prerequisites>
87+
<maven>3.5</maven>
88+
</prerequisites>
89+
5590
<properties>
5691
<revision>1.0.0</revision>
5792
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -106,30 +141,27 @@
106141
</exclusion>
107142
</exclusions>
108143
</dependency>
144+
109145
<dependency>
110146
<groupId>org.apache.hugegraph</groupId>
111147
<artifactId>hugegraph-client</artifactId>
112148
<version>${hugegraph-client-version}</version>
113149
</dependency>
114-
115150
<dependency>
116151
<groupId>org.apache.hugegraph</groupId>
117152
<artifactId>computer-algorithm</artifactId>
118153
<version>${revision}</version>
119154
</dependency>
120-
121155
<dependency>
122156
<groupId>org.apache.hugegraph</groupId>
123157
<artifactId>computer-core</artifactId>
124158
<version>${revision}</version>
125159
</dependency>
126-
127160
<dependency>
128161
<groupId>org.apache.hugegraph</groupId>
129162
<artifactId>computer-k8s-operator</artifactId>
130163
<version>${revision}</version>
131164
</dependency>
132-
133165
<dependency>
134166
<groupId>org.apache.hugegraph</groupId>
135167
<artifactId>computer-yarn</artifactId>
@@ -315,6 +347,7 @@
315347
</plugin>
316348
<plugin>
317349
<artifactId>maven-compiler-plugin</artifactId>
350+
<!-- Keep fix version to avoid computer-k8s-operator build error -->
318351
<version>3.1</version>
319352
<configuration>
320353
<source>${compiler.source}</source>
@@ -352,11 +385,9 @@
352385
<plugin>
353386
<groupId>org.apache.maven.plugins</groupId>
354387
<artifactId>maven-surefire-plugin</artifactId>
355-
<version>2.20</version>
356388
</plugin>
357389
<plugin>
358390
<artifactId>maven-clean-plugin</artifactId>
359-
<version>3.0.0</version>
360391
<configuration>
361392
<filesets>
362393
<fileset>
@@ -404,7 +435,6 @@
404435
<plugin>
405436
<groupId>org.apache.maven.plugins</groupId>
406437
<artifactId>maven-surefire-plugin</artifactId>
407-
<version>2.20</version>
408438
<executions>
409439
<execution>
410440
<id>unit-test</id>
@@ -428,7 +458,6 @@
428458
<plugin>
429459
<groupId>org.apache.maven.plugins</groupId>
430460
<artifactId>maven-surefire-plugin</artifactId>
431-
<version>2.20</version>
432461
<executions>
433462
<execution>
434463
<id>integrate-test</id>
@@ -443,13 +472,12 @@
443472
</build>
444473
</profile>
445474
<profile>
446-
<id>release</id>
475+
<id>apache-release</id>
447476
<build>
448477
<plugins>
449478
<plugin>
450479
<groupId>org.apache.maven.plugins</groupId>
451480
<artifactId>maven-source-plugin</artifactId>
452-
<version>2.2.1</version>
453481
<executions>
454482
<execution>
455483
<id>attach-sources</id>
@@ -462,7 +490,6 @@
462490
<plugin>
463491
<groupId>org.apache.maven.plugins</groupId>
464492
<artifactId>maven-javadoc-plugin</artifactId>
465-
<version>2.9.1</version>
466493
<executions>
467494
<execution>
468495
<id>attach-javadocs</id>
@@ -472,15 +499,13 @@
472499
</execution>
473500
</executions>
474501
<configuration>
475-
<additionalJOptions>
476-
<additionalJOption>-Xdoclint:none</additionalJOption>
477-
</additionalJOptions>
502+
<doclint>none</doclint>
503+
<failOnError>false</failOnError>
478504
</configuration>
479505
</plugin>
480506
<plugin>
481507
<groupId>org.apache.maven.plugins</groupId>
482508
<artifactId>maven-gpg-plugin</artifactId>
483-
<version>1.5</version>
484509
<executions>
485510
<execution>
486511
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)