Skip to content

Commit 20c78b5

Browse files
authored
Merge pull request #77 from canonical/work/trusted-publishing
ci: use Trusted Publishing for PyPI releases
2 parents f9847e9 + 160c1d3 commit 20c78b5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/release-publish.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ jobs:
3636
path: dist/
3737
pypi:
3838
needs: ["source-wheel"]
39-
runs-on: ubuntu-latest
39+
runs-on: [self-hosted, jammy, amd64]
40+
permissions:
41+
# IMPORTANT: this permission is mandatory for trusted publishing
42+
id-token: write
4043
steps:
4144
- name: Get packages
4245
uses: actions/download-artifact@v4
4346
with:
4447
name: pypi-packages
4548
path: dist/
4649
- name: Publish to pypi
50+
# Note: this action uses PyPI's support for Trusted Publishers
51+
# It needs a configuration on the PyPI project - see:
52+
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/#github-actions
4753
uses: pypa/gh-action-pypi-publish@release/v1
48-
with:
49-
password: ${{ secrets.PYPI_API_TOKEN }}
5054
github-release:
5155
needs: ["source-wheel"]
5256
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)