diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 9c4babf8..00000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: release - -on: - push: - tags: - - '*' - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - - run: pipx run build - - - run: twine check --strict dist/* - - - run: pipx run twine upload dist/* --disable-progress-bar - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b4ff6d8c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Publish release + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + tox -e release diff --git a/tox.ini b/tox.ini index ced401f8..bc3ad216 100644 --- a/tox.ini +++ b/tox.ini @@ -29,3 +29,12 @@ description = Build the Python package. commands = pyproject-build . twine check --strict dist/* + +[testenv:release] +description = Publish a new release on PyPI. +passenv = + TWINE_USERNAME + TWINE_PASSWORD +commands = + {[testenv:packaging]commands} + twine upload dist/* --disable-progress-bar --verbose