summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2025-12-31 18:39:32 +0800
committerHsiangNianian <i@jyunko.cn>2025-12-31 18:39:32 +0800
commitb4c0f9f844c0a44c0ef2b7b46a70f5aae3779d6e (patch)
tree1a9ec52e67bbd465c148bef1e65faee2ac4a54f4
parent2164059395e962b1715fe0d3f46d8fc9f076eaab (diff)
downloadbase-model-b4c0f9f844c0a44c0ef2b7b46a70f5aae3779d6e.tar.gz
base-model-b4c0f9f844c0a44c0ef2b7b46a70f5aae3779d6e.zip
fix: restructure TestPyPI publishing step in workflow
-rw-r--r--.github/workflows/publish.yml38
1 files changed, 30 insertions, 8 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 088f0fa..71fd1ea 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -71,14 +71,6 @@ jobs:
uv pip install twine
uv run twine check dist/*
- - name: Publish to TestPyPI
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
- run: |
- uv run twine upload --repository testpypi --skip-existing --verbose dist/*
-
- uses: actions/upload-artifact@v4
with:
name: dist
@@ -101,6 +93,36 @@ jobs:
name: model-zip
path: model.zip
+ publish-testpypi:
+ name: Publish to TestPyPI
+ needs: build
+ runs-on: ubuntu-latest
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
+
+ environment:
+ name: test-pypi
+ url: https://test.pypi.org/p/${{ github.sha }}/
+
+ steps:
+ - name: Download dist
+ uses: actions/download-artifact@v4
+ with:
+ name: dist
+ path: dist/
+
+ - name: Install uv
+ run: |
+ curl -LsSf https://astral.sh/uv/install.sh | sh
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Publish to TestPyPI
+ env:
+ TWINE_USERNAME: __token__
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
+ run: |
+ uv pip install twine
+ uv run twine upload --repository testpypi --skip-existing --verbose dist/*
+
publish-pypi:
name: Publish to PyPI
needs: build