CSC API Pipeline – Release Process Guide
Infos regarding the build and release process for CSC API Pipeline project, including the needed process for prepping a new release
so that anyone in D2I team can manage releases.
Introduction
CSC API Pipeline packaged and released as versioned distribution with optional Windows executables
release is automated via Git Actions, but kcik off process initiated manually by running the helper script release.sh
inside a Codespace.
For consistency
- version numbers managed in pyproject.toml
- git tags eg v0.2.1
drive release workflow, so running release.sh
will increment release number
- git actions workflow release-and-docs.yml
(auto)handles the rest
What Gets Released
Included files
Release bundle constructed in 2 ways
1. PEP 517 build system – creates Python package (.tar.gz
and .whl
) inside dist/
contains only package code declared in pyproject.toml
and MANIFEST.in
2. Release bundle – convenience archive (release.zip
) built by release.sh
, containing
- Python distribution files dist/*
- README.md
for end‑user ref
- .env.example
sample environment config
- deployment helpers PowerShell and SQL scripts used in LA setup
- optional Windows .exe
built locally with PyInstaller
Excluded files
During packaging and bundling process explicitly exclude
- development caches __pycache__/
, .pytest_cache/
, .coverage/
- IDE files .vscode/
, .idea/
- build directories build/
, dist/
, old *.egg-info
- test artefacts not required in distribution
Full list of include/exclude rules maintained in
pyproject.toml
andMANIFEST.in
Update those to change Python package contents or adjustrelease.sh
to change wider release bundle
Release Versioning
Release follows semantic versioning (SemVer)
- MAJOR incompatible changes
- MINOR new functionality backwards compatible
- PATCH bug fixes or small updates
eg.
- 0.2.0
minor release with new features
- 0.2.1
patch release with bug fixes
- 1.0.0
stable release milestone
in practice
- tags always prefixed with v
, eg v0.2.1
- version in pyproject.toml
must match numeric form without v
, eg 0.2.1
- release.sh
keeps values in sync, updates pyproject.toml
, commits if required, applies git tag
Manifest and Packaging
Python packaging toolchain via build
respects two files
- pyproject.toml
project metadata name version dependencies
- MANIFEST.in
extra non‑code files to include, eg .env.example
, SQL scripts
combined definition controls what end‑user receives when installing from PyPI or unzipping release file
Overview (Mermaid)
Release Script release.sh
Entry point for dev/d2i, within repo root, & run from within Codespace (or Shell)
does the following
- confirm on
main
and working tree clean - prompt for new version default last tag + patch bump
- update
pyproject.toml
if version changed and commit - clean caches and previous build artefacts
- build package sdist + wheel, run metadata check, smoke test in fresh venv
- optionally build
.exe
if on Windows - create
release_bundle/
andrelease.zip
- prompt to tag and push
git push origin main
plus new tag
run via
chmod +x release.sh
./release.sh
when prompted - enter version or accept default - confirm push to origin to trigger Git Actions
git workflow release-and-docs.yml
then builds and publishes release automatically
Release Steps
- pull latest changes from
main
- run
./release.sh
- confirm version and tag push
- check git actions run
release-and-docs.yml
for success - validate published release artefacts
Troubleshooting
- workflow did not trigger -> tag must start with
v
, egv0.2.1
- version mismatch -> ensure
pyproject.toml
matches intended tag - artefacts missing -> check
MANIFEST.in
andrelease.sh
copy list - historic clutter -> old workflows and runs cleaned, only current release visible
Appendix: make release changes
- add or remove package files ->
pyproject.toml
andMANIFEST.in
- adjust bundle contents ->
release.sh
copy list torelease_bundle/
- change trigger logic or jobs ->
.github/workflows/release-and-docs.yml
- secret rotation and credentials -> repo or org secrets in Git settings (obv no secrets in repo!)