|
| 1 | +name: Build windows wheels |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + create: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: windows-latest |
| 12 | + env: |
| 13 | + CONNECTOR_VERSION: "3.1.9" |
| 14 | + steps: |
| 15 | + |
| 16 | + - name: Cache Connector |
| 17 | + id: cache-connector |
| 18 | + uses: actions/cache@v1 |
| 19 | + with: |
| 20 | + path: c:/mariadb-connector |
| 21 | + key: mariadb-connector-${CONNECTOR_VERSION}-win |
| 22 | + |
| 23 | + - name: Download and Unzip Connector |
| 24 | + if: steps.cache-connector.outputs.cache-hit != 'true' |
| 25 | + shell: bash |
| 26 | + run: | |
| 27 | + curl -LO "https://downloads.mariadb.com/Connectors/c/connector-c-${CONNECTOR_VERSION}/mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" |
| 28 | + unzip "mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" -d c:/ |
| 29 | + mv "c:/mariadb-connector-c-${CONNECTOR_VERSION}-src" c:/mariadb-connector-src |
| 30 | +
|
| 31 | + - name: Build Connector |
| 32 | + if: steps.cache-connector.outputs.cache-hit != 'true' |
| 33 | + shell: cmd |
| 34 | + working-directory: c:/mariadb-connector-src |
| 35 | + run: | |
| 36 | + mkdir build |
| 37 | + cd build |
| 38 | + cmake -A x64 .. -DCMAKE_BUILD_TYPE=Release -DCLIENT_PLUGIN_DIALOG=static -DCLIENT_PLUGIN_SHA256_PASSWORD=static -DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=static |
| 39 | + cmake --build . -j 8 --config Release |
| 40 | + cmake -DCMAKE_INSTALL_PREFIX=c:/mariadb-connector -DCMAKE_INSTALL_COMPONENT=Development -DCMAKE_BUILD_TYPE=Release -P cmake_install.cmake |
| 41 | +
|
| 42 | + - name: Checkout mysqlclient |
| 43 | + uses: actions/checkout@v1 |
| 44 | + with: |
| 45 | + ref: master |
| 46 | + fetch-depth: 10 |
| 47 | + path: mysqlclient |
| 48 | + |
| 49 | + - name: Site Config |
| 50 | + shell: bash |
| 51 | + working-directory: ../mysqlclient |
| 52 | + run: | |
| 53 | + pwd |
| 54 | + find . |
| 55 | + cat <<EOF >site.cfg |
| 56 | + [options] |
| 57 | + static = True |
| 58 | + connector = C:/mariadb-connector |
| 59 | + EOF |
| 60 | + cat site.cfg |
| 61 | +
|
| 62 | + - name: Build wheels |
| 63 | + shell: cmd |
| 64 | + working-directory: ../mysqlclient |
| 65 | + run: | |
| 66 | + py -3.8 -m pip install -U setuptools wheel pip |
| 67 | + py -3.8 setup.py bdist_wheel |
| 68 | + py -3.7 -m pip install -U setuptools wheel pip |
| 69 | + py -3.7 setup.py bdist_wheel |
| 70 | + py -3.6 -m pip install -U setuptools wheel pip |
| 71 | + py -3.6 setup.py bdist_wheel |
| 72 | +
|
| 73 | + - name: Upload Wheel |
| 74 | + uses: actions/upload-artifact@v1 |
| 75 | + with: |
| 76 | + name: win-wheels |
| 77 | + path: ../mysqlclient/dist |
| 78 | + |
| 79 | + - name: Check wheels |
| 80 | + shell: bash |
| 81 | + working-directory: ../mysqlclient/dist |
| 82 | + run: | |
| 83 | + ls -la |
| 84 | + py -3.8 -m pip install mysqlclient-1.4.6-cp38-cp38-win_amd64.whl |
| 85 | + py -3.8 -c "import MySQLdb" |
| 86 | + py -3.7 -m pip install mysqlclient-1.4.6-cp37-cp37m-win_amd64.whl |
| 87 | + py -3.7 -c "import MySQLdb" |
| 88 | + py -3.6 -m pip install mysqlclient-1.4.6-cp36-cp36m-win_amd64.whl |
| 89 | + py -3.6 -c "import MySQLdb" |
| 90 | +
|
0 commit comments