Skip to content

Commit 2b4fe73

Browse files
test-and-publish: Modernize the Publish to CodeArtifact job
1 parent c0123b0 commit 2b4fe73

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

.github/workflows/test-and-publish.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,24 @@ jobs:
6969
with:
7070
role-to-assume: arn:aws:iam::304774597385:role/cit-oidc-role-${{ github.event.repository.name }}-ci
7171
aws-region: us-east-2
72-
- name: Set up Python
73-
uses: actions/setup-python@v5
74-
with:
75-
python-version: "3.11"
7672
- name: Install uv
77-
uses: astral-sh/setup-uv@v1
78-
- name: Restore uv cache
73+
uses: astral-sh/setup-uv@v6
74+
with:
75+
version: 0.8.22
76+
enable-cache: true
77+
cache-suffix: pre-commit
78+
cache-dependency-glob: uv.lock
79+
- name: Restore venv cache
7980
uses: actions/cache@v4
8081
with:
8182
path: |
82-
~/.cache/uv
8383
${{ env.UV_PROJECT_ENVIRONMENT }}
8484
key: ${{ runner.os }}-uv-release-${{ hashFiles('pyproject.toml') }}
85+
- name: Install keyring
86+
run: uv tool install keyring --with keyrings.codeartifact
8587
- name: Synchronize project dependencies
8688
run: uv sync --group dev
8789
- name: Build distribution artifacts
88-
run: uv build
89-
- name: Log in to CodeArtifact for publishing
90-
run: >-
91-
aws codeartifact login
92-
--tool twine
93-
--domain datalogics
94-
--domain-owner 304774597385
95-
--repository cit-pypi
96-
--region us-east-2
90+
run: uv build --python 3.11
9791
- name: Publish package to CodeArtifact
98-
run: uv tool run --from twine twine upload --non-interactive --skip-existing dist/*
92+
run: uv publish --index cit-pypi

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,12 @@ sort_first = ["project", "build-system"]
112112
spaces_before_inline_comment = 2
113113
spaces_indent_inline_array = 4
114114
trailing_comma_inline_array = true
115+
116+
[tool.uv]
117+
keyring-provider = "subprocess"
118+
119+
[[tool.uv.index]]
120+
name = "cit-pypi"
121+
url = "https://aws@datalogics-304774597385.d.codeartifact.us-east-2.amazonaws.com/pypi/cit-pypi/simple/"
122+
publish-url = "https://aws@datalogics-304774597385.d.codeartifact.us-east-2.amazonaws.com/pypi/cit-pypi/"
123+
username = "__token__"

0 commit comments

Comments
 (0)