Deploy to PyPi #8438
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to PyPi | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: [ master ] | |
jobs: | |
build-and-deploy: | |
strategy: | |
fail-fast: false | |
matrix: | |
channel: ["Stable", "Beta", "Dev", "Canary"] | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up Python | |
uses: actions/setup-python@v5 | |
- | |
run: pip3 install -r requirements.txt | |
- | |
name: Search for new version | |
run: python3 updater.py ${{ matrix.channel }} | |
- | |
name: Install pypa/build | |
# only run if we found a new version | |
if: ${{ hashFiles('CURRENT_VERSION.txt') != '' }} | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- | |
name: Build a binary wheel and a source tarball | |
if: ${{ hashFiles('CURRENT_VERSION.txt') != '' }} | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- | |
name: Publish distribution to PyPI | |
if: ${{ hashFiles('CURRENT_VERSION.txt') != '' }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |