Upload Python Package #2
This file contains hidden or 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
| # This workflow will automatically rebuild the types, bump the version number, commit the changes back to the master and upload the Python Package to PyPI | |
| name: Upload Python Package | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Semantic version to increase' | |
| required: true | |
| type: choice | |
| options: | |
| - 'major' | |
| - 'minor' | |
| - 'patch' | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Rebuild Klighd Types | |
| run: | | |
| python -m venv ls-env | |
| source ls-env/bin/activate | |
| pip install -r requirements.txt | |
| ./rebuild_types.sh | |
| hatch version ${{ inputs.version }} | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| - name: Build and Publish | |
| run: | | |
| python -m build | |
| python -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} | |