Skip to content

[CI]: pytest minimal versions in Py3.8 / Codecov support #3

[CI]: pytest minimal versions in Py3.8 / Codecov support

[CI]: pytest minimal versions in Py3.8 / Codecov support #3

Workflow file for this run

name: Publish distributions to PyPI
on:
pull_request:
push:
branches:
- main
tags:
- "v*"
env:
python-version: "3.12"
jobs:
build-n-publish:
name: Build and publish distributions to PyPI
if: github.repository == 'pvplabs/pvpltools'
runs-on: ubuntu-latest
environment: release
permissions:
# this permission is mandatory for trusted publishing
id-token: write
steps:
# Check out only a limited depth and then pull tags to save time
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install --upgrade twine
- name: Build packages
run: python -m build
- name: Check metadata verification
run: python -m twine check --strict dist/*
# only publish distribution to PyPI for tagged commits
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1