PyPI #15
Workflow file for this run
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
| name: PyPI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| target: | |
| type: choice | |
| description: 'Package Index' | |
| required: true | |
| default: 'PYPI' | |
| options: [ 'TESTPYPI', 'PYPI' ] | |
| version: | |
| type: string | |
| description: 'Version tag' | |
| required: true | |
| default: '0.9.9' | |
| jobs: | |
| dist: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| python-version: [ "3.12" ] | |
| steps: | |
| - name: Checkout pyfolio | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.version }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Build wheels | |
| run: pipx run build | |
| - name: Store artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: dist/* | |
| - name: Check metadata | |
| run: pipx run twine check dist/* | |
| upload_pypi: | |
| needs: [ dist ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist | |
| - name: publish to testpypi | |
| if: ${{ github.event.inputs.target == 'TESTPYPI' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TESTPYPI_TOKEN }} | |
| repository-url: https://test.pypi.org/legacy/ | |
| - name: publish to pypi | |
| if: ${{ github.event.inputs.target == 'PYPI' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} |