Files
qmk_cli-mirror/.github/workflows/python-publish.yml
T
2021-07-07 20:14:04 -07:00

50 lines
1.4 KiB
YAML

# This workflow 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:
workflow_dispatch:
inputs:
version_part:
description: 'Which part of the version to increment (patch, minor, major)'
required: true
default: 'patch'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.7'
- name: Run ci_tests
run: ./ci_tests
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements-dev.txt
- name: Bump version
run: |
git config --local user.email "hello@qmk.fm"
git config --local user.name "QMK Bot"
bumpversion ${{ github.event.inputs.version_part }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
tags: true
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*