Skip to content

Commit

Permalink
ci: πŸ”‘ separate TestPyPI publishing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
onuralpszr committed Jan 8, 2025
1 parent 3ee6de3 commit e543aac
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Supervision Pre-Releases to PyPI and TestPyPI
name: Publish Supervision Pre-Releases to PyPI

on:
push:
Expand All @@ -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:
Expand Down Expand Up @@ -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 changes: 41 additions & 0 deletions .github/workflows/publish-testpypi.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 2 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Supervision Releases to PyPI and TestPyPI
name: Publish Supervision Releases to PyPI

on:
push:
Expand All @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit e543aac

Please sign in to comment.