Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Publish Python Wheel

permissions:
id-token: write # This is required for requesting to login in AWS
contents: write

on:
release:
types: [published]

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::356432868028:role/github_oidc_codeartifact
aws-region: 'us-east-1'

- name: Deployment Token
id: deployment-token
run: |
TOKEN=$(aws codeartifact get-authorization-token \
--domain python-domain \
--domain-owner 356432868028 \
--query authorizationToken \
--output text)

# This line prevents the token from appearing in logs
echo "::add-mask::$TOKEN"

# Save to output for use in later steps
echo "token=$TOKEN" >> $GITHUB_OUTPUT

- uses: astral-sh/setup-uv@v7

- name: Build wheel
run: uv build

- name: Publish on code artifact
env:
UV_PUBLISH_USERNAME: aws
UV_PUBLISH_PASSWORD: ${{ steps.deployment-token.outputs.token }}
UV_PUBLISH_URL: https://python-domain-356432868028.d.codeartifact.us-east-1.amazonaws.com/pypi/shiphero/
run: uv publish

- name: Publish release
uses: softprops/action-gh-release@v1
with:
files: dist/*.whl
Loading