From 02be2638990a93cfb8cc84c33720265ab765e908 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Fri, 29 Oct 2021 16:03:32 -0700 Subject: [PATCH 1/8] chore: split up release and find --- .releaserc | 4 +- codebuild/release/artifact-hunt.yml | 20 +++ codebuild/release/release.yml | 230 ++++++++++++++-------------- codebuild/release/version.yml | 5 +- 4 files changed, 145 insertions(+), 114 deletions(-) create mode 100644 codebuild/release/artifact-hunt.yml diff --git a/.releaserc b/.releaserc index eaff720af..241c77f23 100644 --- a/.releaserc +++ b/.releaserc @@ -53,12 +53,12 @@ ["@semantic-release/exec", { "prepareCmd": "mvn versions:set -DnewVersion=${nextRelease.version} \ -DautoVersionSubmodules=true && find README.md -type f \ - -exec sed -i '' 's/.*<\\/version>/${nextRelease.version}<\\/version>/g' {} \\;" + -exec sed -i 's/.*<\\/version>/${nextRelease.version}<\\/version>/g' {} \\;" }], ["@semantic-release/git", { "assets": ["./CHANGELOG.md", "./pom.xml", "./README.md"], "message": "AWS Encryption SDK ${nextRelease.version} Release \n\n${nextRelease.notes}" }], ], - "repositoryUrl": "https://github.com/aws/aws-encryption-sdk-java", + "repositoryUrl": "https://github.com/josecorella/aws-encryption-sdk-java", } diff --git a/codebuild/release/artifact-hunt.yml b/codebuild/release/artifact-hunt.yml new file mode 100644 index 000000000..a5a7beeda --- /dev/null +++ b/codebuild/release/artifact-hunt.yml @@ -0,0 +1,20 @@ +## Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +version: 0.2 + +env: + variables: + BRANCH: "mainline-1.x" + +phases: + install: + runtime-versions: + java: corretto11 + pre_build: + commands: + - git checkout $BRANCH + - export VERSION=$(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*\(.*\)<\/version>/\1/p') + build: + commands: + - ./look_4_version.sh $VERSION diff --git a/codebuild/release/release.yml b/codebuild/release/release.yml index 3f6dbc252..8e7591ed0 100644 --- a/codebuild/release/release.yml +++ b/codebuild/release/release.yml @@ -7,119 +7,127 @@ batch: fast-fail: true build-graph: -# Release to CodeArtifact - - identifier: release_staging - buildspec: codebuild/release/release-staging.yml - -# Validate CodeArtifact with supported JDK and Corretto - - identifier: validate_staging_release_openjdk8 - depend-on: - - release_staging - buildspec: codebuild/release/validate-staging.yml - env: - variables: - JAVA_ENV_VERSION: openjdk8 - JAVA_NUMERIC_VERSION: 8 - image: aws/codebuild/standard:3.0 - - - identifier: validate_staging_release_openjdk11 - depend-on: - - release_staging - buildspec: codebuild/release/validate-staging.yml - env: - variables: - JAVA_ENV_VERSION: openjdk11 - JAVA_NUMERIC_VERSION: 11 - image: aws/codebuild/standard:3.0 - - - identifier: validate_staging_release_corretto8 - depend-on: - - release_staging - buildspec: codebuild/release/validate-staging.yml - env: - variables: - JAVA_ENV_VERSION: corretto8 - JAVA_NUMERIC_VERSION: 8 - image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - - - identifier: validate_staging_release_corretto11 - depend-on: - - release_staging - buildspec: codebuild/release/validate-staging.yml - env: - variables: - JAVA_ENV_VERSION: corretto11 - JAVA_NUMERIC_VERSION: 11 - image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + ## Release to CodeArtifact + # - identifier: release_staging + # buildspec: codebuild/release/release-staging.yml + # + ## Validate CodeArtifact with supported JDK and Corretto + # - identifier: validate_staging_release_openjdk8 + # depend-on: + # - release_staging + # buildspec: codebuild/release/validate-staging.yml + # env: + # variables: + # JAVA_ENV_VERSION: openjdk8 + # JAVA_NUMERIC_VERSION: 8 + # image: aws/codebuild/standard:3.0 + # + # - identifier: validate_staging_release_openjdk11 + # depend-on: + # - release_staging + # buildspec: codebuild/release/validate-staging.yml + # env: + # variables: + # JAVA_ENV_VERSION: openjdk11 + # JAVA_NUMERIC_VERSION: 11 + # image: aws/codebuild/standard:3.0 + # + # - identifier: validate_staging_release_corretto8 + # depend-on: + # - release_staging + # buildspec: codebuild/release/validate-staging.yml + # env: + # variables: + # JAVA_ENV_VERSION: corretto8 + # JAVA_NUMERIC_VERSION: 8 + # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + # + # - identifier: validate_staging_release_corretto11 + # depend-on: + # - release_staging + # buildspec: codebuild/release/validate-staging.yml + # env: + # variables: + # JAVA_ENV_VERSION: corretto11 + # JAVA_NUMERIC_VERSION: 11 + # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 # Version Project - - identifier: version - depend-on: - - release_staging - - validate_staging_release_openjdk8 - - validate_staging_release_openjdk11 - - validate_staging_release_corretto8 - - validate_staging_release_corretto11 - buildspec: codebuild/release/version.yml - env: - image: aws/codebuild/standard:5.0 +# - identifier: version +# #depend-on: +# # - release_staging +# # - validate_staging_release_openjdk8 +# # - validate_staging_release_openjdk11 +# # - validate_staging_release_corretto8 +# # - validate_staging_release_corretto11 +# buildspec: codebuild/release/version.yml +# env: +# image: aws/codebuild/standard:5.0 +# + ## Publish to Maven Central + # - identifier: publish + # depend-on: + # - version + # buildspec: codebuild/release/release-prod.yml -# Publish to Maven Central - - identifier: publish - depend-on: - - version - buildspec: codebuild/release/release-prod.yml - -# Validate Maven Central with supported JDK and Corretto - - identifier: validate_prod_release_openjdk8 - depend-on: - - publish - buildspec: codebuild/release/validate-prod.yml - env: - variables: - JAVA_ENV_VERSION: openjdk8 - JAVA_NUMERIC_VERSION: 8 - image: aws/codebuild/standard:3.0 - - - identifier: validate_prod_release_openjdk11 - depend-on: - - publish - buildspec: codebuild/release/validate-prod.yml - env: - variables: - JAVA_ENV_VERSION: openjdk11 - JAVA_NUMERIC_VERSION: 11 - image: aws/codebuild/standard:3.0 - - - identifier: validate_prod_release_corretto8 - depend-on: - - publish - buildspec: codebuild/release/validate-prod.yml +# Wait for artifacts to be available + - identifier: availability + #depend-on: + # - version + buildspec: codebuild/release/artifact-hunt.yml env: - variables: - JAVA_ENV_VERSION: corretto8 - JAVA_NUMERIC_VERSION: 8 - image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - - - identifier: validate_prod_release_corretto11 - depend-on: - - publish - buildspec: codebuild/release/validate-prod.yml - env: - variables: - JAVA_ENV_VERSION: corretto11 - JAVA_NUMERIC_VERSION: 11 - image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - -# 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 + + ## Validate Maven Central with supported JDK and Corretto + # - identifier: validate_prod_release_openjdk8 + # depend-on: + # - availability + # buildspec: codebuild/release/validate-prod.yml + # env: + # variables: + # JAVA_ENV_VERSION: openjdk8 + # JAVA_NUMERIC_VERSION: 8 + # image: aws/codebuild/standard:3.0 + # + # - identifier: validate_prod_release_openjdk11 + # depend-on: + # - availability + # buildspec: codebuild/release/validate-prod.yml + # env: + # variables: + # JAVA_ENV_VERSION: openjdk11 + # JAVA_NUMERIC_VERSION: 11 + # image: aws/codebuild/standard:3.0 + # + # - identifier: validate_prod_release_corretto8 + # depend-on: + # - availability + # buildspec: codebuild/release/validate-prod.yml + # env: + # variables: + # JAVA_ENV_VERSION: corretto8 + # JAVA_NUMERIC_VERSION: 8 + # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + # + # - identifier: validate_prod_release_corretto11 + # depend-on: + # - availability + # buildspec: codebuild/release/validate-prod.yml + # env: + # variables: + # JAVA_ENV_VERSION: corretto11 + # JAVA_NUMERIC_VERSION: 11 + # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + # + ## 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 diff --git a/codebuild/release/version.yml b/codebuild/release/version.yml index 79b1bab41..b7b818209 100644 --- a/codebuild/release/version.yml +++ b/codebuild/release/version.yml @@ -26,5 +26,8 @@ phases: - git checkout $BRANCH build: commands: - - npx semantic-release --branches $BRANCH --no-ci + - ls + - find README.md + - cat README.md + - npx semantic-release --branches $BRANCH --no-ci From 1f0bf31c74eb158c8cb9987e6706d0603f1ababa Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Fri, 29 Oct 2021 17:39:13 -0700 Subject: [PATCH 2/8] chore: update release_artifacts command and url --- .releaserc | 2 +- codebuild/release/release.yml | 230 ++++++++++++------------- codebuild/release/upload_artifacts.yml | 2 +- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/.releaserc b/.releaserc index 241c77f23..770301cc9 100644 --- a/.releaserc +++ b/.releaserc @@ -60,5 +60,5 @@ "message": "AWS Encryption SDK ${nextRelease.version} Release \n\n${nextRelease.notes}" }], ], - "repositoryUrl": "https://github.com/josecorella/aws-encryption-sdk-java", + "repositoryUrl": "https://github.com/aws/aws-encryption-sdk-java", } diff --git a/codebuild/release/release.yml b/codebuild/release/release.yml index 8e7591ed0..a123e65a0 100644 --- a/codebuild/release/release.yml +++ b/codebuild/release/release.yml @@ -7,127 +7,127 @@ batch: fast-fail: true build-graph: - ## Release to CodeArtifact - # - identifier: release_staging - # buildspec: codebuild/release/release-staging.yml - # - ## Validate CodeArtifact with supported JDK and Corretto - # - identifier: validate_staging_release_openjdk8 - # depend-on: - # - release_staging - # buildspec: codebuild/release/validate-staging.yml - # env: - # variables: - # JAVA_ENV_VERSION: openjdk8 - # JAVA_NUMERIC_VERSION: 8 - # image: aws/codebuild/standard:3.0 - # - # - identifier: validate_staging_release_openjdk11 - # depend-on: - # - release_staging - # buildspec: codebuild/release/validate-staging.yml - # env: - # variables: - # JAVA_ENV_VERSION: openjdk11 - # JAVA_NUMERIC_VERSION: 11 - # image: aws/codebuild/standard:3.0 - # - # - identifier: validate_staging_release_corretto8 - # depend-on: - # - release_staging - # buildspec: codebuild/release/validate-staging.yml - # env: - # variables: - # JAVA_ENV_VERSION: corretto8 - # JAVA_NUMERIC_VERSION: 8 - # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - # - # - identifier: validate_staging_release_corretto11 - # depend-on: - # - release_staging - # buildspec: codebuild/release/validate-staging.yml - # env: - # variables: - # JAVA_ENV_VERSION: corretto11 - # JAVA_NUMERIC_VERSION: 11 - # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 +# Release to CodeArtifact + - identifier: release_staging + buildspec: codebuild/release/release-staging.yml + +# Validate CodeArtifact with supported JDK and Corretto + - identifier: validate_staging_release_openjdk8 + depend-on: + - release_staging + buildspec: codebuild/release/validate-staging.yml + env: + variables: + JAVA_ENV_VERSION: openjdk8 + JAVA_NUMERIC_VERSION: 8 + image: aws/codebuild/standard:3.0 + + - identifier: validate_staging_release_openjdk11 + depend-on: + - release_staging + buildspec: codebuild/release/validate-staging.yml + env: + variables: + JAVA_ENV_VERSION: openjdk11 + JAVA_NUMERIC_VERSION: 11 + image: aws/codebuild/standard:3.0 + + - identifier: validate_staging_release_corretto8 + depend-on: + - release_staging + buildspec: codebuild/release/validate-staging.yml + env: + variables: + JAVA_ENV_VERSION: corretto8 + JAVA_NUMERIC_VERSION: 8 + image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + + - identifier: validate_staging_release_corretto11 + depend-on: + - release_staging + buildspec: codebuild/release/validate-staging.yml + env: + variables: + JAVA_ENV_VERSION: corretto11 + JAVA_NUMERIC_VERSION: 11 + image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 # Version Project -# - identifier: version -# #depend-on: -# # - release_staging -# # - validate_staging_release_openjdk8 -# # - validate_staging_release_openjdk11 -# # - validate_staging_release_corretto8 -# # - validate_staging_release_corretto11 -# buildspec: codebuild/release/version.yml -# env: -# image: aws/codebuild/standard:5.0 -# - ## Publish to Maven Central - # - identifier: publish - # depend-on: - # - version - # buildspec: codebuild/release/release-prod.yml + - identifier: version + depend-on: + - release_staging + - validate_staging_release_openjdk8 + - validate_staging_release_openjdk11 + - validate_staging_release_corretto8 + - validate_staging_release_corretto11 + buildspec: codebuild/release/version.yml + env: + image: aws/codebuild/standard:5.0 + +# Publish to Maven Central + - identifier: publish + depend-on: + - version + buildspec: codebuild/release/release-prod.yml # Wait for artifacts to be available - identifier: availability - #depend-on: - # - version + depend-on: + - version buildspec: codebuild/release/artifact-hunt.yml env: image: aws/codebuild/standard:5.0 - ## Validate Maven Central with supported JDK and Corretto - # - identifier: validate_prod_release_openjdk8 - # depend-on: - # - availability - # buildspec: codebuild/release/validate-prod.yml - # env: - # variables: - # JAVA_ENV_VERSION: openjdk8 - # JAVA_NUMERIC_VERSION: 8 - # image: aws/codebuild/standard:3.0 - # - # - identifier: validate_prod_release_openjdk11 - # depend-on: - # - availability - # buildspec: codebuild/release/validate-prod.yml - # env: - # variables: - # JAVA_ENV_VERSION: openjdk11 - # JAVA_NUMERIC_VERSION: 11 - # image: aws/codebuild/standard:3.0 - # - # - identifier: validate_prod_release_corretto8 - # depend-on: - # - availability - # buildspec: codebuild/release/validate-prod.yml - # env: - # variables: - # JAVA_ENV_VERSION: corretto8 - # JAVA_NUMERIC_VERSION: 8 - # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - # - # - identifier: validate_prod_release_corretto11 - # depend-on: - # - availability - # buildspec: codebuild/release/validate-prod.yml - # env: - # variables: - # JAVA_ENV_VERSION: corretto11 - # JAVA_NUMERIC_VERSION: 11 - # image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 - # - ## 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 +# Validate Maven Central with supported JDK and Corretto + - identifier: validate_prod_release_openjdk8 + depend-on: + - availability + buildspec: codebuild/release/validate-prod.yml + env: + variables: + JAVA_ENV_VERSION: openjdk8 + JAVA_NUMERIC_VERSION: 8 + image: aws/codebuild/standard:3.0 + + - identifier: validate_prod_release_openjdk11 + depend-on: + - availability + buildspec: codebuild/release/validate-prod.yml + env: + variables: + JAVA_ENV_VERSION: openjdk11 + JAVA_NUMERIC_VERSION: 11 + image: aws/codebuild/standard:3.0 + + - identifier: validate_prod_release_corretto8 + depend-on: + - availability + buildspec: codebuild/release/validate-prod.yml + env: + variables: + JAVA_ENV_VERSION: corretto8 + JAVA_NUMERIC_VERSION: 8 + image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + + - identifier: validate_prod_release_corretto11 + depend-on: + - availability + buildspec: codebuild/release/validate-prod.yml + env: + variables: + JAVA_ENV_VERSION: corretto11 + JAVA_NUMERIC_VERSION: 11 + image: aws/codebuild/amazonlinux2-x86_64-standard:3.0 + +# 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 diff --git a/codebuild/release/upload_artifacts.yml b/codebuild/release/upload_artifacts.yml index ce3261bbf..6b1707cd4 100644 --- a/codebuild/release/upload_artifacts.yml +++ b/codebuild/release/upload_artifacts.yml @@ -37,4 +37,4 @@ phases: 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 + - gh release create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- ${date '%y-%m-%d'}" From 6f92d34ca5b9ea1cd07ed97d4eb2f7de49f9c647 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Fri, 29 Oct 2021 17:48:48 -0700 Subject: [PATCH 3/8] chore: remove test commands --- codebuild/release/version.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/codebuild/release/version.yml b/codebuild/release/version.yml index b7b818209..560b34b25 100644 --- a/codebuild/release/version.yml +++ b/codebuild/release/version.yml @@ -26,8 +26,5 @@ phases: - git checkout $BRANCH build: commands: - - ls - - find README.md - - cat README.md - npx semantic-release --branches $BRANCH --no-ci From 3531139a97572efb52fa470dc93b438a9ca20aee Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Fri, 29 Oct 2021 17:49:52 -0700 Subject: [PATCH 4/8] chore: update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c71b5f8e..fa1b13dca 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ You can get the latest release from Maven: com.amazonaws aws-encryption-sdk-java - 1.9.0 + 1.9.1 ``` From 53d6c3047f6e6c0db1e2ba924d17c2d40c695008 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Sun, 31 Oct 2021 21:31:12 -0700 Subject: [PATCH 5/8] chore: remove search script from release-prod --- codebuild/release/release-prod.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/codebuild/release/release-prod.yml b/codebuild/release/release-prod.yml index 4fff1e2d2..d97df4778 100644 --- a/codebuild/release/release-prod.yml +++ b/codebuild/release/release-prod.yml @@ -38,4 +38,3 @@ phases: -Dsonatype.password="$SONA_PASSWORD" \ --no-transfer-progress \ -s $SETTINGS_FILE - - ./look_4_version.sh $VERSION From 1eb59d833c7837b916cab7922c62c758107fc74d Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Mon, 1 Nov 2021 12:43:19 -0700 Subject: [PATCH 6/8] chore: change date command format --- codebuild/release/upload_artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild/release/upload_artifacts.yml b/codebuild/release/upload_artifacts.yml index 6b1707cd4..8645ffde7 100644 --- a/codebuild/release/upload_artifacts.yml +++ b/codebuild/release/upload_artifacts.yml @@ -37,4 +37,4 @@ phases: 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 create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- ${date '%y-%m-%d'}" + - gh release create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- $(date +%Y-%m-%d)" From 74e85217f1559fdb72a6da9e341d7b39ab17bfe4 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Mon, 1 Nov 2021 12:44:13 -0700 Subject: [PATCH 7/8] chore: git didn't grab this change :| --- .releaserc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.releaserc b/.releaserc index 770301cc9..8f5dd99ba 100644 --- a/.releaserc +++ b/.releaserc @@ -57,7 +57,7 @@ }], ["@semantic-release/git", { "assets": ["./CHANGELOG.md", "./pom.xml", "./README.md"], - "message": "AWS Encryption SDK ${nextRelease.version} Release \n\n${nextRelease.notes}" + "message": "AWS Encryption SDK ${nextRelease.version} Release -- $(date +%Y-%m-%d) \n\n${nextRelease.notes}" }], ], "repositoryUrl": "https://github.com/aws/aws-encryption-sdk-java", From 4587e5f49926092fadcd1624d6392da0d74ce5fb Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Thu, 11 Nov 2021 15:39:20 -0800 Subject: [PATCH 8/8] chore: add correct token --- codebuild/release/upload_artifacts.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/codebuild/release/upload_artifacts.yml b/codebuild/release/upload_artifacts.yml index 8645ffde7..0712e2d65 100644 --- a/codebuild/release/upload_artifacts.yml +++ b/codebuild/release/upload_artifacts.yml @@ -5,26 +5,31 @@ version: 0.2 env: variables: - BRANCH: "mainline-1.x" + BRANCH: "master" git-credential-helper: yes secrets-manager: - GH_TOKEN: Github/aws-crypto-tools-ci-bot:personal\ access\ token + GH_TOKEN: Github/aws-crypto-tools-ci-bot:ESDK Release Token phases: pre_build: commands: - - git checkout $BRANCH # get new project version - export VERSION=$(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*\(.*\)<\/version>/\1/p') + - git config --global user.name "aws-crypto-tools-ci-bot" + - git config --global user.email "no-reply@noemail.local" + - echo $GH_TOKEN > token.txt + - export GH_TOKEN= # 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 + - gh auth login --with-token < token.txt + - gh auth status - | mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ -DrepoUrl=https://aws.oss.sonatype.org \ @@ -37,4 +42,4 @@ phases: 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 create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- $(date +%Y-%m-%d)" + - gh release create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- $(date +%Y-%m-%d)"