diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 91ac915..7d3e591 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 @@ -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