|
86 | 86 | - run: | |
87 | 87 | pytest -sv tests |
88 | 88 |
|
| 89 | + build_sdist: |
| 90 | + name: Build sdist |
| 91 | + runs-on: ubuntu-latest |
| 92 | + steps: |
| 93 | + - name: Checkout sources |
| 94 | + uses: actions/checkout@v5 |
| 95 | + with: |
| 96 | + submodules: true |
| 97 | + |
| 98 | + - name: Install Python |
| 99 | + uses: actions/setup-python@v6 |
| 100 | + with: |
| 101 | + python-version: "3.11" |
| 102 | + |
| 103 | + - name: Install pypa/build |
| 104 | + run: python -m pip install build |
| 105 | + - name: Build a binary wheel and a source tarball |
| 106 | + run: python -m build --sdist |
| 107 | + - name: Upload artifacts |
| 108 | + uses: actions/upload-artifact@v4 |
| 109 | + with: |
| 110 | + name: sdist |
| 111 | + path: dist/*.tar.gz |
| 112 | + |
89 | 113 | build_wheels: |
90 | 114 | name: Build wheels on ${{matrix.arch}} for ${{ matrix.os }} |
91 | 115 | runs-on: ${{ matrix.os }} |
@@ -144,22 +168,29 @@ jobs: |
144 | 168 | path: ./wheelhouse/*.whl |
145 | 169 |
|
146 | 170 | upload_wheels: |
147 | | - name: Upload wheels to PyPI |
148 | | - needs: build_wheels |
| 171 | + name: Upload wheels & sdist to PyPI |
| 172 | + needs: [build_sdist, build_wheels] |
149 | 173 | runs-on: ubuntu-latest |
150 | 174 | environment: pypi |
151 | 175 | permissions: |
152 | 176 | id-token: write |
153 | 177 |
|
154 | 178 | # Upload to PyPI on every tag starting with 'v' |
155 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |
| 179 | + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |
156 | 180 |
|
157 | 181 | steps: |
158 | 182 | - uses: actions/download-artifact@v4 |
159 | 183 | with: |
160 | 184 | path: dist |
161 | 185 | pattern: wheels-for-* |
162 | 186 | merge-multiple: true |
| 187 | + - uses: actions/download-artifact@v4 |
| 188 | + with: |
| 189 | + path: dist |
| 190 | + pattern: sdist |
| 191 | + merge-multiple: true |
163 | 192 |
|
164 | | - - name: Publish package distributions to PyPI |
165 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
| 193 | + - name: Check downloaded artifacts |
| 194 | + run: ls dist |
| 195 | + # - name: Publish package distributions to PyPI |
| 196 | + # uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments