release #29
Workflow file for this run
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: release | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Tag to release' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
# Needed for trusted publishing | |
permissions: | |
id-token: write | |
steps: | |
# Check out the repo | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'release' }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
# Setup python | |
- uses: actions/setup-python@v4 | |
# Build it | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m pip install hatch | |
hatch build | |
# Publish it | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |