@@ -109,7 +109,7 @@ jobs:
109109 run : |
110110 python -c "import tcod"
111111
112- linux_wheels :
112+ linux-wheels :
113113 runs-on : " ubuntu-20.04"
114114 steps :
115115 - uses : actions/checkout@v1
@@ -148,3 +148,55 @@ jobs:
148148 TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
149149 run : |
150150 twine upload --skip-existing wheelhouse/*
151+
152+ build-macos :
153+ runs-on : ${{ matrix.os }}
154+ strategy :
155+ matrix :
156+ os : ["macos-latest"]
157+ python-version : ["3.x"]
158+ steps :
159+ # v2 breaks `git describe` so v1 is needed.
160+ # https://github.com/actions/checkout/issues/272
161+ - uses : actions/checkout@v1
162+ - name : Checkout submodules
163+ run : |
164+ git submodule update --init --recursive --depth 1
165+ - name : Print git describe
166+ run : |
167+ git describe
168+ - name : Set up Python ${{ matrix.python-version }}
169+ uses : actions/setup-python@v2
170+ with :
171+ python-version : ${{ matrix.python-version }}
172+ - name : Install Python dependencies
173+ run : |
174+ python -m pip install --upgrade pip
175+ pip install wheel twine
176+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
177+ - name : Prepare package.
178+ # Downloads SDL2 for the later step.
179+ run : |
180+ python setup.py check
181+ - name : Build wheels
182+ uses : pypa/cibuildwheel@v2.0.0a4
183+ env :
184+ CIBW_BUILD : cp38-* pp*
185+ CIBW_ARCHS_MACOS : x86_64 arm64 universal2
186+ CIBW_BEFORE_BUILD_MACOS : pip install --force-reinstall git+https://github.com/matthew-brett/delocate.git@1c07b50
187+ CIBW_BEFORE_TEST : pip install numpy
188+ CIBW_TEST_COMMAND : python -c "import tcod"
189+ CIBW_TEST_SKIP : " pp* *-macosx_arm64 *-macosx_universal2:arm64"
190+ - name : Archive wheel
191+ uses : actions/upload-artifact@v2
192+ with :
193+ name : wheel-macos
194+ path : wheelhouse/*.whl
195+ retention-days : 1
196+ - name : Upload to PyPI
197+ if : startsWith(github.ref, 'refs/tags/')
198+ env :
199+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
200+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
201+ run : |
202+ twine upload --skip-existing wheelhouse/*
0 commit comments