Publish To TestPyPI #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: Publish To TestPyPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade pip build twine | |
| - name: Build source distribution | |
| run: python -m build --sdist | |
| - name: Check source distribution | |
| run: python -m twine check dist/* | |
| - name: Upload source distribution | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-sdist | |
| path: dist/ | |
| build-wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.23.3 | |
| env: | |
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" | |
| CIBW_SKIP: "*-musllinux_* *-manylinux_i686 *-win32" | |
| CIBW_TEST_COMMAND: 'python -c "import arda; print(''arda OK'')"' | |
| - name: Upload wheel artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-wheels-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| publish-testpypi: | |
| name: Publish To TestPyPI | |
| needs: [build-sdist, build-wheels] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: python-* | |
| merge-multiple: true | |
| path: dist/ | |
| - name: List distributions | |
| run: ls -R dist/ | |
| - name: Publish distributions to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |