Skip to content

release

release #4

Workflow file for this run

name: release
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Build package
run: |
hatch build
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- if: ${{ github.event_name != 'workflow_dispatch' }}
name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1