sdist #1
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: sdist | |
| # Builds and uploads the source distribution. Originally lived on Linux as a | |
| # workaround for early maturin versions that failed to produce sdists on | |
| # Windows; that's long since fixed, and the conda env activation on | |
| # `ubuntu-latest` keeps tripping `python -m pip` (`No module named pip`). | |
| # Run on `windows-11-arm` with the same NuGet-installed `pythonarm64` we use | |
| # for the arm64 release - sidesteps the miniconda activation entirely and | |
| # keeps build env identical to that release. | |
| on: | |
| release: | |
| types: | |
| - created | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Git ref (tag/branch/SHA) to build the sdist from. Defaults to the branch the workflow was dispatched on.' | |
| required: false | |
| default: '' | |
| jobs: | |
| sdist: | |
| name: sdist Py${{ matrix.PYTHON_VERSION }} | |
| runs-on: windows-11-arm | |
| timeout-minutes: 10 | |
| env: | |
| PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| PYTHON_VERSION: ["3.11"] | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - uses: nuget/setup-nuget@v4 | |
| with: | |
| nuget-version: '5.x' | |
| - name: Install Python via NuGet | |
| shell: bash -l {0} | |
| run: | | |
| nuget install pythonarm64 -Version $PYTHON_VERSION -Source https://api.nuget.org/v3/index.json -ExcludeVersion | |
| NUGET_PYTHON=$PWD/pythonarm64/tools/python.exe | |
| echo "NUGET_PYTHON=$NUGET_PYTHON" >> $GITHUB_ENV | |
| - name: Install twine/maturin | |
| shell: bash -l {0} | |
| # Pin twine >= 6.1 / pkginfo >= 1.12 so the upload accepts the | |
| # Metadata 2.4 `license-file` field emitted by current maturin. | |
| run: $NUGET_PYTHON -m pip install "twine>=6.1" "pkginfo>=1.12" maturin | |
| - name: Build sdist distribution | |
| shell: bash -l {0} | |
| run: $NUGET_PYTHON -m maturin sdist | |
| - name: Sanity check sdist | |
| shell: bash -l {0} | |
| run: $NUGET_PYTHON -m twine check target/wheels/*.tar.gz | |
| - name: Upload to PyPi | |
| shell: bash -l {0} | |
| env: | |
| TWINE_PASSWORD: ${{secrets.MATURIN_PASSWORD}} | |
| TWINE_USERNAME: ${{secrets.MATURIN_USERNAME}} | |
| run: $NUGET_PYTHON -m twine upload target/wheels/*.tar.gz |