Repository navigation
136 lines (121 loc) · 4.11 KB
/
Copy pathwindows.yaml
File metadata and controls
136 lines (121 loc) · 4.11 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
name: Build windows wheels
on:
push:
branches: ["main", "ci"]
tags: ["v*"]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
cmake_arch: x64
cibw_arch: AMD64
- os: windows-11-arm
cmake_arch: ARM64
cibw_arch: ARM64
runs-on: ${{ matrix.os }}
env:
CONNECTOR_VERSION: "3.4.9"
steps:
- name: Cache Connector
id: cache-connector
uses: actions/cache@v6.1.0
with:
path: c:/mariadb-connector
key: mariadb-connector-c-${{ env.CONNECTOR_VERSION }}-win-${{ matrix.cmake_arch }}-2
- name: Download and Unzip Connector
if: steps.cache-connector.outputs.cache-hit != 'true'
shell: bash
# zip URL should be updated by hand on each release.
run: |
curl -LO "https://dlm.mariadb.com/4751031/Connectors/c/connector-c-3.4.9/mariadb-connector-c-3.4.9-src.zip"
unzip "mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" -d c:/
mv "c:/mariadb-connector-c-${CONNECTOR_VERSION}-src" c:/mariadb-connector-src
- name: make build directory
if: steps.cache-connector.outputs.cache-hit != 'true'
shell: cmd
working-directory: c:/mariadb-connector-src
run: |
mkdir build
- name: cmake
if: steps.cache-connector.outputs.cache-hit != 'true'
shell: cmd
working-directory: c:/mariadb-connector-src/build
run: |
cmake -A ${{ matrix.cmake_arch }} .. -DCMAKE_BUILD_TYPE=Release -DCLIENT_PLUGIN_DIALOG=static -DCLIENT_PLUGIN_SHA256_PASSWORD=static -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=static -DDEFAULT_SSL_VERIFY_SERVER_CERT=0
- name: cmake build
if: steps.cache-connector.outputs.cache-hit != 'true'
shell: cmd
working-directory: c:/mariadb-connector-src/build
run: |
cmake --build . -j 8 --config Release
- name: cmake install
if: steps.cache-connector.outputs.cache-hit != 'true'
shell: cmd
working-directory: c:/mariadb-connector-src/build
run: |
cmake -DCMAKE_INSTALL_PREFIX=c:/mariadb-connector -DCMAKE_INSTALL_COMPONENT=Development -DCMAKE_BUILD_TYPE=Release -P cmake_install.cmake
- name: Checkout mysqlclient
uses: actions/checkout@v7.0.1
with:
path: mysqlclient
- name: Site Config
shell: bash
working-directory: mysqlclient
run: |
pwd
find .
cat <<EOF >site.cfg
[options]
static = True
connector = C:/mariadb-connector
EOF
cat site.cfg
- uses: actions/setup-python@v7.1.0
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
working-directory: mysqlclient
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_TEST_COMMAND: 'python -c "import MySQLdb; print(MySQLdb.version_info)" '
run: "python -m cibuildwheel --output-dir dist"
- name: Build sdist
if: matrix.cibw_arch == 'AMD64'
working-directory: mysqlclient
run: |
python -m pip install build
python -m build -s -o dist
- name: Upload Wheel
uses: actions/upload-artifact@v7.0.2
with:
name: win-wheels-${{ matrix.cibw_arch }}
path: mysqlclient/dist/*.*
if-no-files-found: error
publish:
name: Publish to PyPI
needs: build
if: >-
github.event_name == 'push' && github.event.created &&
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v8.0.2
with:
pattern: win-wheels-*
path: dist
merge-multiple: true
- name: Publish distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.14.3
with:
attestations: true