Skip to content

Commit 7a1b299

Browse files
committed
Prepare workflows for trusted publishing
1 parent df8ce9b commit 7a1b299

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

.github/workflows/build-package-pypi.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ jobs:
1313
enable_dev_dependencies: 0
1414
runner: ubuntu-latest
1515
secrets:
16-
PYPI_USER: ${{ secrets.PYPI_USERNAME }}
17-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
1816
PYPI_HOST: pypi.org

.github/workflows/build-package-test-pypi.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ jobs:
1616
enable_dev_dependencies: 1
1717
runner: ubuntu-latest
1818
secrets:
19-
PYPI_USER: ${{ secrets.TEST_PYPI_USERNAME }}
20-
PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
2119
PYPI_HOST: test.pypi.org

.github/workflows/build-package.yaml

+5-9
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ on:
1818
required: true
1919

2020
env:
21-
PYPI_USER: ${{ secrets.PYPI_USER }}
22-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2321
PYPI_HOST: ${{ secrets.PYPI_HOST }}
2422
ENABLE_DEV_DEPENDENCIES: ${{ inputs.enable_dev_dependencies }}
2523

@@ -71,13 +69,11 @@ jobs:
7169
path: dist
7270

7371
- name: Publish SDK package to pypi
74-
run: |
75-
if [[ $PYPI_HOST = "test.pypi.org" ]]; then
76-
twine upload -r testpypi dist/* -u $PYPI_USER -p $PYPI_PASSWORD
77-
else
78-
twine upload dist/* -u $PYPI_USER -p $PYPI_PASSWORD
79-
fi
80-
72+
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
73+
if: ${{ secrets.PYPI_HOST == 'test.pypi.org' }}
74+
with:
75+
repository-url: https://test.pypi.org/
76+
verbose: true
8177

8278
- name: Clean up dist directory if it was created
8379
if: ${{ always() }}

0 commit comments

Comments
 (0)