Skip to content

Publish Python 🐍 distribution 📦 to PyPI and TestPyPI #13

Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

Publish Python 🐍 distribution 📦 to PyPI and TestPyPI #13

Workflow file for this run

name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
on:
workflow_dispatch:
jobs:
build:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
environment:
name: production
url: https://pypi.org/p/torch-log-wmse
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build and twine
run: |
python3 -m pip install build twine --user
- name: Build and publish torch-log-wmse-audio-quality
run: |
sed -i 's/name = .*/name = torch-log-wmse-audio-quality/' setup.cfg
python3 -m build
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ -u __token__ -p ${{ secrets.TEST_PYPI_API_KEY }} dist/*
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_KEY }} dist/*
- name: Build and publish torch-log-wmse
run: |
sed -i 's/name = .*/name = torch-log-wmse/' setup.cfg
python3 -m build
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ -u __token__ -p ${{ secrets.TEST_PYPI_API_KEY }} dist/*
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_KEY }} dist/*