Skip to content

Commit 31a3cca

Browse files
committed
ci: πŸ‘· trusted publisher configuration added
Signed-off-by: Onuralp SEZER <[email protected]>
1 parent 787bbda commit 31a3cca

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

β€Ž.github/workflows/publish-test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Supervision Test Releases to PyPi
1+
name: Publish Supervision Pre-Releases to PyPI and TestPyPI
22
on:
33
push:
44
tags:
@@ -9,9 +9,11 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12-
build-n-publish:
12+
build-and-publish-pre-release-pypi:
1313
name: Build and publish to PyPI
1414
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write
1517
strategy:
1618
matrix:
1719
python-version: ["3.10"]
@@ -30,12 +32,11 @@ jobs:
3032
python -m pip install --upgrade build twine
3133
python -m build
3234
twine check --strict dist/*
35+
3336
- name: πŸš€ Publish to PyPi
3437
uses: pypa/gh-action-pypi-publish@release/v1.10
35-
with:
36-
password: ${{ secrets.PYPI_API_TOKEN }}
38+
3739
- name: πŸš€ Publish to Test-PyPi
3840
uses: pypa/gh-action-pypi-publish@release/v1.10
3941
with:
4042
repository-url: https://test.pypi.org/legacy/
41-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}

β€Ž.github/workflows/publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Supervision Releases to PyPi
1+
name: Publish Supervision Releases to PyPI and TestPyPI
22
on:
33
push:
44
tags:
@@ -7,8 +7,10 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
build-and-publish-pre-release:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
1214
strategy:
1315
matrix:
1416
python-version: ["3.10"]
@@ -27,12 +29,11 @@ jobs:
2729
python -m pip install --upgrade build twine
2830
python -m build
2931
twine check --strict dist/*
32+
3033
- name: πŸš€ Publish to PyPi
3134
uses: pypa/gh-action-pypi-publish@release/v1.10
32-
with:
33-
password: ${{ secrets.PYPI_API_TOKEN }}
35+
3436
- name: πŸš€ Publish to Test-PyPi
3537
uses: pypa/gh-action-pypi-publish@release/v1.10
3638
with:
3739
repository-url: https://test.pypi.org/legacy/
38-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}

0 commit comments

Comments
Β (0)