Skip to content

Commit cd21b97

Browse files
committed
ci: enable trusted PyPI publishing
2 parents bf233fe + 07612af commit cd21b97

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
release-on-pypi:
1414
name: Publish on PyPI
1515
runs-on: ubuntu-latest
16+
environment:
17+
name: pypi
18+
url: https://pypi.org/p/context-dev-haystack
19+
permissions:
20+
contents: read
21+
id-token: write
1622
steps:
1723
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1824
with:
@@ -32,7 +38,4 @@ jobs:
3238
run: hatch build
3339

3440
- name: Publish to PyPI
35-
env:
36-
HATCH_INDEX_USER: __token__
37-
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
38-
run: hatch publish -y
41+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Keep changes focused, add tests for behavior changes, and use Conventional Commi
3535

3636
## Releases
3737

38-
Maintainers publish releases by pushing a semantic version tag such as `v0.1.0`. The release workflow builds the source distribution and wheel, then publishes both to PyPI.
38+
Maintainers publish releases by pushing a semantic version tag such as `v0.1.0`. The release workflow builds the source distribution and wheel, then publishes both to PyPI through Trusted Publishing.

0 commit comments

Comments
 (0)