mirror of https://github.com/saimn/sigal.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
|
|
|
on: |
|
pull_request: |
|
push: |
|
tags: |
|
- '*' |
|
|
|
jobs: |
|
build-n-publish: |
|
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
|
runs-on: ubuntu-latest |
|
environment: pypi |
|
permissions: |
|
id-token: write |
|
if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels')) |
|
|
|
steps: |
|
- uses: actions/checkout@v5 |
|
with: |
|
fetch-depth: 0 |
|
- uses: actions/setup-python@v6 |
|
with: |
|
python-version: "3.13" |
|
|
|
- name: Install python-build and twine |
|
run: python -m pip install build twine |
|
|
|
- name: Build package |
|
run: python -m build --sdist --wheel . |
|
|
|
- name: List result |
|
run: ls -l dist |
|
|
|
- name: Check long_description |
|
run: python -m twine check dist/* |
|
|
|
- name: Publish distribution 📦 to PyPI |
|
if: startsWith(github.ref, 'refs/tags') |
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|