Skip to content

v0.8.0

v0.8.0 #16

Workflow file for this run

name: Publish Package
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
pipeline:
environment: prod
name: Publish Package
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.8.3
virtualenvs-create: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
- name: Build Package
run: |
poetry build
- name: Publish to AWS CodeArtifact
run: |
export POETRY_HTTP_BASIC_CODEARTIFACT_USERNAME=aws
export POETRY_HTTP_BASIC_CODEARTIFACT_PASSWORD=`aws codeartifact get-authorization-token --domain dynamiq --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --region ${{ secrets.AWS_REGION }} --query authorizationToken --output text`
export POETRY_REPOSITORIES_CODEARTIFACT_URL=`aws codeartifact get-repository-endpoint --domain dynamiq --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository dynamiq --region ${{ secrets.AWS_REGION }} --format pypi --query repositoryEndpoint --output text`
poetry publish --repository codeartifact
- name: Publish to PyPI
run: poetry publish -u __token__ -p ${{ secrets.PYPI_PASSWORD }}