.gitlab-ci.yml 2.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
before_script:
  - ./gradlew unlockIOSKeyChain
  - git submodule update --init --recursive
18

19 20 21 22
stages:
  - build
  - unitTest
  - iTest-desktop
23 24 25 26 27

# Development build
# Runs for every commit
# Connects to development server
dev_debug:
28 29
  stage: build
  except:
30
    - tags
31
  script:
32
      - ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
33 34 35
  artifacts:
      expire_in: 2 weeks
      paths:
36 37 38 39 40
      - android/build/outputs/apk/*debug*.apk
      - android/build/outputs/apk/*iTest*.apk
      - ios/build/robovm/*debug*.ipa
      - ios/build/robovm/*iTest*.ipa
      - desktop/build/libs/*debug*.jar
41 42 43 44

# Release debug build
# Runs only on tags
# Connects to development server
45
release-debug:
46
  stage: build
47
  only:
48
      - tags
49
  script:
50
      - ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_DESKTOP_ARTEFACTS=true
51 52 53
  artifacts:
    paths:
    - android/build/outputs/apk/*debug*.apk
54
    - ios/build/robovm/*debug*.ipa
55
    - desktop/build/libs/*debug*.deb
56
    - desktop/build/outputs/*debug*.exe
57 58 59 60 61 62

# Actual release build
# Runs only on tags
# Connects to production server
# -PTABLEXIA_RELEASE_BUILD=true - Tells Tablexia to use production server
release:
63
  stage: build
64 65
  only:
    - tags
66
  script:
67
    - ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_RELEASE_BUILD=true -PTABLEXIA_ASSETS_OPTIMIZE=true -PTABLEXIA_DESKTOP_ARTEFACTS=true
68
  artifacts:
69 70 71 72 73 74
    paths:
    - android/build/outputs/apk/*release*.apk
    - ios/build/robovm/*release*.ipa
    - desktop/build/libs/*release*.deb
    - desktop/build/outputs/*release*.exe

75 76 77 78
unitTest:
  stage: unitTest
  script:
    - ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum
79

80 81
iTest-desktop:
  stage: iTest-desktop
82 83
  only:
    - schedules
84 85 86
  script:
    - ./gradlew desktop:runITestBundle
  artifacts:
87
      when: always
88
      expire_in: 3 days
89
      paths:
90
      - desktop/build/libs/iTest_results/*.log
91
      - desktop/build/libs/iTest_results/*error.png