Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
Update publish workflow to use new PyPI trusted publisher authentication system
  • Loading branch information
RalfG authored Sep 20, 2023
1 parent ef81466 commit dab7b15
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/psm-utils
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -17,15 +22,17 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip flit
pip install --editable .[dev]
python -m pip install --upgrade pip flit pytest
- name: Build
run: flit build

- name: Install
run: pip install dist/psm_utils-*.whl

- name: Test package
run: |
pytest
- name: Build and publish to PyPI
env:
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: flit publish
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit dab7b15

Please sign in to comment.