Release #6
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: Release | |
| defaults: | |
| run: | |
| shell: bash -le {0} | |
| concurrency: | |
| group: ${{ github.ref }}-workflow-unit-tests | |
| cancel-in-progress: true | |
| env: | |
| RELEASE_MODE: 1 | |
| CI: 1 | |
| MAX_JOBS: 4 | |
| on: | |
| release: | |
| types: [ published ] | |
| repository_dispatch: | |
| workflow_dispatch: | |
| inputs: | |
| upload_pypi: | |
| description: 'upload to PyPI' | |
| type: boolean | |
| required: false | |
| default: false | |
| upload_release: | |
| description: 'upload to release (it only works with a tag ref)' | |
| type: boolean | |
| required: false | |
| default: false | |
| jobs: | |
| release-source: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| cache: 'pip' | |
| - name: Install requirements | |
| run: pip install pip build setuptools twine -U | |
| - name: Build package | |
| run: | | |
| python -m build --sdist | |
| twine check dist/* | |
| - name: Upload sdist to pypi | |
| if: (github.event_name == 'release' || github.event.inputs.upload_pypi == 'true') && !cancelled() | |
| env: | |
| TWINE_USERNAME: "__token__" | |
| TWINE_PASSWORD: ${{ secrets.PYPI_KEY }} | |
| run: | | |
| python -m twine upload dist/*gz | |
| release: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, macos-13, windows-latest ] | |
| py: [ '3.10', '3.11', '3.12', '3.13', '3.14' ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Codes | |
| uses: actions/checkout@v5 | |
| - name: Install requirements | |
| run: pip install pip build setuptools twine -U | |
| - name: Compile | |
| run: | | |
| python setup.py bdist_wheel | |
| - name: Test install | |
| run: | | |
| ls -ahl dist | |
| whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) | |
| echo "WHL_NAME=$whl" >> $GITHUB_ENV | |
| twine check dist/$whl | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| overwrite: true | |
| name: ${{ env.WHL_NAME }} | |
| path: dist/${{ env.WHL_NAME }} | |
| - name: Upload binaries to release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: github.event_name == 'release' || github.event.inputs.upload_release == 'true' && !cancelled() | |
| with: | |
| repo_name: ${{ env.repo }} | |
| tag: ${{ env.ref }} | |
| file: dist/${{ env.WHL_NAME }} | |
| file_glob: true | |
| overwrite: true |