diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 1ecc8f7a..d8399f68 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -196,3 +196,92 @@ jobs: with: name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe path: deploy/windows/nsis/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe + + + # Windows MSYS2 build + msys2-makepkg: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { icon: '🟪', msystem: MINGW64, arch: x86_64 } + - { icon: '🟦', msystem: MINGW32, arch: i686 } + name: ${{ matrix.icon }} ${{ matrix.msystem }} | ${{ matrix.arch }} | makepkg + defaults: + run: + shell: msys2 {0} + steps: + + - run: git config --global core.autocrlf input + shell: bash + + - name: '🧰 Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: > + base-devel + mingw-w64-${{ matrix.arch }}-toolchain + + - name: '🚧 Build' + run: | + cd msys2 + makepkg-mingw --noconfirm --noprogressbar -sCLf --nocheck + env: + MINGW_INSTALLS: ${{ matrix.msystem }} + + - name: '📤 Upload artifact: MSYS2 ${{ matrix.arch }} package' + uses: actions/upload-artifact@v2 + with: + name: msys2-pkgs + path: msys2/*.zst + + # Test Windows MSYS2 packages + msys2-test: + needs: msys2-makepkg + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { icon: '🟪', msystem: MINGW64, arch: x86_64 } + - { icon: '🟦', msystem: MINGW32, arch: i686 } + name: ${{ matrix.icon }} ${{ matrix.msystem }} | ${{ matrix.arch }} | Test + defaults: + run: + shell: msys2 {0} + steps: + + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: > + tree + tar + zstd + + - name: '📥 Download artifacts: MSYS2 packages' + uses: actions/download-artifact@v2 + with: + name: msys2-pkgs + + - name: 'Install MSYS2 package' + run: | + pacman -U --noconfirm --noprogressbar *${{ matrix.arch }}*.zst + + - name: 'List contents of package' + run: | + mkdir tmp + cd tmp + /usr/bin/tar xf ../*${{ matrix.arch }}*.zst + tree ${{ matrix.msystem }} diff --git a/msys2/PKGBUILD b/msys2/PKGBUILD new file mode 100644 index 00000000..b07bec6f --- /dev/null +++ b/msys2/PKGBUILD @@ -0,0 +1,36 @@ +_realname=serial-studio +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=ci +pkgrel=1 +pkgdesc="Serial Studio: Multi-purpose serial data visualization & processing program (mingw-w64)" +arch=('any') +url="https://github.com/Serial-Studio/Serial-Studio" +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-qt5") +makedepends=( + "${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-cmake" +) + +source=() +sha256sums=() + +prepare () { + mkdir -p "${srcdir}"/build +} + +build() { + cd "${srcdir}"/build + MSYS2_ARG_CONV_EXCL="PREFIX=" qmake PREFIX="${MINGW_PREFIX}" ../../.. + make +} + +check() { + "${srcdir}"/build/release/SerialStudio.exe --version +} + +package() { + cd "${srcdir}"/build + make INSTALL_ROOT="${pkgdir}" install +}