3333          python -m pip install -vv . 
3434          python -m unittest -v regex.test_regex 
3535
36+ #  Build source distribution
37+   build_source :
38+     name : Build Source 
39+     if : github.event_name == 'push' 
40+     runs-on : ubuntu-latest 
41+ 
42+     steps :
43+       - uses : actions/checkout@v3 
44+       - uses : actions/setup-python@v4 
45+         with :
46+           python-version : ${{ env.PYTHON_VER }} 
47+ 
48+       - name : Build source distribution 
49+         run : | 
50+           python setup.py sdist --formats=gztar 
51+ 
52+ name : Upload source distribution 
53+         uses : actions/upload-artifact@v4 
54+         with :
55+           name : regex-files-source 
56+           path : dist/*.tar.gz 
57+ 
3658  #  Build Linux/macOS/Windows wheels.
3759  build_wheels :
3860    name : Build ${{ matrix.platform }} wheels 
@@ -107,12 +129,6 @@ jobs:
107129      - name : Build wheels 
108130109131
110-       - name : Upload source distribution 
111-         uses : actions/upload-artifact@v4 
112-         with :
113-           name : regex-files-dist 
114-           path : dist/*.tar.gz 
115- 
116132      - name : Upload manylinux1_x86_64 wheels 
117133        uses : actions/upload-artifact@v4 
118134        with :
@@ -129,6 +145,9 @@ jobs:
129145      matrix :
130146        arch : [aarch64, ppc64le, s390x] 
131147
148+     env :
149+       CIBW_ARCHS_LINUX : ${{ matrix.arch }} 
150+ 
132151    steps :
133152      - uses : actions/checkout@v3 
134153      - uses : actions/setup-python@v4 
@@ -138,14 +157,10 @@ jobs:
138157      - name : Set up QEMU 
139158        uses : docker/setup-qemu-action@v3 
140159        with :
141-           platforms : all 
160+           platforms : ${{ matrix.arch }} 
142161
143162      - name : Build wheels 
144163145-         with :
146-           CIBW_ARCHS_LINUX : ${{ matrix.arch }} 
147-           #  Building in QEMU is very slow, so parallelize the tasks.
148-           CIBW_SKIP : " *musllinux* *manylinux*" 
149164
150165      - name : Upload ${{ matrix.arch }} wheels 
151166        uses : actions/upload-artifact@v4 
@@ -156,7 +171,7 @@ jobs:
156171  #  Upload to PyPI
157172  upload_pypi :
158173    name : Publish to PyPI 
159-     needs : [build_wheels, build_in_manylinux2014, build_arch_wheels] 
174+     needs : [build_source,  build_wheels, build_in_manylinux2014, build_arch_wheels] 
160175    runs-on : ubuntu-latest 
161176
162177    steps :
0 commit comments