Upload of packages to TestPyPI #23
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: Upload of packages to TestPyPI | |
| on: | |
| workflow_dispatch: | |
| branches: | |
| - main | |
| jobs: | |
| dist-on-linux: | |
| name: Build distribution packages for Linux | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| python-version: | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install setuptools wheel build cython | |
| python -m pip install auditwheel | |
| - name: Build wheel and source tarball | |
| run: | | |
| python -m build | |
| auditwheel repair dist/softfloatpy-*.whl | |
| mv dist/softfloatpy-*.tar.gz wheelhouse/. | |
| - name: Store built wheel | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: python-${{ matrix.python-version }}-package-for-${{ matrix.os }} | |
| path: | | |
| wheelhouse/softfloatpy-*.whl | |
| wheelhouse/softfloatpy-*.tar.gz | |
| retention-days: 1 | |
| dist-on-macos: | |
| name: Build distribution packages for macOS | |
| strategy: | |
| matrix: | |
| os: | |
| # - macos-15 | |
| - macos-15-intel | |
| python-version: | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install setuptools wheel build cython | |
| - name: Build wheel and source tarball | |
| run: | | |
| python -m build | |
| - name: Store built wheel | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: python-${{ matrix.python-version }}-package-for-${{ matrix.os }} | |
| path: dist/softfloatpy-*.whl | |
| retention-days: 1 | |
| dist-on-windows: | |
| name: Build distribution packages for Windows | |
| strategy: | |
| matrix: | |
| os: | |
| - windows-2025 | |
| python-version: | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install setuptools wheel build cython | |
| - name: Build wheel and source tarball | |
| run: | | |
| python -m build | |
| - name: Store built wheel | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: python-${{ matrix.python-version }}-package-for-${{ matrix.os }} | |
| path: dist/softfloatpy-*.whl | |
| retention-days: 1 | |
| testpypi: | |
| name: Publish test distribution | |
| needs: | |
| - dist-on-linux | |
| - dist-on-macos | |
| - dist-on-windows | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/softfloatpy | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download distribution | |
| uses: actions/download-artifact@v7 | |
| with: | |
| pattern: python-*-package-for-* | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Publish distribution to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| verbose: true |