Deprecate scikit, simplify release process#527
Conversation
The ci_addons publish_github_release tool uses a latest/latest-tmp tag rename mechanism that causes race conditions when multiple CI runs execute concurrently. Replace with native gh release upload commands which are atomic and don't require the Python dependency. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace hardcoded DCMQI_VERSION_MAJOR/MINOR/PATCH in CMakeLists.txt with a new CMake module (dcmqiVersionFromGit) that extracts the version from the nearest v* git tag. Add release trigger to all workflows so creating a release in the GitHub UI automatically builds and attaches packages. Use fetch-depth: 0 for reliable git describe. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
There was a problem hiding this comment.
Pull request overview
This PR updates DCMQI’s versioning and release automation to remove the scikit-ci-addons dependency, deriving the project version from git tags and switching GitHub Actions publishing to the gh CLI.
Changes:
- Replace hard-coded
DCMQI_VERSION_{MAJOR,MINOR,PATCH}with a CMake module that extracts version components from git tags. - Update Linux/macOS/Windows CI workflows to run on
release.published, fetch full git history/tags, and publish release assets viagh release upload. - Remove
scikit-ci-addons-based GitHub release publishing logic from workflows.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CMakeLists.txt |
Switches version definition to be sourced from a git-tag extraction module. |
CMake/dcmqiVersionFromGit.cmake |
New module that parses vX.Y.Z git tags into DCMQI_VERSION_* components with a fallback. |
.github/workflows/cmake-win.yml |
Adds release trigger, fetches full history, and replaces scikit publishing with gh-based asset upload logic. |
.github/workflows/cmake-macos.yml |
Adds release trigger, fetches full history, and replaces scikit publishing with gh-based asset upload logic. |
.github/workflows/cmake-linux.yml |
Adds release trigger, fetches full history, and replaces scikit publishing with gh-based asset upload logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GA_TOKEN }} | ||
| run: | | ||
| pip install -U "scikit-ci-addons>=0.22.0" | ||
| # python -m scikit-ci publish --package-name dcmqi --package-version `git | ||
| # describe --tags --exact-match 2> /dev/null || echo "latest"` --platform linux | ||
| # --commit-range ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --repository ${{ github.event.pull_request.head.repo.full_name }} --token ${{ secrets.GITHUB_TOKEN }} --verbose | ||
| ci_addons publish_github_release qiicr/dcmqi \ | ||
| --release-packages "build/dcmqi-build/dcmqi-*-linux.tar.gz" \ | ||
| --prerelease-packages "build/dcmqi-build/dcmqi-*-linux-*.tar.gz" \ | ||
| --prerelease-packages-clear-pattern "dcmqi-*-linux-*" \ | ||
| --prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" \ | ||
| --exit-success-if-missing-token --token ${{ secrets.GA_TOKEN }} | ||
| TAG=$(git describe --tags --exact-match 2>/dev/null || echo "") | ||
| if [ -n "$TAG" ]; then | ||
| gh release upload "$TAG" \ | ||
| build/dcmqi-build/dcmqi-*-linux*.tar.gz \ | ||
| --clobber | ||
| else | ||
| gh release view latest --json assets --jq '.assets[].name' 2>/dev/null \ | ||
| | grep "dcmqi-.*-linux-" \ | ||
| | xargs -I{} gh release delete-asset latest "{}" --yes || true | ||
| gh release upload latest \ | ||
| build/dcmqi-build/dcmqi-*-linux*.tar.gz \ | ||
| --clobber | ||
| fi |
There was a problem hiding this comment.
The prior publishing logic used --exit-success-if-missing-token, but gh release upload/delete-asset will error and fail the workflow if GA_TOKEN isn’t available. If you still want pushes/PRs to pass even when publishing is not possible, add a check to skip this step when GH_TOKEN is unset/empty (or handle gh failures explicitly).
| if(NOT DEFINED DCMQI_VERSION_MAJOR) | ||
| message(WARNING "Could not extract version from git tag, using fallback version 0.0.0") | ||
| set(DCMQI_VERSION_MAJOR 0) | ||
| set(DCMQI_VERSION_MINOR 0) | ||
| set(DCMQI_VERSION_PATCH 0) | ||
| endif() |
There was a problem hiding this comment.
If the source tree is not a git checkout (e.g., building from a GitHub source tarball/zip or a vendored copy), this forces the project/package version to 0.0.0, which then propagates into install paths and CPACK package names. Consider falling back to a checked-in version file (or the previously defined version), and/or allowing a cache override (e.g., -DDCMQI_VERSION_{MAJOR,MINOR,PATCH}=...) without emitting a warning in the normal non-git release-tarball case.
| - name: Publish package | ||
| shell: pwsh | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GA_TOKEN }} | ||
| run: | | ||
| # Set longer timeout for HTTP operations in PowerShell | ||
| $PSDefaultParameterValues['*:TimeoutSec'] = 300 | ||
| pip install -U "scikit-ci-addons>=0.22.0" | ||
| ci_addons publish_github_release qiicr/dcmqi ` | ||
| --exit-success-if-missing-token ` | ||
| --release-packages "${{ github.workspace }}\b\dcmqi-build\dcmqi-*-win64.zip" ` | ||
| --prerelease-packages "${{ github.workspace }}\b\dcmqi-build\dcmqi-*-win64-*.zip" ` | ||
| --prerelease-packages-clear-pattern "dcmqi-*-win64-*" ` | ||
| --prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" ` | ||
| --token ${{ secrets.GA_TOKEN }} | ||
| TAG=$(git describe --tags --exact-match 2>/dev/null || echo "") | ||
| if [ -n "$TAG" ]; then | ||
| gh release upload "$TAG" \ | ||
| "${{ github.workspace }}/b/dcmqi-build"/dcmqi-*-win64*.zip \ | ||
| --clobber |
There was a problem hiding this comment.
This step runs under shell: bash on windows-2022, but it builds file paths using ${{ github.workspace }} (a Windows-style path) and mixes \ (download-artifact path) with / (upload glob). In Git Bash/MSYS, that frequently results in paths that don’t resolve, so gh release upload may not find any artifacts. Use a consistent path strategy for Bash on Windows (e.g., rely on $GITHUB_WORKSPACE + cygpath conversion, or use relative paths from the workspace), or keep this step in pwsh and call gh there.
| if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GA_TOKEN }} | ||
| run: | | ||
| pip install -U "scikit-ci-addons>=0.22.0" | ||
| ci_addons publish_github_release qiicr/dcmqi \ | ||
| --release-packages "${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac*.tar.gz" \ | ||
| --prerelease-packages ${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac*.tar.gz \ | ||
| --prerelease-packages-clear-pattern "dcmqi-*-mac-${{ matrix.arch }}-*" \ | ||
| --prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" \ | ||
| --exit-success-if-missing-token --token ${{ secrets.GA_TOKEN }} | ||
| TAG=$(git describe --tags --exact-match 2>/dev/null || echo "") | ||
| if [ -n "$TAG" ]; then | ||
| gh release upload "$TAG" \ | ||
| ${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac*.tar.gz \ | ||
| --clobber | ||
| else | ||
| # Clean old prerelease assets for this architecture, then upload new ones | ||
| gh release view latest --json assets --jq '.assets[].name' 2>/dev/null \ | ||
| | grep "dcmqi-.*-mac-${{ matrix.arch }}-" \ | ||
| | xargs -I{} gh release delete-asset latest "{}" --yes || true | ||
| gh release upload latest \ | ||
| ${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac*.tar.gz \ | ||
| --clobber | ||
| fi |
There was a problem hiding this comment.
The previous scikit-ci-addons invocation tolerated missing tokens (--exit-success-if-missing-token), but this gh release ... approach will fail the job if GA_TOKEN isn’t present/accessible (including misconfiguration scenarios). If the intent is to keep the workflow non-blocking when the token is unavailable, add an explicit guard that skips publishing when GH_TOKEN is empty/unset.
|
All four review comments have been addressed in commit 8210c4b:
|
No description provided.