.gitlab-ci.yml 5.55 KB
Newer Older
1 2 3 4 5
stages:
  - configure
  - build
  - dist
  - pack
Victor Yacovlev's avatar
Victor Yacovlev committed
6
  
Victor Yacovlev's avatar
Victor Yacovlev committed
7
configure:mac:
Victor Yacovlev's avatar
Victor Yacovlev committed
8 9 10 11 12 13 14 15 16 17 18 19
  stage: configure
  script:
    - mkdir build
    - cd build
    - cmake -DUSE_QT=5 -DCMAKE_BUILD_TYPE=Release ..
  tags:
    - mac
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/  
20 21 22 23

configure:win32:
  stage: configure
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
24
    - md build
25 26 27 28 29 30 31
    - set QMAKESPEC=win32-msvc2015
    - set INCLUDE=
    - set LIB=
    - set LIBPATH=
    - call vsvars32.bat
    - call vcvars32.bat
    - cd build
Victor Yacovlev's avatar
Victor Yacovlev committed
32
    - cmake -Wno-dev -DCMAKE_PREFIX_PATH="%QTDIR%\lib\cmake" -DQt5_DIR="%QTDIR%\lib\cmake\Qt5" -DUSE_QT=5 -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% -G "NMake Makefiles" ..
33 34
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
35
  cache:
Victor Yacovlev's avatar
Victor Yacovlev committed
36
    key: $CI_PIPELINE_ID
Victor Yacovlev's avatar
Victor Yacovlev committed
37
    untracked: true
Victor Yacovlev's avatar
Victor Yacovlev committed
38
    paths:
Victor Yacovlev's avatar
Victor Yacovlev committed
39
      - build/
40 41 42 43

build:win32:
  stage: build
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
44
    - cd build
45 46 47 48 49 50
    - set QMAKESPEC=win32-msvc2016
    - set INCLUDE=
    - set LIB=
    - set LIBPATH=
    - call vsvars32.bat
    - call vcvars32.bat
Victor Yacovlev's avatar
Victor Yacovlev committed
51
    - set CL=/MP
52 53 54
    - nmake
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
55
  cache:
Victor Yacovlev's avatar
Victor Yacovlev committed
56
    key: $CI_PIPELINE_ID
Victor Yacovlev's avatar
Victor Yacovlev committed
57 58 59
    untracked: true
    paths:
      - build/
Victor Yacovlev's avatar
Victor Yacovlev committed
60
      
Victor Yacovlev's avatar
Victor Yacovlev committed
61
build:mac:
Victor Yacovlev's avatar
Victor Yacovlev committed
62 63 64 65 66 67 68 69 70 71 72
  stage: build
  script:
    - cd build
    - make
  tags:
    - mac
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/
73 74 75 76

dist:win32:
  stage: dist
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
77
    - cd build
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\lib\
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\share\
    - xcopy /Y /S /E bin kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin
    - xcopy /Y /S /E lib kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\lib
    - xcopy /Y /S /E share kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\share
    - copy /Y  ..\LICENSE_RU.rtf kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
    - copy /Y  %QTDIR%\bin\Qt5Core.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Gui.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Multimedia.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5MultimediaWidgets.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Network.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5OpenGL.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Positioning.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5PrintSupport.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Qml.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Quick.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Script.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Sensors.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Sql.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Svg.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Widgets.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5Xml.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - copy /Y  %QTDIR%\bin\Qt5XmlPatterns.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms
    - copy /Y  %QTDIR%\plugins\platforms\qminimal.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
    - copy /Y  %QTDIR%\plugins\platforms\qwindows.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
    - copy /Y  %QTDIR%\plugins\platforms\qoffscreen.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
    - xcopy /Y /S /E  "%VC_REDIST_DIR%\x86\Microsoft.VC140.CRT\*.dll" kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
    - md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src
Victor Yacovlev's avatar
Victor Yacovlev committed
109
    - cd ..
110 111 112 113 114
    - call %PYTHON_EXECUTABLE% scripts\get_bundle_name.py --prefix=git@20archive@20--out=build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\kumir2- --suffix=.src.zip@20--format=zip@20-9@20HEAD --out=run_git_archive.cmd
    - copy /Y  kumir2.nsi build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
    - copy /Y  kumir2.nsi build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\
    - call %PYTHON_EXECUTABLE% scripts\query_version_info.py --mode=nsis_include_file --out=build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\nsis_version_info.nsh
    - copy /Y  build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\nsis_version_info.nsh build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\
115 116 117
    - run_git_archive.cmd
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
118
  cache:
Victor Yacovlev's avatar
Victor Yacovlev committed
119
    key: $CI_PIPELINE_ID
Victor Yacovlev's avatar
Victor Yacovlev committed
120
    untracked: true
Victor Yacovlev's avatar
Victor Yacovlev committed
121
    paths:
Victor Yacovlev's avatar
Victor Yacovlev committed
122
      - build/
Victor Yacovlev's avatar
Victor Yacovlev committed
123 124 125 126 127 128 129 130 131 132 133 134 135
      
dist:mac:
  stage: dist
  tags:
    - mac
  script:
    - cd build
    - macdeployqt Kumir.app
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/
136 137 138 139

pack:win32:
  stage: pack
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
140
    - cd build
141
    - cd kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%
Victor Yacovlev's avatar
Victor Yacovlev committed
142
    - call "%NSIS_EXECUTABLE%" kumir2.nsi
143
    - move /Y kumir2-*-install.exe ..\..\
Victor Yacovlev's avatar
Victor Yacovlev committed
144 145 146 147 148
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/
Victor Yacovlev's avatar
Victor Yacovlev committed
149 150 151
  artifacts:
    paths:
      - kumir2-*-install.exe
152 153
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
    
pack:mac:
  stage: pack
  script:
    - cd build
    - macdeployqt Kumir.app -dmg
    - mv Kumir.dmg Kumir-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%.dmg
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/
  artifacts:
    paths:
      - Kumir-*.dmg
  tags:
    - mac