Skip to content

Commit 0f368a7

Browse files
authored
Publish MD5 and SHA1 signatures. (#71)
* Publish MD5 and SHA1 signatures. Signed-off-by: dblock <[email protected]> * Also publish 256 and 512 checksums. Signed-off-by: dblock <[email protected]>
1 parent 3b51c14 commit 0f368a7

File tree

3 files changed

+77
-61
lines changed

3 files changed

+77
-61
lines changed

.github/workflows/push-job-sched-jar.yml

-44
This file was deleted.

scripts/build.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
9+
set -ex
10+
11+
function usage() {
12+
echo "Usage: $0 [args]"
13+
echo ""
14+
echo "Arguments:"
15+
echo -e "-v VERSION\t[Required] OpenSearch version."
16+
echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'."
17+
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored."
18+
echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'."
19+
echo -e "-h help"
20+
}
21+
22+
while getopts ":h:v:s:o:a:" arg; do
23+
case $arg in
24+
h)
25+
usage
26+
exit 1
27+
;;
28+
v)
29+
VERSION=$OPTARG
30+
;;
31+
s)
32+
SNAPSHOT=$OPTARG
33+
;;
34+
o)
35+
OUTPUT=$OPTARG
36+
;;
37+
a)
38+
ARCHITECTURE=$OPTARG
39+
;;
40+
:)
41+
echo "Error: -${OPTARG} requires an argument"
42+
usage
43+
exit 1
44+
;;
45+
?)
46+
echo "Invalid option: -${arg}"
47+
exit 1
48+
;;
49+
esac
50+
done
51+
52+
if [ -z "$VERSION" ]; then
53+
echo "Error: You must specify the OpenSearch version"
54+
usage
55+
exit 1
56+
fi
57+
58+
[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT
59+
[ -z "$OUTPUT" ] && OUTPUT=artifacts
60+
61+
./gradlew publishShadowPublicationToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
62+
mkdir -p $OUTPUT/maven/org/opensearch
63+
cp -r ./spi/build/distributions/* $OUTPUT/maven/org/opensearch
64+
65+
./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
66+
[ -z "$OUTPUT" ] && OUTPUT=artifacts
67+
mkdir -p $OUTPUT/plugins
68+
cp ./build/distributions/*.zip $OUTPUT/plugins

spi/build.gradle

+9-17
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ task javadocJar(type: Jar) {
113113
dependsOn javadoc
114114
}
115115

116+
tasks.withType(Jar) { task ->
117+
task.doLast {
118+
ant.checksum algorithm: 'md5', file: it.archivePath
119+
ant.checksum algorithm: 'sha1', file: it.archivePath
120+
ant.checksum algorithm: 'sha-256', file: it.archivePath, fileext: '.sha256'
121+
ant.checksum algorithm: 'sha-512', file: it.archivePath, fileext: '.sha512'
122+
}
123+
}
124+
116125
publishing {
117126
publications {
118127
shadow(MavenPublication) { publication ->
@@ -147,24 +156,7 @@ publishing {
147156
}
148157
}
149158

150-
repositories {
151-
maven {
152-
name = "sonatype-staging"
153-
url "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2"
154-
credentials {
155-
username project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
156-
password project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
157-
}
158-
}
159-
}
160-
161159
// TODO - enabled debug logging for the time being, remove this eventually
162160
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
163161
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
164162
}
165-
166-
signing {
167-
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
168-
sign publishing.publications.shadow
169-
}
170-

0 commit comments

Comments
 (0)