]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Build Windows binary packages
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 29 Jun 2021 16:03:54 +0000 (17:03 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 30 Jun 2021 00:48:41 +0000 (01:48 +0100)
.github/workflows/packages.yml

index 561cd0f19489017ce920a3728dbdad8363f62485..4cfe260355159eac058faaf103c9b971ceb176c8 100644 (file)
@@ -4,7 +4,7 @@ on:
   workflow_dispatch:
 
 jobs:
-  build_linux:
+  linux:
     name: Build Linux packages
     runs-on: ubuntu-20.04
 
@@ -59,9 +59,10 @@ jobs:
           --health-timeout 5s
           --health-retries 5
 
-  build_macos:
+  macos:
     name: Build MacOS packages
     runs-on: macos-10.15
+
     strategy:
       matrix:
         pyver: [cp36, cp37, cp38, cp39]
@@ -91,3 +92,44 @@ jobs:
       - uses: actions/upload-artifact@v2
         with:
           path: ./wheelhouse/*.whl
+
+  windows:
+    name: Build Windows packages
+    runs-on: windows-2019
+    strategy:
+      matrix:
+        pyver: [cp36, cp37, cp38, cp39]
+        arch: [win_amd64]
+        # Might want to add win32, untested at the moment.
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Start PostgreSQL service for test
+        run: |
+          $postgreSqlSvc = Get-Service "postgresql*"
+          Set-Service $postgreSqlSvc.Name -StartupType manual
+          $postgreSqlSvc.Start()
+
+      - name: Create the binary package source tree
+        run: python3 ./tools/build/copy_to_binary.py
+
+      - name: Build wheels
+        uses: pypa/cibuildwheel@v1.12.0
+        with:
+          package-dir: psycopg_binary
+        env:
+          CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}}
+          CIBW_ARCHS_WINDOWS: AMD64 x86
+          CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
+          CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
+            delvewheel repair -w {dest_dir} {wheel}
+          CIBW_BEFORE_TEST: pip install ./psycopg[test]
+          CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
+          CIBW_ENVIRONMENT: >-
+            PSYCOPG_IMPL=binary
+            PSYCOPG_TEST_DSN='host=172.17.0.1 user=postgres'
+
+      - uses: actions/upload-artifact@v2
+        with:
+          path: ./wheelhouse/*.whl