diff --git a/codebuild/release/release.yml b/codebuild/release/release.yml index 768a63cf8..4044673b6 100644 --- a/codebuild/release/release.yml +++ b/codebuild/release/release.yml @@ -111,12 +111,23 @@ batch: JAVA_NUMERIC_VERSION: 11 image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - - identifier: update_javadoc +# Upload Artifacts + - identifier: upload_artifacts depend-on: - validate_prod_release_openjdk8 - validate_prod_release_openjdk11 - validate_prod_release_corretto8 - validate_prod_release_corretto11 + buildspec: codebuild/release/upload_artifacts.yml + env: + # Changing to standard:5.0 because we are able to install gh cli on ubuntu but + # not on AmazonLinux + image: aws/codebuild/standard:5.0 + +# Generate and update new javadocs + - identifier: update_javadoc + depend-on: + - upload_artifacts buildspec: codebuild/release/javadoc.yml env: variables: diff --git a/codebuild/release/upload_artifacts.yml b/codebuild/release/upload_artifacts.yml new file mode 100644 index 000000000..8122e09e8 --- /dev/null +++ b/codebuild/release/upload_artifacts.yml @@ -0,0 +1,40 @@ +## Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +version: 0.2 + +env: + variables: + BRANCH: "master" + git-credential-helper: yes + secrets-manager: + GH_TOKEN: Github/aws-crypto-tools-ci-bot:personal\ access\ token + +phases: + pre_build: + commands: + # get new project version + - export VERSION=$(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*\(.*\)<\/version>/\1/p') + # install gh cli in order to upload artifacts + - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg + - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + - apt update + - apt install gh + - git checkout $BRANCH + build: + commands: + - gh version + - gh auth login --with-token < $GH_TOKEN + - | + mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ + -DrepoUrl=https://aws.oss.sonatype.org \ + -Dartifact=com.amazonaws:aws-encryption-sdk-java:${VERSION}:jar + - | + mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ + -DrepoUrl=https://aws.oss.sonatype.org \ + -Dartifact=com.amazonaws:aws-encryption-sdk-java:${VERSION}:jar:sources + - | + mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ + -DrepoUrl=https://aws.oss.sonatype.org \ + -Dartifact=com.amazonaws:aws-encryption-sdk-java:${VERSION}:jar:javadoc + - gh release upload v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar