Skip to content

Commit 350263e

Browse files
committed
Publish MD5 and SHA1 signatures.
Signed-off-by: dblock <[email protected]>
1 parent 3b51c14 commit 350263e

File tree

3 files changed

+83
-61
lines changed

3 files changed

+83
-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

+15-17
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ shadowJar {
7676
relocate 'com.cronutils', 'org.opensearch.jobscheduler.repackage.com.cronutils'
7777
relocate 'org.slf4j', 'org.opensearch.jobscheduler.repackage.org.slf4j' // dependency of cron-utils
7878
classifier = null
79+
80+
doLast {
81+
ant.checksum algorithm: 'md5', file: it.archivePath
82+
ant.checksum algorithm: 'sha1', file: it.archivePath
83+
}
7984
}
8085

8186
test {
@@ -105,12 +110,22 @@ testClusters.javaRestTest {
105110
task sourcesJar(type: Jar) {
106111
archiveClassifier.set 'sources'
107112
from sourceSets.main.allJava
113+
114+
doLast {
115+
ant.checksum algorithm: 'md5', file: it.archivePath
116+
ant.checksum algorithm: 'sha1', file: it.archivePath
117+
}
108118
}
109119

110120
task javadocJar(type: Jar) {
111121
archiveClassifier.set 'javadoc'
112122
from javadoc.destinationDir
113123
dependsOn javadoc
124+
125+
doLast {
126+
ant.checksum algorithm: 'md5', file: it.archivePath
127+
ant.checksum algorithm: 'sha1', file: it.archivePath
128+
}
114129
}
115130

116131
publishing {
@@ -147,24 +162,7 @@ publishing {
147162
}
148163
}
149164

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-
161165
// TODO - enabled debug logging for the time being, remove this eventually
162166
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
163167
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
164168
}
165-
166-
signing {
167-
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
168-
sign publishing.publications.shadow
169-
}
170-

0 commit comments

Comments
 (0)