diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 0000000..0a47b19 --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,39 @@ +name: Publish to PyPI + +on: + push: + tags: ["v*"] + workflow_dispatch: + +jobs: + release-pypi: + name: Publish to PyPI + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/dyson-qc + permissions: + id-token: write + + steps: + - uses: actions/checkout@v2 + - name: Set up python "3.11" + uses: actions/setup-python@v2 + with: + python-version: "3.11" + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + - name: Install dyson + run: | + python -m pip install wheel + python -m pip install .[dev] + - name: Build wheel + run: | + python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true