From a6987af4bf4de7cc0fae5e4c70af5c77b818c401 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Sat, 6 Nov 2021 07:17:44 -0700 Subject: [PATCH] Backport main changes to 1.x (#93) * Add themed logo to README (#41) Signed-off-by: Miki * Updates common-utils version to 1.2 (#77) * Updates common-utils version to 1.2 and Uses Maven for 1.2 dependencies Signed-off-by: Clay Downs * Publish .md5 and .sha1 signatures. (#79) (#80) * Publish .md5 and .sha1 signatures. Signed-off-by: dblock * Use OpenSearch 1.1. Signed-off-by: dblock * Publish source and javadoc checksums. (#81) Signed-off-by: dblock * Update copyright notice (#90) Signed-off-by: Mohammad Qureshi * Update maven publication to include cksums. (#91) This change adds a local staging repo task that will include cksums. It will also update build.sh to use this new task and copy the contents of the staging repo to the output directory. The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder. Signed-off-by: Marc Handalian * Add release notes for version 1.2.0.0 (#92) * Add release notes for version 1.2.0.0 Signed-off-by: Ashish Agrawal Co-authored-by: Miki Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com> Co-authored-by: Daniel Doubrovkine (dB.) Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Marc Handalian Signed-off-by: AWSHurneyt --- .github/workflows/ci.yml | 15 +---- .github/workflows/push-common-utils-jar.yml | 44 ------------- README.md | 4 +- build.gradle | 16 ++--- ...arch-common-utils.release-notes-1.2.0.0.md | 14 +++++ scripts/build.sh | 62 +++++++++++++++++++ 6 files changed, 89 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/push-common-utils-jar.yml create mode 100644 release-notes/opensearch-common-utils.release-notes-1.2.0.0.md create mode 100755 scripts/build.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c3d9b6..52eea2f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,25 +25,14 @@ jobs: with: java-version: ${{ matrix.java }} - # dependencies: OpenSearch - - name: Checkout OpenSearch - uses: actions/checkout@v2 - with: - repository: 'opensearch-project/OpenSearch' - path: OpenSearch - ref: '1.x' - - name: Build OpenSearch - working-directory: ./OpenSearch - run: ./gradlew publishToMavenLocal - # common-utils - name: Build and Test run: | - ./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT + ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT - name: Publish to Maven Local run: | - ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT + ./gradlew publishToMavenLocal -Dopensearch.version=1.2.0-SNAPSHOT - name: Upload Coverage Report uses: codecov/codecov-action@v1 diff --git a/.github/workflows/push-common-utils-jar.yml b/.github/workflows/push-common-utils-jar.yml deleted file mode 100644 index 6a4bc703..00000000 --- a/.github/workflows/push-common-utils-jar.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Upload Common-Utils Jar to Maven - -on: - push: - tags: - - v* -jobs: - upload-common-utils-jar: - runs-on: [ubuntu-16.04] - name: Upload common-utils Jar to Maven - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - - name: Configure AWS CLI - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: '14' - - - name: Upload common-utils Jar to Maven - env: - passphrase: ${{ secrets.PASSPHRASE }} - run: | - cd .. - export JAVA14_HOME=$JAVA_HOME - aws s3 cp s3://opendistro-docs/github-actions/pgp-public-key . - aws s3 cp s3://opendistro-docs/github-actions/pgp-private-key . - - gpg --import pgp-public-key - gpg --allow-secret-key-import --import pgp-private-key - - mkdir /home/runner/.gradle - aws s3 cp s3://opendistro-docs/github-actions/gradle.properties /home/runner/.gradle/ - - cd common-utils - - ./gradlew publishShadowPublicationToSonatype-stagingRepository -Dcompiler.java=14 -Dbuild.snapshot=false -Djavax.net.ssl.trustStore=$JAVA_HOME/lib/security/cacerts diff --git a/README.md b/README.md index 237509c1..fc95f76e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + - [OpenSearch Common Utils](#opensearch-common-utils) - [Contributing](#contributing) @@ -44,4 +44,4 @@ This project is licensed under the [Apache v2.0 License](LICENSE.txt). ## Copyright -Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details. diff --git a/build.gradle b/build.gradle index d443ddf4..92e442ca 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { ext { opensearch_group = "org.opensearch" - opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "1.2.0-SNAPSHOT") kotlin_version = System.getProperty("kotlin.version", "1.4.32") } @@ -21,6 +21,7 @@ buildscript { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } jcenter() + maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } dependencies { @@ -42,6 +43,7 @@ repositories { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } jcenter() + maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } ext { @@ -155,8 +157,13 @@ task javadocJar(type: Jar) { classifier = 'javadoc' from javadoc.destinationDir } - publishing { + repositories { + maven { + name = 'staging' + url = "${rootProject.buildDir}/local-staging-repo" + } + } publications { shadow(MavenPublication) { project.shadow.component(it) @@ -195,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 - } } diff --git a/release-notes/opensearch-common-utils.release-notes-1.2.0.0.md b/release-notes/opensearch-common-utils.release-notes-1.2.0.0.md new file mode 100644 index 00000000..afb92873 --- /dev/null +++ b/release-notes/opensearch-common-utils.release-notes-1.2.0.0.md @@ -0,0 +1,14 @@ +## Version 1.2.0.0 2021-11-05 + +Compatible with OpenSearch 1.2.0 + +### Infrastructure + + * Updates common-utils version to 1.2 ([#77](https://github.com/opensearch-project/common-utils/pull/77)) + * Update maven publication to include cksums. ([#91](https://github.com/opensearch-project/common-utils/pull/91)) + +### Documentation + + * Add themed logo to README ([#41](https://github.com/opensearch-project/common-utils/pull/41)) + * Update copyright notice ([#90](https://github.com/opensearch-project/common-utils/pull/90)) + * Add release notes for version 1.2.0.0 ([#92](https://github.com/opensearch-project/common-utils/pull/92)) \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..891e27fc --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,62 @@ +#!/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 +./gradlew publishShadowPublicationToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT +mkdir -p $OUTPUT/maven/org/opensearch +cp -r ./build/local-staging-repo/org/opensearch/common-utils $OUTPUT/maven/org/opensearch/common-utils