-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (132 loc) · 4.03 KB
/
macos.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: MacOS
on:
push:
branches: [ "master", "dev_actions" ]
tags: [ '**' ]
jobs:
build-macos:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13, macos-12]
python-version: ["3.11"]
arch: [arm64, x86_64]
include:
- os: macos-14
arch: arm64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=14.0
force: true
- os: macos-13
arch: arm64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0
force: true
- os: macos-12
arch: arm64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=12.0
force: true
- os: macos-14
arch: x86_64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=14.0
force: true
- os: macos-13
arch: x86_64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0
force: true
- os: macos-12
arch: x86_64
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=12.0
force: true
steps:
# if matrix.force is not true or event is not tag, skip
- if: ${{ matrix.force }} != true || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags'))
run:
echo "Skipping job for ${{ matrix.os }} ${{ matrix.python-version }}"
exit 0
- name: Check out repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install setuptools (needed from Python 3.12)
run: pip install setuptools
- name: Set up GraalVM Native Image toolchain
uses: graalvm/setup-graalvm@v1
with:
java-version: '22'
distribution: 'graalvm'
- name: Install Swig
run: brew install swig
- name: Update repository
run: |
git submodule update --init --recursive
- name: Build
run: |
sh build.sh nowheel
pip install pychoco -f dist/
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT: ${{ matrix.CIBW_ENVIRONMENT }}
with:
output-dir: dist
- name: Test
run: |
pip install pytest
pip install -r requirements_tests.txt
pytest
- name: Upload wheel artifacts
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v4
with:
name: wheel-${{matrix.os}}-${{matrix.python-version}}-${{matrix.arch}}-artifact
path: dist/
if-no-files-found: error
upload-pypi-macos:
needs: build-macos
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
strategy:
matrix:
os : [macos-14, macos-13, macos-12]
arch: [arm64, x86_64]
python-version: [ "3.11" ]
include:
- os: macos-14
arch: arm64
force: true
- os: macos-13
arch: arm64
force: true
- os: macos-12
arch: arm64
force: true
- os: macos-14
arch: x86_64
force: true
- os: macos-13
arch: x86_64
force: true
- os: macos-12
arch: x86_64
force: true
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: wheel-${{matrix.os}}-${{matrix.python-version}}-${{matrix.arch}}-artifact
path: dist
- name: List files
run: ls -R
- name: Upload to PyPi
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
skip-existing: true