Repository navigation
166 lines (162 loc) · 6.21 KB
/
Copy pathpython_macos.yml
File metadata and controls
166 lines (162 loc) · 6.21 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: PyQBDI macOS package
on:
workflow_call:
workflow_dispatch:
jobs:
build-pyqbdi-x64:
runs-on: macos-15-intel
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
fail-fast: false
env:
QBDI_PLATFORM: 'macos'
QBDI_ARCH: 'X86_64'
MACOSX_DEPLOYMENT_TARGET: '10.14'
_PYTHON_HOST_PLATFORM: "macosx-10.14-x86_64"
CMAKE_OSX_ARCHITECTURES: "x86_64"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.python-version == '3.15' }}
- name: Install system dependencies
run: |
brew install cmake ninja ccache
python3 -m pip install --upgrade pip setuptools wheel build
- name: checkout
uses: actions/checkout@v4
- name: Cache ccache
uses: actions/cache@v4
id: cache-ccache-python
with:
path: |
~/.ccache
key: ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-${{ github.run_number }}
restore-keys: |
ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-
ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-
- if: steps.cache-ccache-python.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
- name: Cache third-party
uses: actions/cache@v4
with:
path: |
third-party
key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
- name: Build PyQBDI ${{ matrix.python-version }}
run: |
python3 --version
python3 -m build -w
- name: Export package
uses: actions/upload-artifact@v4
with:
name: PyQBDI_macOS_X86_64_${{ matrix.python-version }}
path: dist/*
build-pyqbdi-aarch64:
runs-on: macos-15
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
fail-fast: false
env:
QBDI_ARCH: 'AARCH64'
QBDI_PLATFORM: 'macos'
MACOSX_DEPLOYMENT_TARGET: '11.0'
_PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
CMAKE_OSX_ARCHITECTURES: "arm64"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.python-version == '3.15' }}
- name: Install system dependencies
run: |
brew install cmake ninja ccache
python3 -m pip install --upgrade pip setuptools wheel build
- name: checkout
uses: actions/checkout@v4
- name: Cache ccache
uses: actions/cache@v4
id: cache-ccache-python
with:
path: |
~/.ccache
key: ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-${{ github.run_number }}
restore-keys: |
ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-
ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-
- if: steps.cache-ccache-python.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
- name: Cache third-party
uses: actions/cache@v4
with:
path: |
third-party
key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
- name: Build PyQBDI ${{ matrix.python-version }}
run: |
python3 --version
python3 -m build -w
- name: Export package
uses: actions/upload-artifact@v4
with:
name: PyQBDI_macOS_AARCH64_${{ matrix.python-version }}
path: dist/*
# build-pyqbdi-aarch64-arm64e:
# runs-on: macos-15
# env:
# QBDI_ARCH: 'AARCH64'
# QBDI_PLATFORM: 'macos'
# MACOSX_DEPLOYMENT_TARGET: '11.0'
# _PYTHON_HOST_PLATFORM: 'macosx-11.0-arm64'
# CMAKE_OSX_ARCHITECTURES: 'arm64e'
# OPENSSL_VERSION: '3.5.4'
# OPENSSL_PREFIX: ${{ github.workspace }}/openssl-build
# PYTHON_VERSION: '3.14.0'
# PYTHON_PREFIX: ${{ github.workspace }}/python-build
# PYTHON_VENV: ${{ github.workspace }}/python-venv
# steps:
# - name: Download OpenSSL
# run: |
# wget -O- https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz | tar xJf -
# - name: Build OpenSSL for arm64e
# working-directory: openssl-${{ env.OPENSSL_VERSION }}
# run: |
# sed -i'' -e 's/-arch arm64/-arch arm64e/g' Configurations/10-main.conf
# ./configure --prefix=${OPENSSL_PREFIX} --openssldir=${OPENSSL_PREFIX}/ssl
# make -j$(nproc)
# make install
# - name: Download Python
# run: |
# wget -O- https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz | tar xJf -
# - name: Build Python for arm64e
# working-directory: Python-${{ env.PYTHON_VERSION }}
# run: |
# ./configure --prefix=${PYTHON_PREFIX} --with-pydebug --with-openssl=${OPENSSL_PREFIX} \
# CFLAGS='-arch arm64e' LDFLAGS='-arch arm64e'
# make -j$(nproc)
# make install
# - name: Checkout QBDI
# uses: actions/checkout@v4
# - name: Install system dependencies
# run: |
# brew install cmake
# - name: Create Python virtual environment
# run: |
# ${PYTHON_PREFIX}/bin/python3 -m venv ${PYTHON_VENV}
# ${PYTHON_VENV}/bin/python3 -m pip install --upgrade pip setuptools wheel build
# - name: Build PyQBDI ${PYTHON_VERSION}
# run: |
# ${PYTHON_VENV}/bin/python3 -m build -w
# - name: Export package
# uses: actions/upload-artifact@v4
# with:
# name: PyQBDI_macOS_AARCH64_arm64e_${PYTHON_VERSION}
# path: dist/*