-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
Improvements to EPUPlayer release workflow and CLI consistency with smartem-workspace.
Workflow Improvements
1. Skip RC release when commit has stable release tag
When pushing a commit to main AND a tag simultaneously, two workflow runs currently trigger (RC + stable). Add detection to skip RC release if the commit already has a release tag:
if git tag --points-at HEAD | grep -q "^epuplayer-v"; then
echo "Commit has release tag, skipping RC"
SHOULD_RELEASE="false"
fi2. Version validation against __init__.py
Current workflow only validates tag version against pyproject.toml. Also validate against __init__.py to catch mismatches early:
INIT_VERSION=$(grep -m1 '__version__' $PACKAGE_DIR/smartem_epuplayer/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
if [[ "$TAG_VERSION" != "$INIT_VERSION" ]]; then
echo "Error: Tag version ($TAG_VERSION) does not match __init__.py version ($INIT_VERSION)"
exit 1
fiCLI Consistency (alignment with smartem-workspace)
3. Add --version / -V flag
Standard CLI convention. Currently epuplayer --version does nothing.
parser.add_argument(
"--version", "-V",
action="version",
version=f"%(prog)s {__version__}",
)4. Add --no-colors and --plain flags
Align with smartem-workspace output control flags for consistent UX across tools.
5. Add verbosity modes
Add -v / --verbose and -q / --quiet flags for controlling output verbosity, matching smartem-workspace patterns.
README Improvements
6. Add shields.io badges
[](https://pypi.org/project/smartem-epuplayer/)
[](https://pypi.org/project/smartem-epuplayer/)
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/release-epuplayer.yml)Files to modify
.github/workflows/release-epuplayer.yml- workflow improvementspackages/smartem-epuplayer/smartem_epuplayer/cli.py- CLI flagspackages/smartem-epuplayer/README.md- badges
Related Issues
- smartem-workspace: switch to shields.io badge and add --version flag #115 - smartem-workspace: shields.io badge + --version flag
- Add RC release workflow for smartem-workspace (align with epuplayer pattern) #122 - Add RC release workflow for smartem-workspace
These issues should be tackled together for consistent CLI UX and workflow patterns across both packages.