## Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. ## SPDX-License-Identifier: Apache-2.0 version: 0.2 env: variables: BRANCH: "main" git-credential-helper: yes parameter-store: ACCOUNT: /CodeBuild/AccountId secrets-manager: GH_TOKEN: Github/aws-crypto-tools-ci-bot:ESDK Release Token phases: pre_build: commands: # get new project version - git checkout $BRANCH - export VERSION=$(grep version pom.xml | head -n 2 | 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 build: commands: - gh version - 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 \ -Dartifact=software.amazon.encryption.s3:amazon-s3-encryption-client-java:${VERSION}:jar - | mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ -DrepoUrl=https://aws.oss.sonatype.org \ -Dartifact=software.amazon.encryption.s3:amazon-s3-encryption-client-java:${VERSION}:jar:sources - | mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ -DrepoUrl=https://aws.oss.sonatype.org \ -Dartifact=software.amazon.encryption.s3:amazon-s3-encryption-client-java:${VERSION}:jar:javadoc - gh release create v${VERSION} ~/.m2/repository/software/amazon/encryption/s3/amazon-s3-encryption-client-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "Amazon S3 Encryption Client ${VERSION} Release -- $(date +%Y-%m-%d)"