Skip to content

Instantly share code, notes, and snippets.

@brysontyrrell
Last active February 16, 2022 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brysontyrrell/e5ec2e4f688bf4f592b1aa5e4ef061e6 to your computer and use it in GitHub Desktop.
Save brysontyrrell/e5ec2e4f688bf4f592b1aa5e4ef061e6 to your computer and use it in GitHub Desktop.
name: Publish Package
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-2 # change to appropriate region
role-to-assume: arn:aws:iam::111122223333:role/my-repo-iam-role
role-session-name: RepoPublishPackage
role-duration-seconds: 900
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Twine
run: |
pip install wheel twine
- name: Build Package
run: |
python setup.py sdist
- name: Publish Package
run: |
aws codeartifact login --tool twine --domain my_domain --repository my_repo &&
twine upload --repository codeartifact dist/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment