From f34124c703d6c1b3370670afa08469bf9561aeee Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 11:20:24 -0400 Subject: [PATCH 1/7] ci: modify skpkg ci for libdiffpy --- .github/ISSUE_TEMPLATE/release_checklist.md | 38 ++++----- .../build-and-publish-docs-on-dispatch.yml | 50 ++++++++--- .github/workflows/matrix-and-codecov.yml | 84 +++++++++++++++---- .github/workflows/release-github-on-tag.yml | 10 ++- news/ci.rst | 26 ++++++ 5 files changed, 162 insertions(+), 46 deletions(-) create mode 100644 news/ci.rst diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 56c5fca..63e624b 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -1,41 +1,41 @@ --- name: Release -about: Checklist and communication channel for PyPI and GitHub release -title: "Ready for PyPI/GitHub release" +about: Checklist and communication channel for GitHub and conda-forge release +title: "Ready for GitHub/conda-forge release" labels: "release" assignees: "" --- -### PyPI/GitHub rc-release preparation checklist: +### GitHub rc-release preparation checklist: - [ ] All PRs/issues attached to the release are merged. - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. -- [ ] Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code. -- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally. +- [ ] Locally rendered documentation contains all appropriate pages and other human-written text is up-to-date with any changes in the code. - [ ] Installation instructions in the README, documentation, and the website are updated. -- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. - [ ] Grammar and writing quality are checked (no typos). -- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. -- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. +- [ ] `FALLBACK_VERSION` in `site_scons/fallback_version.py` is updated to `.post0`. Without this, the SCons build fails after tagging. +- [ ] `scons test` passes locally with the latest conda-forge compilers and dependencies. +- [ ] Dispatch matrix testing to test the release on all systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. Matrix testing also runs automatically on the tag and blocks the release if it fails. -Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: +Please tag the maintainer (e.g., @username) in the comment here when you are ready for the GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: -### PyPI/GitHub full-release preparation checklist: +### GitHub full-release preparation checklist: -- [ ] Create a new conda environment and install the rc from PyPI (`pip install ==??`) -- [ ] License information on PyPI is correct. -- [ ] Docs are deployed successfully to `https:///`. -- [ ] Successfully run all tests, tutorial examples or do functional testing. +- [ ] The rc GitHub release and its source tarball appear correctly on the releases page. +- [ ] Docs are deployed successfully to `https://www.diffpy.org/libdiffpy`. +- [ ] Successfully run all tests and do functional testing, e.g., with `diffpy.srreal` built against the rc. Please let the maintainer know that all checks are done and the package is ready for full release. ### conda-forge release preparation checklist: - + -- [ ] Ensure that the full release has appeared on PyPI successfully. -- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. +- [ ] Ensure that the full release has appeared on GitHub successfully. +- [ ] `version` and `sha256` of the GitHub source tarball are updated in `meta.yaml` in the feedstock. +- [ ] New package dependencies listed in `build.txt`, `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. +- [ ] `license_file` in `meta.yaml` points to `LICENSE.rst` (renamed from `LICENSE.txt`). - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. - [ ] Tag the maintainer for conda-forge release. @@ -43,5 +43,5 @@ Please let the maintainer know that all checks are done and the package is ready -- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. -- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. +- [ ] Install the released package from conda-forge and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, API references, and websites) is deployed without broken links or missing figures. diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml index 1d6992e..dfc69fd 100644 --- a/.github/workflows/build-and-publish-docs-on-dispatch.yml +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -3,16 +3,44 @@ name: Build and Publish Docs on Dispatch on: workflow_dispatch: -jobs: - get-python-version: - uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0 - with: - python_version: 0 +permissions: + contents: write +jobs: docs: - uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 - with: - project: libdiffpy - c_extension: true - headless: false - python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + + steps: + - name: Check out libdiffpy + uses: actions/checkout@v6 + with: + fetch-depth: 0 # Version is read from git tags + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: docs + channels: conda-forge + conda-remove-defaults: "true" + auto-update-conda: true + auto-activate-base: false + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install docs requirements + run: conda install --file requirements/docs.txt + + - name: Build documents + run: make -C docs html + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build/html diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml index 969d495..356438e 100644 --- a/.github/workflows/matrix-and-codecov.yml +++ b/.github/workflows/matrix-and-codecov.yml @@ -1,21 +1,77 @@ name: Matrix and Codecov +# Called by release-github-on-tag.yml so a failing test blocks the release. on: - # push: - # branches: - # - main - release: - types: - - prereleased - - published + workflow_call: + secrets: + CODECOV_TOKEN: + required: false workflow_dispatch: jobs: matrix-coverage: - uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: libdiffpy - c_extension: true - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, macos-15-intel] + defaults: + run: + shell: bash -l {0} + + steps: + - name: Check out libdiffpy + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + channels: conda-forge + conda-remove-defaults: "true" + auto-update-conda: true + auto-activate-base: false + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install requirements + run: >- + conda install + --file requirements/build.txt + --file requirements/conda.txt + --file requirements/tests.txt + + - name: Configure SCons for the conda environment + run: | + cat > sconscript.local <<'EOF' + Import('env') + import os + prefix = os.environ['CONDA_PREFIX'] + env.Replace(CXX=os.environ.get('CXX', os.path.join(prefix, 'bin', 'c++'))) + env.Prepend(CCFLAGS=['-isystem' + os.path.join(prefix, 'include')]) + env.Append(LIBPATH=os.path.join(prefix, 'lib')) + env.Append(LINKFLAGS='-Wl,-rpath,' + os.path.join(prefix, 'lib')) + EOF + + - name: Build and run C++ tests with coverage + run: scons build=coverage test + + - name: Generate coverage report + if: matrix.os == 'ubuntu-latest' + run: >- + gcovr --gcov-executable "$CONDA_PREFIX/bin/gcov" + --root . --filter 'build/coverage-.*/diffpy/' + --xml coverage.xml + + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v5 + with: + files: coverage.xml + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release-github-on-tag.yml b/.github/workflows/release-github-on-tag.yml index a551162..8a15be3 100644 --- a/.github/workflows/release-github-on-tag.yml +++ b/.github/workflows/release-github-on-tag.yml @@ -1,4 +1,4 @@ -name: Build Wheel and Release +name: Release on GitHub # Trigger on tag push or manual dispatch. # Tag and release privilege are verified inside the reusable workflow. @@ -19,8 +19,14 @@ jobs: secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + matrix-tests: + needs: [check-tag-privilege] + uses: ./.github/workflows/matrix-and-codecov.yml + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + release-github: - needs: [check-tag-privilege, check-pat-token-validity] + needs: [check-tag-privilege, check-pat-token-validity, matrix-tests] uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0 secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/news/ci.rst b/news/ci.rst new file mode 100644 index 0000000..6385ed3 --- /dev/null +++ b/news/ci.rst @@ -0,0 +1,26 @@ +**Added:** + +* + +**Changed:** + +* Run matrix testing with SCons on Ubuntu and macOS (arm64 and Intel) instead of the Python-only pytest matrix. +* Run matrix testing before every GitHub release and block the release if any test fails. +* Build and deploy docs with Sphinx directly instead of the Python-only scikit-package docs workflow. +* Update the release checklist for GitHub and conda-forge releases without PyPI. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From ae48804dcd2e2e5de93d75a6aff53b02b83f6b43 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 11:34:51 -0400 Subject: [PATCH 2/7] ci: publish the docs after a release succeeds --- .github/workflows/build-and-publish-docs-on-dispatch.yml | 3 +++ .github/workflows/release-github-on-tag.yml | 6 ++++++ news/ci.rst | 1 + 3 files changed, 10 insertions(+) diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml index dfc69fd..2928fff 100644 --- a/.github/workflows/build-and-publish-docs-on-dispatch.yml +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -1,6 +1,8 @@ name: Build and Publish Docs on Dispatch +# Called by release-github-on-tag.yml after a successful release. on: + workflow_call: workflow_dispatch: permissions: @@ -17,6 +19,7 @@ jobs: - name: Check out libdiffpy uses: actions/checkout@v6 with: + ref: ${{ github.ref }} # The release tag is recreated after the changelog update fetch-depth: 0 # Version is read from git tags - name: Initialize miniconda diff --git a/.github/workflows/release-github-on-tag.yml b/.github/workflows/release-github-on-tag.yml index 8a15be3..cbac8a4 100644 --- a/.github/workflows/release-github-on-tag.yml +++ b/.github/workflows/release-github-on-tag.yml @@ -30,3 +30,9 @@ jobs: uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0 secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + + docs-release: + needs: [release-github] + permissions: + contents: write + uses: ./.github/workflows/build-and-publish-docs-on-dispatch.yml diff --git a/news/ci.rst b/news/ci.rst index 6385ed3..43a7fa4 100644 --- a/news/ci.rst +++ b/news/ci.rst @@ -7,6 +7,7 @@ * Run matrix testing with SCons on Ubuntu and macOS (arm64 and Intel) instead of the Python-only pytest matrix. * Run matrix testing before every GitHub release and block the release if any test fails. * Build and deploy docs with Sphinx directly instead of the Python-only scikit-package docs workflow. +* Publish docs automatically after a successful GitHub release. * Update the release checklist for GitHub and conda-forge releases without PyPI. **Deprecated:** From 8e625c2788615cf3b1afd3a5ffe5902174dc3c5b Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 11:54:38 -0400 Subject: [PATCH 3/7] run news check on any PR --- .github/workflows/check-news-item.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index fc34d9f..e9a4b78 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -2,8 +2,6 @@ name: Check for News on: pull_request_target: - branches: - - main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main jobs: check-news-item: From 11ea2c73f75580fe5325a24651d25df935ad5613 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 15:22:03 -0400 Subject: [PATCH 4/7] ci: revert matrix-and-codecov.yml to the skpkg-migration version Co-Authored-By: Claude Opus 5.5 --- .github/workflows/matrix-and-codecov.yml | 84 ++++-------------------- 1 file changed, 14 insertions(+), 70 deletions(-) diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml index 356438e..969d495 100644 --- a/.github/workflows/matrix-and-codecov.yml +++ b/.github/workflows/matrix-and-codecov.yml @@ -1,77 +1,21 @@ name: Matrix and Codecov -# Called by release-github-on-tag.yml so a failing test blocks the release. on: - workflow_call: - secrets: - CODECOV_TOKEN: - required: false + # push: + # branches: + # - main + release: + types: + - prereleased + - published workflow_dispatch: jobs: matrix-coverage: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, macos-15-intel] - defaults: - run: - shell: bash -l {0} - - steps: - - name: Check out libdiffpy - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Initialize miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: test - channels: conda-forge - conda-remove-defaults: "true" - auto-update-conda: true - auto-activate-base: false - - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install requirements - run: >- - conda install - --file requirements/build.txt - --file requirements/conda.txt - --file requirements/tests.txt - - - name: Configure SCons for the conda environment - run: | - cat > sconscript.local <<'EOF' - Import('env') - import os - prefix = os.environ['CONDA_PREFIX'] - env.Replace(CXX=os.environ.get('CXX', os.path.join(prefix, 'bin', 'c++'))) - env.Prepend(CCFLAGS=['-isystem' + os.path.join(prefix, 'include')]) - env.Append(LIBPATH=os.path.join(prefix, 'lib')) - env.Append(LINKFLAGS='-Wl,-rpath,' + os.path.join(prefix, 'lib')) - EOF - - - name: Build and run C++ tests with coverage - run: scons build=coverage test - - - name: Generate coverage report - if: matrix.os == 'ubuntu-latest' - run: >- - gcovr --gcov-executable "$CONDA_PREFIX/bin/gcov" - --root . --filter 'build/coverage-.*/diffpy/' - --xml coverage.xml - - - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v5 - with: - files: coverage.xml - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: libdiffpy + c_extension: true + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 767958bb7a442e1ea48f24ec0435ade830c81488 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 15:23:51 -0400 Subject: [PATCH 5/7] rm matrix testing from release CI --- .github/workflows/release-github-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-github-on-tag.yml b/.github/workflows/release-github-on-tag.yml index cbac8a4..71b8bc2 100644 --- a/.github/workflows/release-github-on-tag.yml +++ b/.github/workflows/release-github-on-tag.yml @@ -26,7 +26,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} release-github: - needs: [check-tag-privilege, check-pat-token-validity, matrix-tests] + needs: [check-tag-privilege, check-pat-token-validity] uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0 secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} From e4b9ff0b586b0865fd0c0849c2ca03cd1e888538 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 15:24:32 -0400 Subject: [PATCH 6/7] rm matrix testing --- .github/workflows/release-github-on-tag.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release-github-on-tag.yml b/.github/workflows/release-github-on-tag.yml index 71b8bc2..5816ff3 100644 --- a/.github/workflows/release-github-on-tag.yml +++ b/.github/workflows/release-github-on-tag.yml @@ -19,12 +19,6 @@ jobs: secrets: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - matrix-tests: - needs: [check-tag-privilege] - uses: ./.github/workflows/matrix-and-codecov.yml - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - release-github: needs: [check-tag-privilege, check-pat-token-validity] uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0 From 5d15b53fd0c981b65d737aeb1db32e64efdd3370 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 15:37:34 -0400 Subject: [PATCH 7/7] ci: Use reusable workflow for doc publishing --- .../build-and-publish-docs-on-dispatch.yml | 53 ++++--------------- .github/workflows/release-github-on-tag.yml | 7 ++- news/ci.rst | 3 -- 3 files changed, 17 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml index 2928fff..1d6992e 100644 --- a/.github/workflows/build-and-publish-docs-on-dispatch.yml +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -1,49 +1,18 @@ name: Build and Publish Docs on Dispatch -# Called by release-github-on-tag.yml after a successful release. on: - workflow_call: workflow_dispatch: -permissions: - contents: write - jobs: - docs: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - - steps: - - name: Check out libdiffpy - uses: actions/checkout@v6 - with: - ref: ${{ github.ref }} # The release tag is recreated after the changelog update - fetch-depth: 0 # Version is read from git tags - - - name: Initialize miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: docs - channels: conda-forge - conda-remove-defaults: "true" - auto-update-conda: true - auto-activate-base: false + get-python-version: + uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0 + with: + python_version: 0 - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install docs requirements - run: conda install --file requirements/docs.txt - - - name: Build documents - run: make -C docs html - - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build/html + docs: + uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 + with: + project: libdiffpy + c_extension: true + headless: false + python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} diff --git a/.github/workflows/release-github-on-tag.yml b/.github/workflows/release-github-on-tag.yml index 5816ff3..b771e7c 100644 --- a/.github/workflows/release-github-on-tag.yml +++ b/.github/workflows/release-github-on-tag.yml @@ -29,4 +29,9 @@ jobs: needs: [release-github] permissions: contents: write - uses: ./.github/workflows/build-and-publish-docs-on-dispatch.yml + uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 + with: + project: libdiffpy + c_extension: true + headless: false + python_version: 0 diff --git a/news/ci.rst b/news/ci.rst index 43a7fa4..8197c60 100644 --- a/news/ci.rst +++ b/news/ci.rst @@ -4,9 +4,6 @@ **Changed:** -* Run matrix testing with SCons on Ubuntu and macOS (arm64 and Intel) instead of the Python-only pytest matrix. -* Run matrix testing before every GitHub release and block the release if any test fails. -* Build and deploy docs with Sphinx directly instead of the Python-only scikit-package docs workflow. * Publish docs automatically after a successful GitHub release. * Update the release checklist for GitHub and conda-forge releases without PyPI.