Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add build to support uploading artifacts #379

Merged
merged 4 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion codebuild/release/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 40 additions & 0 deletions codebuild/release/upload_artifacts.yml
Original file line number Diff line number Diff line change
@@ -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>\(.*\)<\/version>/\1/p')
alex-chew marked this conversation as resolved.
Show resolved Hide resolved
# 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