Skip to content

Commit a1f177e

Browse files
committed
Publish .md5 and .sha1 signatures.
Signed-off-by: dblock <dblock@dblock.org>
1 parent 8d05d8a commit a1f177e

File tree

3 files changed

+67
-49
lines changed

3 files changed

+67
-49
lines changed

.github/workflows/push-common-utils-jar.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ plugins {
3535
id 'java-library'
3636
id 'maven-publish'
3737
id "com.diffplug.gradle.spotless" version "3.26.1"
38+
id 'com.github.johnrengelman.shadow' version '6.1.0'
3839
}
3940

4041
repositories {
@@ -146,6 +147,11 @@ shadowJar {
146147
classifier = null
147148
}
148149

150+
shadowJar.doLast {
151+
ant.checksum algorithm: 'md5', file: it.archivePath
152+
ant.checksum algorithm: 'sha1', file: it.archivePath
153+
}
154+
149155
task sourcesJar(type: Jar) {
150156
classifier = 'sources'
151157
from sourceSets.main.allJava
@@ -195,9 +201,4 @@ publishing {
195201

196202
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
197203
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
198-
199-
signing {
200-
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
201-
sign publishing.publications.shadow
202-
}
203204
}

scripts/build.sh

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

0 commit comments

Comments
 (0)