Skip to content

Build and Publish

Build and Publish #96

Workflow file for this run

name: Build and Publish
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
schedule:
- cron: "0 0 * * SUN"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install hatch
run: pipx install hatch
- name: Build sdist and wheel
run: hatch build --clean
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: dist/
publish:
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
environment:
name: publish
url: https://pypi.org/p/clean-notebook
steps:
- uses: actions/download-artifact@v4
with:
name: build
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1