teleinfo-exporter/.github/workflows/pypi-build-version.yml

39 lines
935 B
YAML

name: Build Pypi Package
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4.1.1
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
- name: Build
run: python3 -m build
- uses: actions/upload-artifact@v4.3.1
with:
path: ./dist
name: dist
pypi-publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/teleinfo_exporter/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4.1.2
with:
path: ./dist
name: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1