ci: 🔑 separate TestPyPI publishing workflows

This commit is contained in:
Onuralp SEZER 2025-01-09 01:21:23 +03:00
parent 3ee6de3ed3
commit e543aac6dd
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
3 changed files with 45 additions and 16 deletions

View File

@ -1,4 +1,4 @@
name: Publish Supervision Pre-Releases to PyPI and TestPyPI
name: Publish Supervision Pre-Releases to PyPI
on:
push:
@ -11,7 +11,7 @@ on:
permissions: {} # Explicitly remove all permissions by default
jobs:
build-and-publish-pre-release:
publish-pre-release:
name: Publish Pre-release Package
runs-on: ubuntu-latest
environment:
@ -43,9 +43,3 @@ jobs:
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
with:
attestations: true
- name: 🚀 Publish to Test-PyPi
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
with:
repository-url: https://test.pypi.org/legacy/
attestations: true

41
.github/workflows/publish-testpypi.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Publish Supervision Releases to TestPyPI
on:
workflow_dispatch:
permissions: {} # Explicitly remove all permissions by default
jobs:
publish-testpypi:
name: Publish Release Package
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/supervision/
timeout-minutes: 10
permissions:
id-token: write # Required for PyPI publishing
contents: read # Required for checkout
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a # v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: 🏗️ Build source and wheel distributions
run: |
uv pip install -r pyproject.toml --extra build
uv build
uv run twine check --strict dist/*
- name: 🚀 Publish to Test-PyPi
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
with:
repository-url: https://test.pypi.org/legacy/
attestations: true

View File

@ -1,4 +1,4 @@
name: Publish Supervision Releases to PyPI and TestPyPI
name: Publish Supervision Releases to PyPI
on:
push:
@ -9,7 +9,7 @@ on:
permissions: {} # Explicitly remove all permissions by default
jobs:
build-and-publish-release:
publish-release:
name: Publish Release Package
runs-on: ubuntu-latest
environment:
@ -41,9 +41,3 @@ jobs:
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
with:
attestations: true
- name: 🚀 Publish to Test-PyPi
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
with:
repository-url: https://test.pypi.org/legacy/
attestations: true