瀏覽代碼

Add new Windows build scripts and CI with GitHub and MSYS2

Fixes #7097
Rayyan Ansari 2 年之前
父節點
當前提交
2b98a423ed
共有 3 個文件被更改,包括 36 次插入0 次删除
  1. 27 0
      .github/workflows/windows.yml
  2. 5 0
      scripts/msys2-build
  3. 4 0
      scripts/msys2-install-deps

+ 27 - 0
.github/workflows/windows.yml

@@ -0,0 +1,27 @@
+name: Windows CI
+on: [push, pull_request]
+
+jobs:
+  msys2-ucrt64:
+    runs-on: windows-latest
+    defaults:
+      run:
+        shell: msys2 {0}
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+      - uses: msys2/setup-msys2@v2
+        with:
+          msystem: UCRT64
+          update: true
+      - name: Install dependencies
+        run: ./scripts/msys2-install-deps
+      - name: Build
+        run: ./scripts/msys2-build
+      - name: Test
+        run: ./dist/borg.exe -V
+      - uses: actions/upload-artifact@v3
+        with:
+          name: borg-windows
+          path: dist/borg.exe

+ 5 - 0
scripts/msys2-build

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+python setup.py build_ext --inplace
+python setup.py bdist_wheel
+pyinstaller -y scripts/borg.exe.spec

+ 4 - 0
scripts/msys2-install-deps

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,python,cython,python-setuptools,python-wheel,python-pkgconfig,python-packaging,python-msgpack,python-argon2_cffi,python-pip}
+pip install pyinstaller