diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 32f7ece5f3..77fe5f9423 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -10,8 +10,7 @@ on: inputs: {} jobs: - build: - name: Build Mitiq distribution + deploy: if: github.repository_owner == 'unitaryfund' runs-on: ubuntu-latest steps: @@ -23,32 +22,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Install dependencies for build + - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install build - - name: Build mitiq - run: python -m build - - name: Store build artifacts - uses: actions/upload-artifact@v4 - with: - name: build - path: dist/* - - publish: - name: Upload release to PyPi - runs-on: ubuntu-latest - needs: build - environment: - name: pypi - url: https://pypi.org/p/mitiq/ - permissions: - id-token: write - steps: - - name: Fetch build artifacts - uses: actions/download-artifact@v4 - with: - name: build - path: dist/ - - name: Publish package distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + make install requirements + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*