Update pyproject.toml (#39) #181
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 | |
| concurrency: | |
| group: ${{ github.event.inputs.ref || github.ref }}-workflow-${{ github.event_name }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| release: | |
| types: [ published ] | |
| repository_dispatch: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Branch, Tag or Commit SHA' | |
| required: false | |
| default: '' | |
| pr_number: | |
| description: 'PR Number' | |
| required: false | |
| type: number | |
| 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 | |
| env: | |
| MAX_JOBS: 4 | |
| ref: ${{ github.event.inputs.ref || github.ref }} | |
| jobs: | |
| release-source: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'release' || github.event.inputs.upload_pypi == 'true') && !cancelled() | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ env.ref }} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| cache: 'pip' | |
| - name: Install requirements | |
| run: pip install pip build setuptools twine packaging -U | |
| - name: Build package | |
| run: | | |
| python -m build --sdist | |
| twine check dist/* | |
| - name: Upload source artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sources | |
| path: dist/*.tar.gz | |
| - 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 ] | |
| py: [ '3.14' ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Codes | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| ref: ${{ env.ref }} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.py }} | |
| cache: 'pip' | |
| - name: Add msbuild to PATH | |
| if: runner.os == 'Windows' | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Install requirements | |
| run: | | |
| which python | |
| python -V | |
| pip install build setuptools twine packaging -U | |
| - name: Compile | |
| run: | | |
| python -V | |
| python setup.py bdist_wheel | |
| - name: Test install | |
| shell: bash | |
| run: | | |
| python -V | |
| whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) | |
| echo "WHL_NAME=$whl" >> $GITHUB_ENV | |
| twine check dist/$whl | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.WHL_NAME }} | |
| path: dist/${{ env.WHL_NAME }} | |