PublishToTestPyPI #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PublishToTestPyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: Dry Run | |
required: false | |
default: false | |
type: boolean | |
env: | |
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
- name: Build | |
run: uv build | |
- name: Publish to TestPyPI | |
run: | | |
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then | |
package_name=$(ls dist | grep '\.tar\.gz' | head -n 1) | |
echo "Dry run mode: Skipping publish to TestPyPI. Package built: $package_name" | |
else | |
uv publish --publish-url https://test.pypi.org/legacy/ --token ${{ env.TEST_PYPI_TOKEN }} | |
fi |