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

ci: Use PyPI trusted publishing #1077

Merged
merged 1 commit into from
Jan 15, 2024
Merged
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
25 changes: 13 additions & 12 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ on:

jobs:
publish:
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
pkg_version: ${{ steps.semver.outputs.next }}

Expand Down Expand Up @@ -99,18 +102,7 @@ jobs:
echo "Using version $PKG_VERSION_STRICT"
sed -i -r -e "s/^__version__ += '.*'$/__version__ = '$PKG_VERSION_STRICT'/" xml2rfc/__init__.py
python -m build --sdist

- name: Publish to Test PyPI
if: env.SHOULD_DEPLOY != 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: |
echo "Using repository $TWINE_REPOSITORY_URL"
twine check dist/*
twine upload --verbose dist/*


- name: Update CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
Expand Down Expand Up @@ -150,6 +142,15 @@ jobs:
setup.cfg
xml2rfc/__init__.py

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: env.SHOULD_DEPLOY == 'true'
uses: pypa/gh-action-pypi-publish@release/v1

build-base:
runs-on: ubuntu-latest
if: github.event.inputs.publish
Expand Down
Loading