Skip to content

Commit 74f3123

Browse files
Do not rely on trusted publishing for PyPI upload (#145)
1 parent 370430c commit 74f3123

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/_pypi_publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ name: PyPI Publish
1010

1111
on:
1212
workflow_call:
13+
secrets:
14+
API_TOKEN:
15+
required: true
1316

1417
permissions: read-all
1518

@@ -35,4 +38,5 @@ jobs:
3538
- name: Publish package distributions to PyPI (optional - testpypi)
3639
uses: pypa/gh-action-pypi-publish@release/v1
3740
with:
41+
password: ${{ secrets.API_TOKEN }}
3842
repository-url: https://upload.pypi.org/legacy/

.github/workflows/_pypi_test_publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ name: PyPI Publish
1010

1111
on:
1212
workflow_call:
13+
secrets:
14+
API_TOKEN:
15+
required: true
1316

1417
permissions: read-all
1518

@@ -32,4 +35,5 @@ jobs:
3235
- name: Publish package distributions to PyPI (optional - testpypi)
3336
uses: pypa/gh-action-pypi-publish@release/v1
3437
with:
38+
password: ${{ secrets.API_TOKEN }}
3539
repository-url: https://test.pypi.org/legacy/

.github/workflows/cicd.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
types: [created]
1818

1919
concurrency:
20-
group: CICD-${{ github.ref }}
20+
group: ${{ github.workflow }}-${{ github.ref }}
2121
cancel-in-progress: true
2222

2323
jobs:
@@ -101,6 +101,8 @@ jobs:
101101
- CodeQL
102102
name: Upload current version to Test PyPI
103103
uses: ./.github/workflows/_pypi_test_publish.yaml
104+
secrets:
105+
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
104106

105107
## Upload the python-kraken-sdk to Production PyPI
106108
##
@@ -116,3 +118,5 @@ jobs:
116118
- CodeQL
117119
name: Upload the current release to PyPI
118120
uses: ./.github/workflows/_pypi_publish.yaml
121+
secrets:
122+
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)