diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3f129b6f..7928c2fbd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,30 +10,23 @@ permissions: contents: read jobs: - publish: + deploy: runs-on: ubuntu-latest - + environment: release + permissions: + id-token: write steps: - - name: Check out the repository - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.x # Adjust the Python version as needed - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - - name: Build the package - run: | - python setup.py sdist bdist_wheel - - - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - twine upload dist/* + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - name: Install dependencies + run: | + pip install setuptools wheel build + - name: Build + run: | + python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1