forked from aws/sagemaker-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec-deploy.yml
29 lines (22 loc) · 1.23 KB
/
buildspec-deploy.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
version: 0.2
phases:
build:
commands:
# prepare the release (update versions, changelog etc.)
- git-release --prepare
# generate the distribution package
- python3 setup.py sdist
# publish the release to github
- git-release --publish
- PACKAGE_FILE="dist/sagemaker-*.tar.gz"
- PYPI_USER=$(aws secretsmanager get-secret-value --secret-id /codebuild/pypi/user --query SecretString --output text)
- PYPI_PASSWORD=$(aws secretsmanager get-secret-value --secret-id /codebuild/pypi/password --query SecretString --output text)
- GPG_PRIVATE_KEY=$(aws secretsmanager get-secret-value --secret-id /codebuild/gpg/private_key --query SecretString --output text)
- GPG_PASSWORD=$(aws secretsmanager get-secret-value --secret-id /codebuild/gpg/password --query SecretString --output text)
- echo 'md5sum of python package:'
- md5sum $PACKAGE_FILE
# import private key and ensure passphrase is cached
- echo "$GPG_PRIVATE_KEY" | gpg --batch --import
- gpg --pinentry-mode loopback --passphrase "$GPG_PASSWORD" --detach-sign -a -o /dev/null $PACKAGE_FILE
# publish to pypi
- python3 -m twine upload $PACKAGE_FILE --sign -u $PYPI_USER -p $PYPI_PASSWORD