forked from libtcod/python-tcod
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.88 KB
/
python-package-macos.yml
File metadata and controls
59 lines (56 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Python package (MacOS)
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-latest"]
python-version: ["3.x"]
steps:
# v2 breaks `git describe` so v1 is needed.
# https://github.com/actions/checkout/issues/272
- uses: actions/checkout@v1
- name: Checkout submodules
run: |
git submodule update --init --recursive --depth 1
- name: Print git describe
run: |
git describe
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Prepare package.
# Downloads SDL2 for the later step.
run: |
python setup.py check
- name: Build wheels
uses: pypa/cibuildwheel@v2.0.0a4
env:
CIBW_BUILD: cp38-* pp*
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_BEFORE_BUILD_MACOS: pip install --force-reinstall git+https://github.com/matthew-brett/delocate.git@1c07b50
CIBW_BEFORE_TEST: pip install numpy
CIBW_TEST_COMMAND: python -c "import tcod"
CIBW_TEST_SKIP: "pp* *-macosx_arm64 *-macosx_universal2:arm64"
- name: Archive wheel
uses: actions/upload-artifact@v2
with:
name: wheel-macos
path: wheelhouse/*.whl
retention-days: 1
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing wheelhouse/*