Skip to content
Merged
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
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Build and publish to PyPI on GitHub release creation or manual trigger.
# Uses OIDC trusted publishing — no stored PyPI token required.
# Pure Python package — a universal wheel suffices; no cibuildwheel needed.
#
# A manual run with dry_run ticked builds the sdist and wheel and smoke-tests the
# wheel, but does not publish to PyPI. Use it to check the release path.

name: Release

on:
release:
types: [created]
workflow_dispatch:
inputs:
dry_run:
description: "Dry run: build and smoke-test, but do not publish to PyPI"
type: boolean
default: false

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
Expand Down Expand Up @@ -67,9 +75,16 @@ jobs:
- name: Smoke test
run: python -c "import machinevisiontoolbox; print('OK', machinevisiontoolbox.__version__)"

- name: Note a dry run
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
run: |
echo "Dry run. The wheel built and passed the smoke test; nothing is published to PyPI." >> "$GITHUB_STEP_SUMMARY"

upload_pypi:
name: Publish to PyPI
needs: [build, smoke_test]
# skipped on a dry run; a release event has no inputs, so it always publishes
if: github.event_name != 'workflow_dispatch' || !inputs.dry_run
runs-on: ubuntu-latest
environment: pypi
permissions:
Expand Down
Loading