Skip to content

Add CI jobs

Add CI jobs #3

Workflow file for this run

name: PyPi
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dist:
name: Distribution build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
publish-test:
name: Upload release to TestPyPI
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'published'
needs:
- dist
environment:
name: testpypi
url: https://test.pypi.org/p/torchhull
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish:
name: Upload release to PyPI
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'published'
needs:
- publish-test
environment:
name: pypi
url: https://pypi.org/p/torchhull
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
check_pypi:
if: always()
needs:
- dist
- publish-test
- publish
name: "Check PyPI"
runs-on: ubuntu-22.04
steps:
- uses: re-actors/alls-green@release/v1
with:
allowed-skips: publish-test, publish
jobs: ${{ toJSON(needs) }}