Publish to PyPI #86
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: Publish to PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: choice | |
description: Version to bump | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.NANOME_BOT_PAT }} | |
- name: Install Python 3 | |
uses: actions/setup-python@v1 | |
- name: Install Dependencies | |
run: | | |
python -m pip install bump2version setuptools wheel twine | |
- name: Bump Version | |
run: | | |
git config --global user.name 'nanome-bot' | |
git config --global user.email '45469149+nanome-bot@users.noreply.github.com' | |
bump2version ${{ github.event.inputs.version }} | |
git push --follow-tags | |
- name: Build and Publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
(cd plugin-template && zip -9r ../nanome/plugin-template.zip .) | |
python setup.py sdist | |
python setup.py bdist_wheel --universal | |
twine upload dist/* |