From 2b98a423ed2ebe4ccaa5c6229a0583e70c18c12d Mon Sep 17 00:00:00 2001 From: Rayyan Ansari Date: Thu, 27 Oct 2022 13:35:12 +0100 Subject: [PATCH] Add new Windows build scripts and CI with GitHub and MSYS2 Fixes #7097 --- .github/workflows/windows.yml | 27 +++++++++++++++++++++++++++ scripts/msys2-build | 5 +++++ scripts/msys2-install-deps | 4 ++++ 3 files changed, 36 insertions(+) create mode 100644 .github/workflows/windows.yml create mode 100644 scripts/msys2-build create mode 100644 scripts/msys2-install-deps diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..f42df65a8 --- /dev/null +++ b/.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 diff --git a/scripts/msys2-build b/scripts/msys2-build new file mode 100644 index 000000000..963c99d4b --- /dev/null +++ b/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 diff --git a/scripts/msys2-install-deps b/scripts/msys2-install-deps new file mode 100644 index 000000000..7579a1379 --- /dev/null +++ b/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