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: update release process #1888

Merged
merged 3 commits into from
Dec 6, 2023
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
2 changes: 1 addition & 1 deletion cfn/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Resources:
## If this value is 0, greater than 25, or not provided then the full history is downloaded with each build project.
GitCloneDepth: 0
GitSubmodulesConfig:
FetchSubmodules: false
FetchSubmodules: true
InsecureSsl: false
ReportBuildStatus: false
Type: GITHUB
Expand Down
10 changes: 8 additions & 2 deletions codebuild/ci/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ phases:
--package $PACKAGE \
--versions $VERSION_HASH \
--region $REGION;

# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity
# See https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
- echo "Setting version in POM to $VERSION_HASH"
- mvn versions:set -DnewVersion="$VERSION_HASH" --no-transfer-progress
- echo "Version is now $(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*<version>\(.*\)<\/version>/\1/p')"
- |
mvn deploy \
-PpublishingCodeArtifact \
-Dmaven.test.skip=true \
-Pfast-tests-only \
-DperformRelease \
-Dgpg.homedir="$HOME/mvn_gpg" \
-DautoReleaseAfterClose=true \
Expand Down
7 changes: 7 additions & 0 deletions codebuild/release/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ phases:
- cd $CODEBUILD_SRC_DIR
build:
commands:
# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity
- |
mvn deploy \
-Ppublishing \
Expand Down
8 changes: 8 additions & 0 deletions codebuild/release/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ phases:
- cd $CODEBUILD_SRC_DIR
build:
commands:
# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity

- VERSION_HASH="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$CODEBUILD_RESOLVED_SOURCE_VERSION"
# See https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
- echo "Setting version in POM to $VERSION_HASH"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.88</minimum>
<minimum>0.87</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
Expand Down