Update requirement #40
Workflow file for this run
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: | |
pull_request: | |
branches: [main] | |
types: [closed] | |
workflow_dispatch: | |
inputs: | |
version_no: | |
description: 'Release Version:' | |
required: true | |
jobs: | |
deploy: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Update setup.py if manual release | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
sed -i "s/version='[0-9]\{1,2\}.[0-9]\{1,4\}.[0-9]\{1,4\}',/version='${{github.event.inputs.version_no}}',/g" setup.py | |
- name: Create packages | |
run: | | |
python setup.py sdist | |
python setup.py bdist_wheel | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |