Skip to content

Refactor: classes for format checking (#119) #17

Refactor: classes for format checking (#119)

Refactor: classes for format checking (#119) #17

Workflow file for this run

name: Release to GitHub and PyPI
on:
workflow_dispatch:
push:
tags:
- "v[2-9].[0-9]+.[0-9]+"
- "v[2-9].[0-9]+.[0-9]+-pre[0-9]?"
jobs:
test:
uses: ./.github/workflows/tests.yml
release:
runs-on: ubuntu-latest
environment: release
needs: test
permissions:
# https://github.com/softprops/action-gh-release#permissions
contents: write
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install build dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ contains(github.ref, '-pre') }}
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true
skip-existing: true
verbose: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !contains(github.ref, '-pre') }}
with:
print-hash: true
- name: Release
id: release
uses: softprops/action-gh-release@v2
with:
files: |
./dist/*.whl
./dist/*.tar.gz
prerelease: ${{ contains(github.ref, '-pre') }}
generate_release_notes: ${{ !contains(github.ref, '-pre') }}