Skip to content

Commit 8bc15e4

Browse files
committed
Adds GitHub Actions to publish full and light Docker images on tag.
1 parent a35e8bb commit 8bc15e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,17 @@ jobs:
217217
run: pip install setuptools-scm
218218

219219
- name: Generate _version.py
220-
run: python -m setuptools_scm write_version_to_file _version.py
220+
run: |
221+
python -c "import setuptools_scm; \
222+
import os; \
223+
# Get the version from setuptools_scm, using the current directory as root \
224+
# fallback_version is used if setuptools_scm cannot determine the version (e.g., no .git) \
225+
version = setuptools_scm.get_version(root='.', fallback_version='0.0.0+unknown'); \
226+
# Ensure the version string is clean for Python (remove leading 'v' if present) \
227+
if version.startswith('v'): version = version[1:]; \
228+
# Write the version to _version.py \
229+
with open('_version.py', 'w') as f: f.write(f\"__version__ = '{version}'\\n\"); \
230+
print(f\"Generated _version.py with __version__ = '{version}'\")"
221231
222232
- name: Get version from _version.py
223233
id: get_version

0 commit comments

Comments
 (0)