Fixing pip install #225
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and upload to PyPI | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build wheels and src | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Install | |
run: python -m pip install build pytest --user | |
- name: Build wheels | |
run: python -m build --sdist --wheel | |
- name: Test wheel | |
run: python -m pytest | |
- name: upload wheel and src | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/ | |
upload_pypi: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: mint API token | |
id: mint | |
uses: tschm/[email protected] | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package distribution to PYPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ steps.mint.outputs.api-token }} |