Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare workflows for trusted publishing #574

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build-package-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ jobs:
enable_dev_dependencies: 0
runner: ubuntu-latest
secrets:
PYPI_USER: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_HOST: pypi.org
2 changes: 0 additions & 2 deletions .github/workflows/build-package-test-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ jobs:
enable_dev_dependencies: 1
runner: ubuntu-latest
secrets:
PYPI_USER: ${{ secrets.TEST_PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
PYPI_HOST: test.pypi.org
18 changes: 5 additions & 13 deletions .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ on:
required: true
type: string
secrets:
PYPI_USER:
required: true
PYPI_PASSWORD:
required: true
PYPI_HOST:
required: true

env:
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_HOST: ${{ secrets.PYPI_HOST }}
ENABLE_DEV_DEPENDENCIES: ${{ inputs.enable_dev_dependencies }}

Expand Down Expand Up @@ -71,13 +65,11 @@ jobs:
path: dist

- name: Publish SDK package to pypi
run: |
if [[ $PYPI_HOST = "test.pypi.org" ]]; then
twine upload -r testpypi dist/* -u $PYPI_USER -p $PYPI_PASSWORD
else
twine upload dist/* -u $PYPI_USER -p $PYPI_PASSWORD
fi

uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
if: ${{ PYPI_HOST == 'test.pypi.org' }}
with:
repository-url: https://test.pypi.org/
verbose: true

- name: Clean up dist directory if it was created
if: ${{ always() }}
Expand Down
Loading