Skip to content

Commit

Permalink
CI: fix publishing to PyPI with 2FA (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw authored Nov 30, 2023
1 parent d736fba commit f466336
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ jobs:
build:

runs-on: 'ubuntu-latest'
environment: release
permissions:
contents: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
strategy:
matrix:
platform:
Expand Down Expand Up @@ -72,18 +78,14 @@ jobs:
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
# PyPI package
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine upload wheelhouse/*
- name: Build Python package
run: python -m build

- name: Publish Python package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/

# Documentation
- name: Setup Ubuntu
Expand Down

0 comments on commit f466336

Please sign in to comment.