.gitlab-ci.yml 5.78 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
  stage: configure
  script:
    - mkdir build
    - cd build
Victor Yacovlev's avatar
Victor Yacovlev committed
12
    - export PATH=$QTDIR_MAC/bin:$PATH
Victor Yacovlev's avatar
Victor Yacovlev committed
13 14 15 16 17 18 19 20
    - cmake -DUSE_QT=5 -DCMAKE_BUILD_TYPE=Release ..
  tags:
    - mac
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/  
21 22 23 24

configure:win32:
  stage: configure
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
25
    - md build
26 27 28 29 30 31 32
    - 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
33
    - 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" ..
34 35
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
36
  cache:
Victor Yacovlev's avatar
Victor Yacovlev committed
37
    key: $CI_PIPELINE_ID
Victor Yacovlev's avatar
Victor Yacovlev committed
38
    untracked: true
Victor Yacovlev's avatar
Victor Yacovlev committed
39
    paths:
Victor Yacovlev's avatar
Victor Yacovlev committed
40
      - build/
41 42 43 44

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

dist:win32:
  stage: dist
  script:
Victor Yacovlev's avatar
Victor Yacovlev committed
79
    - cd build
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 109 110
    - 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
111
    - cd ..
112 113 114 115 116
    - 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\
117 118 119
    - run_git_archive.cmd
  tags:
    - windows
Victor Yacovlev's avatar
Victor Yacovlev committed
120
  cache:
Victor Yacovlev's avatar
Victor Yacovlev committed
121
    key: $CI_PIPELINE_ID
Victor Yacovlev's avatar
Victor Yacovlev committed
122
    untracked: true
Victor Yacovlev's avatar
Victor Yacovlev committed
123
    paths:
Victor Yacovlev's avatar
Victor Yacovlev committed
124
      - build/
Victor Yacovlev's avatar
Victor Yacovlev committed
125 126 127 128 129 130 131
      
dist:mac:
  stage: dist
  tags:
    - mac
  script:
    - cd build
Victor Yacovlev's avatar
Victor Yacovlev committed
132
    - export PATH=$QTDIR_MAC/bin:$PATH
Victor Yacovlev's avatar
Victor Yacovlev committed
133
    - macdeployqt Kumir.app
Victor Yacovlev's avatar
Victor Yacovlev committed
134
    - echo "Libraries = Frameworks" >> Kumir.app/Contents/Resources/qt.conf
Victor Yacovlev's avatar
Victor Yacovlev committed
135 136 137 138 139
  cache:
    key: $CI_PIPELINE_ID
    untracked: true
    paths:
      - build/
140 141 142 143

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