-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathupload_artifacts.yml
45 lines (42 loc) · 2.03 KB
/
upload_artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## 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:ESDK Release Token
phases:
pre_build:
commands:
# get new project version
- git checkout $BRANCH
- export VERSION=$(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*<version>\(.*\)<\/version>/\1/p')
- git config --global user.name "aws-crypto-tools-ci-bot"
- git config --global user.email "[email protected]"
- 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=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 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')"