From ceff6453f17985c35683fbcaad49c5381736751d Mon Sep 17 00:00:00 2001 From: EmmaLien Date: Wed, 25 Nov 2026 02:13:03 +0000 Subject: [PATCH] Decouple production PyPI publishing from TestPyPI - publish-pypi now only needs test-and-build, so tpu-info-v* tag releases go straight from test-and-build to OSS Exit Gate. - publish-testpypi is skipped unless the repository variable ENABLE_TESTPYPI_PUBLISH is "true", until a TestPyPI Trusted Publisher can be added for tpu-info. - Manual workflow_dispatch runs are now dry runs: test-and-build runs and uploads the tpu-info-dist artifacts; nothing is published. - ci.yml also runs on changes under .github/workflows/, so workflow-only PRs run CI. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0481620..425ed21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,13 @@ on: - main paths: - "tpu_info/**" - - ".github/workflows/ci.yml" + - ".github/workflows/**" pull_request: branches: - main paths: - "tpu_info/**" - - ".github/workflows/ci.yml" + - ".github/workflows/**" workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fb22f4..62c588a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,8 @@ on: push: tags: - "tpu-info-v*" - # Manual runs only publish to TestPyPI (dry run); production PyPI requires a tag. + # Manual runs are dry runs: they test and build, and upload the wheel/sdist as + # workflow artifacts. Publishing to production PyPI requires a tpu-info-v* tag. workflow_dispatch: permissions: @@ -106,9 +107,14 @@ jobs: path: tpu_info/dist/ if-no-files-found: error + # Skipped until a TestPyPI Trusted Publisher can be added for tpu-info (the + # TestPyPI project is owned by a former maintainer). To re-enable, add the + # Trusted Publisher and set the repository variable ENABLE_TESTPYPI_PUBLISH to + # "true". Production releases do not depend on this job. publish-testpypi: name: Publish to TestPyPI needs: test-and-build + if: vars.ENABLE_TESTPYPI_PUBLISH == 'true' runs-on: ubuntu-latest environment: name: testpypi @@ -131,7 +137,7 @@ jobs: publish-pypi: name: Publish to Production PyPI - needs: [test-and-build, publish-testpypi] + needs: test-and-build if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest environment: