From 22d9faf916009416379c97b86a118cf3bc179d67 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Sat, 7 Nov 2026 17:56:55 -0800 Subject: [PATCH 1/2] ci: use shared workflow --- .../workflows/build-wheel-release-upload.yml | 61 ++++--------------- .github/workflows/build-wheels.yml | 60 ------------------ news/shared-cibuildwheel.rst | 23 +++++++ 3 files changed, 35 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/build-wheels.yml create mode 100644 news/shared-cibuildwheel.rst diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 87614f4..338d48a 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -1,7 +1,7 @@ name: Build Wheel and Release # Trigger on tag push or manual dispatch. -# Tag and release privilege are verified by the check-* jobs below. +# Tag and release privilege are verified inside the reusable workflow. on: workflow_dispatch: push: @@ -9,8 +9,8 @@ on: - "*" # ── Release modality ────────────────────────────────────────────────────────── -# Three options are provided below. Only ONE option should be active at a time. -# To switch: comment out the active jobs and uncomment your preferred option, +# Three options are provided below. Only ONE job should be active at a time. +# To switch: comment out the active job and uncomment your preferred option, # then commit the change to main before tagging a release. # ───────────────────────────────────────────────────────────────────────────── @@ -22,58 +22,21 @@ jobs: # release body, and the Sphinx documentation is rebuilt and deployed to # GitHub Pages. # - # The wheels come from build-wheels.yml rather than the shared - # scikit-package workflow: they link Boost and GSL statically, so they - # work without a conda environment. - check-tag-privilege: - uses: scikit-package/release-scripts/.github/workflows/_check-tag-privilege.yml@v0 + # The shared workflow builds the wheels with cibuildwheel using + # [tool.cibuildwheel] in pyproject.toml. + # TODO: switch to scikit-package/release-scripts@v0 once the cibuildwheel + # branch is merged and released there. + build-release: + uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibuildwheel with: + project: diffpy.srreal + submodules: recursive + c_extension: true maintainer_github_username: sbillinge - - check-pat-token-validity: - uses: scikit-package/release-scripts/.github/workflows/_check-pat-token-validity.yml@v0 - secrets: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - - check-pypi-token-validity: - uses: scikit-package/release-scripts/.github/workflows/_check-pypi-token-validity.yml@v0 secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - - get-python-version: - needs: - [check-tag-privilege, check-pat-token-validity, check-pypi-token-validity] - uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0 - - build-wheels: - needs: - [check-tag-privilege, check-pat-token-validity, check-pypi-token-validity] - uses: ./.github/workflows/build-wheels.yml - - release-github: - needs: [build-wheels] - uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0 - secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - # Uploads every artifact of this run: the sdist and all wheels. - release-pypi: - needs: [release-github, get-python-version] - uses: scikit-package/release-scripts/.github/workflows/_release-pypi.yml@v0 - with: - python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} - secrets: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - - docs-release: - needs: [release-github, get-python-version] - uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 - with: - submodules: recursive - project: diffpy.srreal - c_extension: true - python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} - # Option 2: Release to GitHub and deploy docs, without publishing to PyPI. # # A GitHub release is created and the Sphinx docs are deployed, but the diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml deleted file mode 100644 index a8c6ed1..0000000 --- a/.github/workflows/build-wheels.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Build Wheels - -# Builds the sdist and self-contained wheels (Boost and GSL linked -# statically, see [tool.cibuildwheel] in pyproject.toml). Called by the -# release workflow; run it manually to check the wheels before tagging. -on: - workflow_call: - workflow_dispatch: - -jobs: - build-sdist: - name: Build sdist - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v6 - with: - submodules: recursive - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.14" - - - name: Build sdist - run: | - python -m pip install --upgrade build - python -m build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: dist/*.tar.gz - - build-wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-15-intel - - macos-latest - - windows-latest - steps: - - name: Check out - uses: actions/checkout@v6 - with: - submodules: recursive - fetch-depth: 0 - - - name: Build and test wheels - uses: pypa/cibuildwheel@v4.3.5 - - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }} - path: wheelhouse/*.whl diff --git a/news/shared-cibuildwheel.rst b/news/shared-cibuildwheel.rst new file mode 100644 index 0000000..b31c8a3 --- /dev/null +++ b/news/shared-cibuildwheel.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Switched to shared wheel workflow. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From e1bd65a0d5669bda6691116a3515ad53df68be08 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Sun, 8 Nov 2026 16:25:50 -0800 Subject: [PATCH 2/2] ci: update workflow --- .github/workflows/build-wheel-release-upload.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 338d48a..c9ad51a 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -22,16 +22,17 @@ jobs: # release body, and the Sphinx documentation is rebuilt and deployed to # GitHub Pages. # - # The shared workflow builds the wheels with cibuildwheel using + # build_c_ext_with_cibw builds the wheels with cibuildwheel using # [tool.cibuildwheel] in pyproject.toml. - # TODO: switch to scikit-package/release-scripts@v0 once the cibuildwheel + # TODO: switch to scikit-package/release-scripts@v0 once the cibw # branch is merged and released there. build-release: - uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibuildwheel + uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibw with: project: diffpy.srreal submodules: recursive c_extension: true + build_c_ext_with_cibw: true maintainer_github_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}