Debian Codegraph @

.github/workflows/release.yml

raw
1 name: Release
2 on:
3 workflow_dispatch:
4 release:
5 types:
6 - published
7
8 permissions: {}
9
10 jobs:
11 build_wheels:
12 name: Build wheels on ${{ matrix.os }}
13 runs-on: ${{ matrix.os }}
14 needs: build_sdist
15 strategy:
16 matrix:
17 os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
18
19 steps:
20 - name: Checkout
21 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6
22
23 - name: Build wheels
24 uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # was: pypa/[email protected]
25
26 - name: Upload
27 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # was: actions/upload-artifact@v7
28 with:
29 name: cibw-wheels-${{ matrix.os }}
30 path: ./wheelhouse/*.whl
31
32 build_sdist:
33 name: Build source distribution
34 runs-on: ubuntu-latest
35 steps:
36 - name: Checkout
37 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6
38
39 - name: Build SDist
40 run: pipx run build --sdist
41
42 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # was: actions/upload-artifact@v7
43 with:
44 name: cibw-sdist
45 path: dist/*.tar.gz
46
47 upload_pypi:
48 needs: [build_wheels, build_sdist]
49 runs-on: ubuntu-latest
50 environment: pypi
51 permissions:
52 id-token: write
53 # Comment this line for testing
54 if: github.event_name == 'release' && github.event.action == 'published'
55 steps:
56 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
57 with:
58 # unpacks all CIBW artifacts into dist/
59 pattern: cibw-*
60 path: dist
61 merge-multiple: true
62
63 - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
64 # To test uploads to TestPyPI, uncomment the following:
65 # with:
66 # repository-url: https://test.pypi.org/legacy/