Repository navigation
Build and publish to PyPI #82
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: Build and publish to PyPI | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: "true" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build sdist | |
| run: python -m build --sdist --outdir dist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-source | |
| path: dist | |
| build-wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-15, macos-15-intel] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: "true" | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.0 | |
| with: | |
| output-dir: dist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.os }} | |
| path: dist | |
| publish-to-pypi: | |
| needs: [build-sdist, build-wheels] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/ms2pip | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - name: Move wheels to dist | |
| run: | | |
| mkdir dist/ | |
| mv dist-*/*.whl dist/ | |
| mv dist-*/*.tar.gz dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |