Skip to content

Commit e0b8dc1

Browse files
committed
update publication workflow
1 parent 9f99226 commit e0b8dc1

1 file changed

Lines changed: 31 additions & 22 deletions

File tree

.github/workflows/publish.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,43 @@ name: Publish
22

33
on:
44
release:
5-
types:
6-
- created
7-
workflow_dispatch:
8-
inputs:
9-
debug_enabled:
10-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
11-
required: false
12-
default: 'false'
5+
types: [published]
136

147
jobs:
158
publish:
16-
runs-on: ubuntu-latest
9+
if: ${{ github.repository == 'Dandelion-Science/sqlmodel' }}
1710
permissions:
1811
id-token: write
19-
contents: read
12+
contents: write
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
2015
steps:
21-
- name: Dump GitHub context
22-
env:
23-
GITHUB_CONTEXT: ${{ toJson(github) }}
24-
run: echo "$GITHUB_CONTEXT"
2516
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26-
- name: Set up Python
27-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
17+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2818
with:
2919
python-version-file: ".python-version"
30-
- name: Install uv
31-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
32-
- name: Build distribution
33-
run: uv build
34-
- name: Publish
35-
run: uv publish
20+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
21+
- run: uv build
22+
- uses: softprops/action-gh-release@v2
23+
with:
24+
files: |
25+
dist/*.whl
26+
dist/*.tar.gz
27+
tag_name: ${{ github.event.release.tag_name }}
28+
- uses: aws-actions/configure-aws-credentials@v6
29+
with:
30+
aws-region: ${{ vars.AWS_REGION }}
31+
role-to-assume: ${{ vars.ARN_IAM_ROLE_GHA_CORE }}
32+
- name: Get CodeArtifact authorization token
33+
run: |
34+
AWS_CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token \
35+
--domain ${{ vars.CODEARTIFACT_DOMAIN }} \
36+
--domain-owner ${{ vars.CODEARTIFACT_DOMAIN_OWNER }} \
37+
--query authorizationToken \
38+
--output text)
39+
echo "AWS_CODEARTIFACT_TOKEN=$AWS_CODEARTIFACT_TOKEN" >> $GITHUB_ENV
40+
- run: uv publish
41+
env:
42+
UV_PUBLISH_USERNAME: aws
43+
UV_PUBLISH_PASSWORD: ${{ env.AWS_CODEARTIFACT_TOKEN }}
44+
UV_PUBLISH_URL: ${{ vars.CODEARTIFACT_PYPI_STORE_REPOSITORY_URL }}

0 commit comments

Comments
 (0)