diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0d21482..6dde08c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,33 +29,28 @@ jobs: with: path: dist/*.tar.gz - build_wheels: - name: Wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + upload_release: + needs: [make_sdist] + environment: release + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - fetch-depth: 0 - - - uses: pypa/cibuildwheel@v2.22 + name: artifact + path: dist - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - path: wheelhouse/*.whl + - uses: pypa/gh-action-pypi-publish@release/v1 - upload_all: - needs: [build_wheels, make_sdist] - environment: release + upload_test: + needs: [make_sdist] + environment: testpypi permissions: id-token: write runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 @@ -65,6 +60,7 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: - # Remember to tell (test-)pypi about this repo before publishing - # Remove this line to publish to PyPI repository-url: https://test.pypi.org/legacy/ + # Only skip existing distributions on testpypi (not on pypi). + # See https://github.com/pypa/gh-action-pypi-publish?tab=readme-ov-file#tolerating-release-package-file-duplicates + skip-existing: true