Skip to content

Commit

Permalink
CI: fix publishing to PyPI with 2FA (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw authored Nov 28, 2023
1 parent d87558c commit c56f596
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -19,15 +26,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine virtualenv
pip install build virtualenv
# PyPI package
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
python -m twine upload dist/*
- name: Build Python package
run: python -m build
- name: Publish Python package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Docuemntation
- name: Install doc dependencies
run: |
Expand Down

0 comments on commit c56f596

Please sign in to comment.