summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 469f25ef096797c1565879a262c137c990c8c108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
image: registry.gitlab.com/kurator1/docker-kurator/archlinux-kurator

stages:
  - build
  - test
  - package
  - deploy

build-linux:
  stage: build
  script:
    - cmake -B build-linux/ .
    - cmake --build build-linux/
  artifacts:
    paths:
      - build-linux/
  cache:
    key:
      files:
        - contrib/CMakeLists.txt
      prefix: $CI_JOB_NAME
    paths:
      - build-linux/_deps

build-windows:
  stage: build
  script:
    - x86_64-w64-mingw32-cmake -B build-windows/ .
    - cmake --build build-windows/
  artifacts:
    paths:
      - build-windows/
  cache:
    key:
      files:
        - contrib/CMakeLists.txt
      prefix: $CI_JOB_NAME
    paths:
      - build-windows/_deps

test-linux:
  stage: test
  needs: ["build-linux"]
  script:
    - ctest --test-dir build-linux/ --output-junit linux.xml
  artifacts:
    reports:
      junit: build-linux/linux.xml

test-windows:
  stage: test
  needs: ["build-windows"]
  before_script:
    - x86_64-w64-mingw32-wine hostname
  script:
    - ctest --test-dir build-windows/ --output-junit windows.xml
  artifacts:
    reports:
      junit: build-windows/windows.xml

package-linux:
  stage: package
  needs: ["build-linux", "test-linux"]
  script:
    - cmake --install build-linux/ --prefix kurator-x86_64-linux/
  artifacts:
    name: kurator-x86_64-linux
    paths:
      - kurator-x86_64-linux/

package-windows:
  stage: package
  needs: ["build-windows", "test-windows"]
  script:
    - cmake --install build-windows/ --prefix kurator-x86_64-windows/
    - cp /usr/x86_64-w64-mingw32/bin/lib{ssp-0,gcc_s_seh-1,raylib,stdc++-6,winpthread-1}.dll kurator-x86_64-windows/
  artifacts:
    name: kurator-x86_64-windows
    paths:
      - kurator-x86_64-windows/

steam:
  stage: deploy
  # All build-*/ will have matching vdfs generated as they are configured from scratch against same revision.
  needs: ["build-linux", "package-linux", "package-windows"]
  script:
    - steamcmd
      +login "$STEAM_USERNAME" "$STEAM_PASSWORD" $STEAM_GUARD
      +run_app_build "$CI_PROJECT_DIR/build-linux/default.vdf"
      +quit
  artifacts:
    paths:
      - .steam_cache/
  rules:
    - if: $CI_COMMIT_REF_PROTECTED == "true"
      when: manual