diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 5c51cae..cdd5285 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -244,11 +244,40 @@ jobs: asv machine --yes asv continuous --sort name --no-only-changed refs/remotes/origin/main ${{ github.sha }} | tee >(sed '1,/All benchmarks:/d' > $GITHUB_STEP_SUMMARY) + build-python-sdist: + needs: [run-python-tests, run-python-tests-with-address-sanitizer] + continue-on-error: false + runs-on: 'ubuntu-latest' + if: true + name: Build Python source distribution + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Copy README into place + run: cp README.md python/ + - name: Copy C++ code into place + run: rm -rfv python/src/cpp && cp -r cpp python/src + if: runner.os == 'Linux' + - name: Install build module + run: python -m pip install build + - name: Build source distribution + working-directory: python + run: python -m build --sdist --outdir ../dist + - uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: python-sdist + path: ./dist/*.tar.gz + build-python-wheels: needs: [run-python-tests, run-python-tests-with-address-sanitizer] runs-on: ${{ matrix.os }} continue-on-error: false - if: true # (github.event_name == 'release' && github.event.action == 'published') || contains(github.event.pull_request.labels.*.name, 'Also Test Wheels') + if: true strategy: matrix: include: @@ -420,15 +449,19 @@ jobs: defaults: run: working-directory: python - needs: [build-python-wheels, run-python-tests-with-address-sanitizer, run-python-tests] + needs: [build-python-wheels, build-python-sdist, run-python-tests-with-address-sanitizer, run-python-tests] runs-on: 'ubuntu-latest' - name: "Upload wheels to PyPI" + name: "Upload wheels and sdist to PyPI" if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: name: python-wheels path: dist + - uses: actions/download-artifact@v4 + with: + name: python-sdist + path: dist - uses: pypa/gh-action-pypi-publish@v1.4.2 with: user: __token__