Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
pre_commit_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: '3.10'

Expand Down
110 changes: 110 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Build, validate & Release

on:
push:
tags:
- 'v*.*.*'
pull_request:
branches:
- main
- public
types:
- labeled
- opened
- edited
- synchronize
- reopened

jobs:
build_check:
name: Build & validate package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12" ] # adjust to what you support
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

# If we use UV later, the lock file should be included here for caching and validation
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.cfg', 'setup.py', 'requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build twine wheel "packaging>=24.2"

- name: Build distributions (sdist + wheel)
run: python -m build

- name: Inspect dist
run: |
ls -lah dist/
echo "sdist contents (first ~200 entries):"
tar -tf dist/*.tar.gz | sed -n '1,200p'

- name: Twine metadata & README check
run: python -m twine check dist/*

- name: Install from wheel & smoke test
run: |
# Install from the built wheel (not from the source tree)
python -m pip install dist/*.whl

python - <<'PY'
import importlib
pkg_name = "dlclivegui" # change if your top-level import differs
m = importlib.import_module(pkg_name)
print("Imported:", m.__name__, "version:", getattr(m, "__version__", "n/a"))
PY

if ! command -v dlclivegui >/dev/null 2>&1; then
echo "CLI entry point 'dlclivegui' not found in PATH; skipping CLI smoke test."
else
echo "Running 'dlclivegui --help' smoke test..."
if ! dlclivegui --help >/dev/null 2>&1; then
echo "::error::'dlclivegui --help' failed; this indicates a problem with the installed CLI package."
exit 1
fi
fi

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build_check
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # only on tag pushes like v1.2.3
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
Comment on lines +91 to +94
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within this workflow, build_check uses actions/checkout@v6/setup-python@v6 but publish uses older majors. Aligning action major versions across jobs improves reproducibility and reduces maintenance overhead (or add a comment explaining why publish must remain on older majors).

Suggested change
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6

Copilot uses AI. Check for mistakes.
with:
python-version: "3.x"

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build twine

- name: Build distributions (sdist + wheel)
run: python -m build

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
run: python -m twine upload --verbose dist/*
Comment on lines +106 to +110
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing with a long-lived TWINE_API_KEY secret works, but it increases the blast radius if the token leaks. Consider switching to PyPI Trusted Publishing (OIDC) via pypa/gh-action-pypi-publish, which removes the need for storing PyPI API tokens in GitHub secrets and is the recommended approach for new release workflows.

Copilot uses AI. Check for mistakes.
File renamed without changes.
1 change: 1 addition & 0 deletions dlclivegui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
"CameraConfigDialog",
"main",
]
__version__ = "2.0.0rc0" # PLACEHOLDER
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__version__ is marked as # PLACEHOLDER. If release automation (or importlib.metadata.version) is expected to reflect the published version, this placeholder should be replaced with the real versioning strategy (or removed in favor of a single authoritative source).

Suggested change
__version__ = "2.0.0rc0" # PLACEHOLDER
__version__ = "2.0.0rc0"

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving open as reminder

Loading