Upload Python Package #61
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 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: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| version_bump: | |
| description: 'The version portion to increment' | |
| required: true | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| workflow_call: | |
| inputs: | |
| version_bump: | |
| description: "The version portion to increment" | |
| required: true | |
| type: string | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| python-version: "3.11" | |
| activate-environment: pubenv | |
| auto-activate-base: false | |
| - name: Install dependencies | |
| run: | | |
| conda install -y -c conda-forge scikit-learn pandas numpy statsmodels dcor sympy matplotlib cyipopt | |
| - name: Conda info | |
| run: conda info | |
| - name: Conda list | |
| run: conda list | |
| - name: Build and publish | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPIUID }} | |
| TWINE_PASSWORD: ${{ secrets.PYPIPWD }} | |
| run: | | |
| pip install build twine | |
| python -m build | |
| twine upload dist/* |