From e543aac6ddf2d3795f453b323b1463d8ba1d2f5d Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Thu, 9 Jan 2025 01:21:23 +0300 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=94=91=20separate=20TestPyPI=20publ?= =?UTF-8?q?ishing=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-test.yml | 10 ++----- .github/workflows/publish-testpypi.yml | 41 ++++++++++++++++++++++++++ .github/workflows/publish.yml | 10 ++----- 3 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/publish-testpypi.yml diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml index 2b5818156..1fdac7368 100644 --- a/.github/workflows/publish-test.yml +++ b/.github/workflows/publish-test.yml @@ -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 diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml new file mode 100644 index 000000000..358dd61fd --- /dev/null +++ b/.github/workflows/publish-testpypi.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 41974fb6f..2c45d748b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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