ci: add workflow_dispatch to enable manual release publishing

This commit is contained in:
Pratik Bhadane
2026-04-01 21:16:00 +05:30
parent 45ee06f4fc
commit 139f7f26e0
+13 -7
View File
@@ -7,6 +7,12 @@ on:
branches: ["main"]
release:
types: [published]
workflow_dispatch:
inputs:
release:
description: "Simulate a release publish (runs build + publish jobs)"
type: boolean
default: true
permissions:
contents: read
@@ -133,7 +139,7 @@ jobs:
build-wheels-linux:
name: Build wheels (linux / py${{ matrix.python-version }})
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
strategy:
fail-fast: false
matrix:
@@ -158,7 +164,7 @@ jobs:
build-wheels-macos:
name: Build wheels (macos / py${{ matrix.python-version }})
runs-on: macos-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
strategy:
fail-fast: false
matrix:
@@ -188,7 +194,7 @@ jobs:
build-wheels-windows:
name: Build wheels (windows / py${{ matrix.python-version }})
runs-on: windows-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
strategy:
fail-fast: false
matrix:
@@ -217,7 +223,7 @@ jobs:
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
steps:
- uses: actions/checkout@v6
@@ -244,7 +250,7 @@ jobs:
- build-wheels-macos
- build-wheels-windows
- build-sdist
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
environment:
name: pypi
url: https://pypi.org/p/ferro-ta
@@ -313,7 +319,7 @@ jobs:
publish-cratesio:
name: Publish to crates.io
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
steps:
- uses: actions/checkout@v6
@@ -334,7 +340,7 @@ jobs:
name: Generate SBOM (Python + Rust)
runs-on: ubuntu-latest
needs: publish
if: github.event_name == 'release' && github.event.action == 'published'
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release)
permissions:
contents: write
id-token: write