Build 📦 and release to TestPyPI #3
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: test_release | |
run-name: Build 📦 and release to TestPyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Select tag for which to do a test release" | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
verify-test: | |
uses: ./.github/workflows/verify_test.yml | |
verify-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Verify version number | |
run: | | |
python .github/workflows/version_manager.py none ${{ inputs.tag }} | |
publish: | |
needs: ["verify-test", "verify-version"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Build and Upload to TestPyPI | |
run: | | |
pip install build twine | |
python -m build | |
python3 -m twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TWINE_TEST_TOKEN }} | |
TWINE_REPOSITORY: testpypi |