Upload of packages to TestPyPI #11
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: | |
| name: Build distribution packages | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| # - ubuntu-24.04-arm <-- Error: PyPI does not accept 'aarch64'. | |
| # - macos-15 | |
| - macos-15-intel | |
| python-version: | |
| - '3.11' | |
| 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 distribution | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: python-${{ matrix.python-version }}-package-for-${{ matrix.os }} | |
| path: dist/ | |
| retention-days: 1 | |
| testpypi: | |
| name: Publish test distribution | |
| needs: | |
| - dist | |
| 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/ |