1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # This workflows will upload a Python Package using Twine when a release is created
- # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
- name: Upload Python Package
- on:
- release:
- types: [created]
- jobs:
- build:
- name: Build distribution 📦
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.x"
- - name: Install pypa/build
- run: >-
- python3 -m
- pip install
- build
- --user
- - name: Build a binary wheel and a source tarball
- run: python3 -m build
- - name: Store the distribution packages
- uses: actions/upload-artifact@v4
- with:
- name: python-package-distributions
- path: dist/
- deploy:
- permissions:
- id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
- runs-on: ubuntu-latest
- needs:
- - build
- name: >-
- Publish Python 🐍 distribution 📦 to PyPI
- environment:
- name: pypi
- url: https://pypi.org/p/pySwitchbot
- steps:
- - name: Download all the dists
- uses: actions/download-artifact@v4
- with:
- name: python-package-distributions
- path: dist/
- - name: Publish package distributions to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
|