Autoupdate pre-commit hooks (#1239) #941
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: Publish | |
on: push | |
jobs: | |
build: | |
name: Build the package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Build a binary wheel and a source tarball | |
run: uv build | |
- name: Upload dist directory | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
publish: | |
name: Publish the package | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Publish TorchIO to PyPI if commit is tagged | |
# Publish only tagged commits | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 |