appveyor.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. image: Visual Studio 2015
  2. #TODO: we should take version from the last tag in git history + build number
  3. version: 0.7.4.{build}
  4. # Major_Version_Number.Minor_Version_Number.Patch_Number.Build_Number
  5. skip_branch_with_pr: true
  6. environment:
  7. COMPILER: msvc
  8. VSVER: 14
  9. matrix:
  10. - QT: C:\Qt\5.9\msvc2015_64
  11. PLATFORM: amd64
  12. - QT: C:\Qt\5.9\msvc2015
  13. PLATFORM: x86
  14. init:
  15. - ps: |
  16. $version = new-object System.Version $env:APPVEYOR_BUILD_VERSION
  17. $packageVersion = "{0}.{1}.{2}.{3}" -f $version.Major, $version.Minor, $version.Build, $version.Revision
  18. $env:build_number = $version.Build
  19. $env:flameshot_version = $packageVersion
  20. # scripts that run after cloning repository
  21. install:
  22. - set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW3.0.1\bin\;%PATH%
  23. # scripts that run before build
  24. before_build:
  25. - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
  26. - appveyor DownloadFile http://mlaan2.home.xs4all.nl/ispack/innosetup-6.0.5.exe
  27. - innosetup-6.0.5.exe /VERYSILENT /ALLUSERS /DIR=C:\InnoSetup
  28. # After calling vcvarsall.bat, %PLATFORM% will be X64 or x86
  29. - qmake --version
  30. - mkdir build
  31. - cd build
  32. - if "%PLATFORM%" EQU "X64" (qmake -r -spec win32-msvc CONFIG+=x86_64 CONFIG-=debug CONFIG+=release ../flameshot.pro)
  33. - if "%PLATFORM%" EQU "x86" (qmake -r -spec win32-msvc CONFIG+=Win32 CONFIG-=debug CONFIG+=release ../flameshot.pro)
  34. # custom build scripts
  35. build_script:
  36. - nmake
  37. # scripts that run after build
  38. after_build:
  39. # Clone OpenSSL DLLs
  40. - git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git
  41. - mkdir distrib\flameshot
  42. - windeployqt.exe --dir .\distrib\flameshot %APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe
  43. - copy "%APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe" "distrib\flameshot\flameshot.exe"
  44. - copy "%APPVEYOR_BUILD_FOLDER%\README.md" "distrib\flameshot\README.md"
  45. - copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" "distrib\flameshot\LICENSE.txt"
  46. - copy "%APPVEYOR_BUILD_FOLDER%\docs\flameshot-documentation.pdf" "distrib\flameshot\flameshot-documentation.pdf"
  47. - echo %flameshot_version% > "distrib\flameshot\version.txt"
  48. - echo Build:%build_number% >> "distrib\flameshot\version.txt"
  49. - echo %APPVEYOR_REPO_COMMIT% >> "distrib\flameshot\version.txt"
  50. - copy "distrib\flameshot\flameshot.exe" "distrib\flameshot_win_%PLATFORM%.exe"
  51. - copy "%APPVEYOR_BUILD_FOLDER%\build\translations\Internationalization_*.qm" "distrib\flameshot\translations"
  52. # Delete translations\qt_*.qm
  53. - del /F /Q "distrib\flameshot\translations\qt_*.qm"
  54. # Copy OpenSSL DLLs
  55. - if "%PLATFORM%" EQU "X64" (xcopy "openssl-utils.git\win64\*.dll" "distrib\flameshot")
  56. - if "%PLATFORM%" EQU "x86" (xcopy "openssl-utils.git\win32\*.dll" "distrib\flameshot")
  57. - cd distrib
  58. - 7z a flameshot_%flameshot_version%_win_%PLATFORM%.zip flameshot
  59. # Build installation
  60. - cp ..\..\win_setup\flameshot.iss flameshot.iss
  61. - C:\InnoSetup\Compil32.exe /cc flameshot.iss
  62. - mv Output\Flameshot-Setup.exe Output\Flameshot-Setup-%PLATFORM%.exe
  63. artifacts:
  64. - path: build\distrib\flameshot_%flameshot_version%_win_%PLATFORM%.zip
  65. name: exe_only
  66. - path: build\distrib\Output\Flameshot-Setup-%PLATFORM%.exe
  67. name: installer