Skip to content

Commit

Permalink
Publish .md5 and .sha1 signatures. (#79) (#80)
Browse files Browse the repository at this point in the history
* Publish .md5 and .sha1 signatures.

Signed-off-by: dblock <dblock@dblock.org>

* Use OpenSearch 1.1.

Signed-off-by: dblock <dblock@dblock.org>
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
dblock authored and zelinh committed Aug 18, 2022
1 parent 8d390f4 commit c7f9a5f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 49 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/push-common-utils-jar.yml

This file was deleted.

10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ shadowJar {
classifier = null
}

shadowJar.doLast {
ant.checksum algorithm: 'md5', file: it.archivePath
ant.checksum algorithm: 'sha1', file: it.archivePath
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
Expand Down Expand Up @@ -197,9 +202,4 @@ publishing {

gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)

signing {
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
sign publishing.publications.shadow
}
}
61 changes: 61 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

# Copyright OpenSearch Contributors.
# SPDX-License-Identifier: Apache-2.0

set -ex

function usage() {
echo "Usage: $0 [args]"
echo ""
echo "Arguments:"
echo -e "-v VERSION\t[Required] OpenSearch version."
echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'."
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored."
echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'."
echo -e "-h help"
}

while getopts ":h:v:s:o:a:" arg; do
case $arg in
h)
usage
exit 1
;;
v)
VERSION=$OPTARG
;;
s)
SNAPSHOT=$OPTARG
;;
o)
OUTPUT=$OPTARG
;;
a)
ARCHITECTURE=$OPTARG
;;
:)
echo "Error: -${OPTARG} requires an argument"
usage
exit 1
;;
?)
echo "Invalid option: -${arg}"
exit 1
;;
esac
done

if [ -z "$VERSION" ]; then
echo "Error: You must specify the OpenSearch version"
usage
exit 1
fi

[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT
[ -z "$OUTPUT" ] && OUTPUT=artifacts

./gradlew build -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew publishShadowPublicationToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
mkdir -p $OUTPUT/maven/org/opensearch
cp -r ./build/libs $OUTPUT/maven/org/opensearch/common-utils

0 comments on commit c7f9a5f

Please sign in to comment.