version: '{build}'
pull_requests:
  do_not_increment_build_number: true
os: Visual Studio 2022
shallow_clone: false

environment:
  MSYSTEM: MINGW64
  MSYS2_PATH_TYPE: inherit
  CHERE_INVOKING: enabled_from_arguments
  GO111MODULE: on
  GOPATH: c:\gopath

stack: go 1.19

build_script:
- cmd: >-
    cd %APPVEYOR_BUILD_FOLDER%
  ##### MinGW build
- set OPT_PATH=C:\msys64\mingw32\bin;C:\msys64\mingw64\bin;
- set PATH=%GOPATH%\bin;%OPT_PATH%%PATH%
- go install github.com/tc-hib/go-winres@latest
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi.sh x64"
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi.sh x86"
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi-gui.sh x64"
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi-gui.sh x86"
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi-ie.sh x64"
- c:\msys64\usr\bin\bash -lc "./contrib/msi/build-msi-ie.sh x86"

test: off

artifacts:
- path: '*.msi'
