|
20 | 20 | CIBW_BUILD_FRONTEND: build |
21 | 21 |
|
22 | 22 | jobs: |
23 | | - build-sdit: |
| 23 | + build-sdist: |
24 | 24 | name: Build source distribution |
25 | 25 |
|
26 | 26 | if: github.event_name == 'push' || ! github.event.pull_request.draft |
@@ -114,7 +114,7 @@ jobs: |
114 | 114 | build-arm64: |
115 | 115 | name: Build wheels on ${{ matrix.os }} (arm64) |
116 | 116 |
|
117 | | - # As this requires emulation, it's not worth running on PRs |
| 117 | + # As this requires emulation, it's not worth running on PRs or master |
118 | 118 | if: >- |
119 | 119 | github.event_name == 'push' && |
120 | 120 | startsWith(github.event.ref, 'refs/tags') |
@@ -189,26 +189,75 @@ jobs: |
189 | 189 | pipx run twine check --strict wheelhouse/* |
190 | 190 |
|
191 | 191 | publish: |
192 | | - name: Publish wheels |
| 192 | + name: Publish wheels and sdist |
193 | 193 |
|
194 | 194 | if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') |
195 | 195 | runs-on: ubuntu-latest |
196 | 196 | environment: pypi |
197 | 197 |
|
198 | | - needs: [check] |
| 198 | + needs: |
| 199 | + - build-sdist |
| 200 | + - build-x86_64 |
| 201 | + - build-arm64 |
199 | 202 |
|
200 | 203 | permissions: |
201 | 204 | # Required for trusted publishing |
202 | 205 | id-token: write |
| 206 | + # Required for release creation |
| 207 | + contents: write |
203 | 208 |
|
204 | 209 | steps: |
205 | 210 | - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4 |
206 | 211 | with: |
207 | 212 | path: wheels |
| 213 | + merge-multiple: true |
| 214 | + |
| 215 | + - name: Setup Python |
| 216 | + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 |
| 217 | + with: |
| 218 | + python-version: ${{ env.STABLE_PYTHON_VERSION }} |
| 219 | + |
| 220 | + - name: Update changelog |
| 221 | + id: changelog |
| 222 | + run: | |
| 223 | + pip install --upgrade commitizen |
| 224 | +
|
| 225 | + cz changelog \ |
| 226 | + --incremental \ |
| 227 | + --template .github/CHANGELOG.md.j2 \ |
| 228 | + --dry-run \ |
| 229 | + | tail -n+2 \ |
| 230 | + > ${{ runner.temp }}/changelog |
| 231 | + echo -e "\n\n## Pull Requests\n\n" >> ${{ runner.temp }}/changelog |
| 232 | +
|
| 233 | + cz changelog \ |
| 234 | + --incremental \ |
| 235 | + --template .github/CHANGELOG.md.j2 |
| 236 | +
|
| 237 | + - name: Generate release |
| 238 | + id: release |
| 239 | + uses: softprops/action-gh-release@v1 |
| 240 | + with: |
| 241 | + files: wheels/* |
| 242 | + body_path: ${{ runner.temp }}/changelog |
| 243 | + draft: false |
| 244 | + prerelease: false |
| 245 | + generate_release_notes: true |
208 | 246 |
|
209 | 247 | - name: Push build artifacts to PyPI |
210 | 248 | uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 # v1.8.12 |
211 | 249 | with: |
212 | 250 | skip-existing: true |
213 | 251 | password: ${{ secrets.PYPI_TOKEN }} |
214 | 252 | packages-dir: wheels |
| 253 | + |
| 254 | + - name: Create PR for changelog update |
| 255 | + uses: peter-evans/create-pull-request@v6 |
| 256 | + with: |
| 257 | + token: ${{ secrets.GH_TOKEN }} |
| 258 | + commit-message: "chore: update changelog ${{ github.ref_name }}" |
| 259 | + title: "chore: update changelog" |
| 260 | + body: | |
| 261 | + This PR updates the changelog for ${{ github.ref_name }}. |
| 262 | + branch: chore/update-changelog |
| 263 | + base: master |
0 commit comments