Skip to content

Commit 8c5c982

Browse files
sameeulclaude
andauthored
ci: migrate from versioneer to release-please + setuptools-scm (#343)
* ci: migrate from versioneer to release-please + setuptools-scm Replaces the manual release process (update two files, push a tag) with an automated release-please workflow that: - Creates release PRs with CHANGELOG on conventional commits to main - Tags, updates plugin.json / src/nyx/version.h / .version via ci-utils/sync_version.py, and dispatches all four publish workflows (PyPI CPU, CUDA 11, CUDA 12, Docker) on merge Version management changes: - Remove versioneer.py and versioneer-generated _version.py - Add pyproject.toml with setuptools-scm (version derived from git tags) - Add .version, .release-please-manifest.json, release-please-config.json - Extend ci-utils/sync_version.py to also update .version file - Update setup.py to use setuptools_scm.get_version() instead of versioneer - Update environment.yml: replace versioneer with setuptools-scm>=8 Workflow changes: - Add .github/workflows/release-please.yml (new) - All publish_*.yml: remove release: published trigger (now dispatched by release-please); add fetch-depth/fetch-tags + version verification - All build_*_wheels.yml: add fetch-depth/fetch-tags + sync_version step Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: migrate from versioneer to release-please + setuptools-scm * fix: update __init__.py to use setuptools-scm _version format Replace versioneer's get_versions()['version'] API with the simpler __version__ string written by setuptools-scm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 72b950d commit 8c5c982

20 files changed

Lines changed: 609 additions & 2960 deletions

.github/workflows/build_cuda11_wheels.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ jobs:
105105
name: Check out
106106
with:
107107
submodules: recursive
108+
fetch-depth: 0
109+
fetch-tags: true
110+
111+
- name: Fetch git tags
112+
run: git fetch --force --tags
113+
114+
- name: Update version files
115+
run: |
116+
python -m pip install setuptools-scm
117+
python ci-utils/sync_version.py
118+
python -m setuptools_scm
119+
shell: bash
108120

109121
- name: Download prereqs
110122
uses: actions/download-artifact@v4

.github/workflows/build_cuda12_wheels.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ jobs:
164164
name: Check out
165165
with:
166166
submodules: recursive
167+
fetch-depth: 0
168+
fetch-tags: true
169+
170+
- name: Fetch git tags
171+
run: git fetch --force --tags
172+
173+
- name: Update version files
174+
run: |
175+
python -m pip install setuptools-scm
176+
python ci-utils/sync_version.py
177+
python -m setuptools_scm
178+
shell: bash
167179

168180
- name: Download prereqs
169181
uses: actions/download-artifact@v4
@@ -249,6 +261,19 @@ jobs:
249261
name: Check out
250262
with:
251263
submodules: recursive
264+
fetch-depth: 0
265+
fetch-tags: true
266+
267+
- name: Fetch git tags
268+
run: git fetch --force --tags
269+
shell: bash
270+
271+
- name: Update version files
272+
run: |
273+
python -m pip install setuptools-scm
274+
python ci-utils/sync_version.py
275+
python -m setuptools_scm
276+
shell: bash
252277

253278
- name: Download prereqs
254279
uses: actions/download-artifact@v4

.github/workflows/build_wheels.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,16 @@ jobs:
346346
name: Check out
347347
with:
348348
submodules: recursive
349+
fetch-depth: 0
350+
fetch-tags: true
351+
- name: Fetch git tags
352+
run: git fetch --force --tags
353+
- name: Update version files
354+
run: |
355+
python -m pip install setuptools-scm
356+
python ci-utils/sync_version.py
357+
python -m setuptools_scm
358+
shell: bash
349359
- name: Download prereqs
350360
uses: actions/download-artifact@v4
351361
with:
@@ -399,6 +409,16 @@ jobs:
399409
name: Check out
400410
with:
401411
submodules: recursive
412+
fetch-depth: 0
413+
fetch-tags: true
414+
- name: Fetch git tags
415+
run: git fetch --force --tags
416+
- name: Update version files
417+
run: |
418+
python -m pip install setuptools-scm
419+
python ci-utils/sync_version.py
420+
python -m setuptools_scm
421+
shell: bash
402422
- name: Download prereqs
403423
uses: actions/download-artifact@v4
404424
with:
@@ -452,6 +472,17 @@ jobs:
452472
name: Check out
453473
with:
454474
submodules: recursive
475+
fetch-depth: 0
476+
fetch-tags: true
477+
- name: Fetch git tags
478+
run: git fetch --force --tags
479+
shell: bash
480+
- name: Update version files
481+
run: |
482+
python -m pip install setuptools-scm
483+
python ci-utils/sync_version.py
484+
python -m setuptools_scm
485+
shell: bash
455486
- name: Download prereqs
456487
uses: actions/download-artifact@v4
457488
with:
@@ -503,6 +534,16 @@ jobs:
503534
name: Check out
504535
with:
505536
submodules: recursive
537+
fetch-depth: 0
538+
fetch-tags: true
539+
- name: Fetch git tags
540+
run: git fetch --force --tags
541+
- name: Update version files
542+
run: |
543+
python -m pip install setuptools-scm
544+
python ci-utils/sync_version.py
545+
python -m setuptools_scm
546+
shell: bash
506547
- name: Download prereqs
507548
uses: actions/download-artifact@v4
508549
with:
@@ -571,6 +612,17 @@ jobs:
571612
steps:
572613
- uses: actions/checkout@v3
573614
name: Check out
615+
with:
616+
fetch-depth: 0
617+
fetch-tags: true
618+
- name: Fetch git tags
619+
run: git fetch --force --tags
620+
- name: Update version files
621+
run: |
622+
python -m pip install setuptools-scm
623+
python ci-utils/sync_version.py
624+
python -m setuptools_scm
625+
shell: bash
574626
- name: Download prereqs
575627
uses: actions/download-artifact@v4
576628
with:

.github/workflows/publish_cuda11_pypi.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Publish CUDA 11 to PyPi
22

33
on:
4-
release:
5-
types: [published]
6-
74
workflow_dispatch:
85

96
concurrency:
@@ -66,6 +63,22 @@ jobs:
6663
name: Check out
6764
with:
6865
submodules: recursive
66+
fetch-depth: 0
67+
fetch-tags: true
68+
69+
- name: Fetch git tags
70+
run: git fetch --force --tags
71+
72+
- name: Verify version detection
73+
run: |
74+
python -m pip install setuptools-scm
75+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
76+
echo "Release build on tag $GITHUB_REF_NAME"
77+
else
78+
python ci-utils/sync_version.py
79+
fi
80+
python -m setuptools_scm
81+
shell: bash
6982

7083
- name: Download prereqs
7184
uses: actions/download-artifact@v4

.github/workflows/publish_cuda12_pypi.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Publish CUDA 12 to PyPi
22

33
on:
4-
release:
5-
types: [published]
6-
74
workflow_dispatch:
85

96
concurrency:
@@ -92,6 +89,22 @@ jobs:
9289
name: Check out
9390
with:
9491
submodules: recursive
92+
fetch-depth: 0
93+
fetch-tags: true
94+
95+
- name: Fetch git tags
96+
run: git fetch --force --tags
97+
98+
- name: Verify version detection
99+
run: |
100+
python -m pip install setuptools-scm
101+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
102+
echo "Release build on tag $GITHUB_REF_NAME"
103+
else
104+
python ci-utils/sync_version.py
105+
fi
106+
python -m setuptools_scm
107+
shell: bash
95108

96109
- name: Download prereqs
97110
uses: actions/download-artifact@v4
@@ -169,6 +182,18 @@ jobs:
169182
name: Check out
170183
with:
171184
submodules: recursive
185+
fetch-depth: 0
186+
fetch-tags: true
187+
188+
- name: Fetch git tags
189+
run: git fetch --force --tags
190+
shell: bash
191+
192+
- name: Verify version detection
193+
run: |
194+
python -m pip install setuptools-scm
195+
python -m setuptools_scm
196+
shell: bash
172197

173198
- name: Download prereqs
174199
uses: actions/download-artifact@v4

.github/workflows/publish_docker.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Publish Docker image
22
on:
3-
release:
4-
types: [published]
53
workflow_dispatch:
64

75
env:
@@ -27,6 +25,11 @@ jobs:
2725
- uses: actions/checkout@v3
2826
with:
2927
submodules: recursive
28+
fetch-depth: 0
29+
fetch-tags: true
30+
31+
- name: Fetch git tags
32+
run: git fetch --force --tags
3033

3134
- name: Run Build Script
3235
working-directory: ${{github.workspace}}
@@ -38,12 +41,9 @@ jobs:
3841
run: |
3942
bash ci-utils/docker_copy_3rd_party_libs.sh ${{github.workspace}}/miniconda-for-nyxus/envs/nyxus-3.9
4043
41-
- name: Create Version File
42-
run: python setup.py --version| grep -v init > VERSION
43-
44-
- name: Set variable
44+
- name: Set version from .version file
4545
run: |
46-
VER=$(cat VERSION)
46+
VER=$(cat .version | tr -d '[:space:]')
4747
echo "VERSION=$VER" >> $GITHUB_ENV
4848
4949
- name: Log in to Docker Hub

.github/workflows/publish_pypi.yml

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Publish to PyPi
22

33
on:
4-
release:
5-
types: [published]
6-
74
workflow_dispatch:
85

96
concurrency:
@@ -166,6 +163,20 @@ jobs:
166163
name: Check out
167164
with:
168165
submodules: recursive
166+
fetch-depth: 0
167+
fetch-tags: true
168+
- name: Fetch git tags
169+
run: git fetch --force --tags
170+
- name: Verify version detection
171+
run: |
172+
python -m pip install setuptools-scm
173+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
174+
echo "Release build on tag $GITHUB_REF_NAME"
175+
else
176+
python ci-utils/sync_version.py
177+
fi
178+
python -m setuptools_scm
179+
shell: bash
169180
- name: Download prereqs
170181
uses: actions/download-artifact@v4
171182
with:
@@ -220,6 +231,20 @@ jobs:
220231
name: Check out
221232
with:
222233
submodules: recursive
234+
fetch-depth: 0
235+
fetch-tags: true
236+
- name: Fetch git tags
237+
run: git fetch --force --tags
238+
- name: Verify version detection
239+
run: |
240+
python -m pip install setuptools-scm
241+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
242+
echo "Release build on tag $GITHUB_REF_NAME"
243+
else
244+
python ci-utils/sync_version.py
245+
fi
246+
python -m setuptools_scm
247+
shell: bash
223248
- name: Download prereqs
224249
uses: actions/download-artifact@v4
225250
with:
@@ -276,6 +301,16 @@ jobs:
276301
name: Check out
277302
with:
278303
submodules: recursive
304+
fetch-depth: 0
305+
fetch-tags: true
306+
- name: Fetch git tags
307+
run: git fetch --force --tags
308+
shell: bash
309+
- name: Verify version detection
310+
run: |
311+
python -m pip install setuptools-scm
312+
python -m setuptools_scm
313+
shell: bash
279314
- name: Download prereqs
280315
uses: actions/download-artifact@v4
281316
with:
@@ -331,6 +366,20 @@ jobs:
331366
name: Check out
332367
with:
333368
submodules: recursive
369+
fetch-depth: 0
370+
fetch-tags: true
371+
- name: Fetch git tags
372+
run: git fetch --force --tags
373+
- name: Verify version detection
374+
run: |
375+
python -m pip install setuptools-scm
376+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
377+
echo "Release build on tag $GITHUB_REF_NAME"
378+
else
379+
python ci-utils/sync_version.py
380+
fi
381+
python -m setuptools_scm
382+
shell: bash
334383
- name: Download prereqs
335384
uses: actions/download-artifact@v4
336385
with:
@@ -403,6 +452,21 @@ jobs:
403452
steps:
404453
- uses: actions/checkout@v3
405454
name: Check out
455+
with:
456+
fetch-depth: 0
457+
fetch-tags: true
458+
- name: Fetch git tags
459+
run: git fetch --force --tags
460+
- name: Verify version detection
461+
run: |
462+
python -m pip install setuptools-scm
463+
if [[ "$GITHUB_REF_NAME" == v* ]]; then
464+
echo "Release build on tag $GITHUB_REF_NAME"
465+
else
466+
python ci-utils/sync_version.py
467+
fi
468+
python -m setuptools_scm
469+
shell: bash
406470
- name: Download prereqs
407471
uses: actions/download-artifact@v4
408472
with:

0 commit comments

Comments
 (0)