Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Release

# Manually-triggered release to Doist's AWS CodeArtifact index, modeled on
# Doist/billist's release workflow. Requires the AWS_CODEARTIFACT_TOKEN repo
# secret (kept fresh by update-aws-codeartifact-token.yml).
# Manually-triggered release to Doist's AWS CodeArtifact index. Publishes via
# the GitHub OIDC role below; no repo secrets needed.
on:
workflow_dispatch:
inputs:
Expand All @@ -14,13 +13,17 @@ on:

concurrency: deploy

env:
AWS_ROLE: arn:aws:iam::011833101604:role/github-roles-FractionalIndexingPython-73esVaEfRRD9

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
id-token: write
steps:
- name: Get latest code
uses: actions/checkout@v4
Expand Down Expand Up @@ -51,12 +54,21 @@ jobs:
- name: Build package
run: uv build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Pin this action to a full commit SHA rather than the mutable v6 tag. If that tag is moved or its publisher is compromised, arbitrary action code runs in this release job and can mint the AWS OIDC credentials and use the existing contents: write token. Use the commit SHA for the intended v6 release (as this workflow already does for its other release-mutating actions).

with:
role-to-assume: ${{ env.AWS_ROLE }}
role-duration-seconds: 900
aws-region: us-east-1

- name: Publish package
env:
UV_PUBLISH_URL: https://doist-011833101604.d.codeartifact.us-east-1.amazonaws.com/pypi/doist/
UV_PUBLISH_USERNAME: aws
UV_PUBLISH_PASSWORD: ${{ secrets.AWS_CODEARTIFACT_TOKEN }}
run: uv publish
run: |
UV_PUBLISH_PASSWORD=$(aws codeartifact get-authorization-token --domain doist --domain-owner 011833101604 --query authorizationToken --output text)
export UV_PUBLISH_PASSWORD
uv publish

- name: Create GitHub release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/update-aws-codeartifact-token.yml

This file was deleted.

Loading