Skip to content

pyproject.toml: fix path of the readme file (#1201) #607

pyproject.toml: fix path of the readme file (#1201)

pyproject.toml: fix path of the readme file (#1201) #607

# link: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: publish πŸ“¦ to PyPI
# Build on every branch push, tag push, and pull request change
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
build-sdist-n-wheel:
name: Build 🐍 distributions and wheels πŸ“¦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a source tarball and a binary wheel
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- uses: actions/upload-artifact@v4
with:
path: |
dist/*.tar.gz
dist/*.whl
upload-to-pypi:
name: Upload πŸ“¦ to (Test) PyPI
needs: [build-sdist-n-wheel]
runs-on: ubuntu-latest
if: github.repository_owner == 'insarlab' && github.event_name == 'push'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- name: Publish developed version πŸ“¦ to Test PyPI
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: false
verbose: true
- name: Publish released version πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true