Skip to content

PEP621 and hatch scripts #7

PEP621 and hatch scripts

PEP621 and hatch scripts #7

Workflow file for this run

name: release
on:
release:
types: [published]
workflow_dispatch:
inputs:
ref:
description: 'Tag to release'
required: true
permissions:
contents: read
jobs:
build-wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name == 'release' }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
if: ${{ github.event_name == 'workflow_dispatch' }}
- uses: actions/setup-python@v4
with:
python-version: "3.x"
run: python -m pip install hatch
- name: Build package
run: hatch build
- uses: actions/upload-artifact@v3
with:
path: dist/*
release:
name: Prepare release
runs-on: ubuntu-latest
needs: [build-wheel]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}