.gitlab-ci.yml 2.36 KB
Newer Older
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
1 2 3 4 5 6 7 8
stages:
  - build
  - test
  - docs
  - update-assembly-info
  - build-release
  - semantic-release
  - release
9
  - pre_release
10

Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
11 12 13
build:
  stage: build
  script:
14 15 16
    - PowerShell .\build.ps1 -Target Build -Configuration Debug
  variables:
    GIT_STRATEGY: clone
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
17 18 19
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID
20

Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
21 22 23
test:
  stage: test
  script:
24
    - PowerShell .\build.ps1 -Target LinterAndTest -Configuration Debug
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
25 26 27 28 29 30
  variables:
    GIT_STRATEGY: none
  dependencies:
    - build
  artifacts:
    reports:
31 32 33
      junit: "./Artifacts/TestResults.xml"
    paths:
      - "./Artifacts/*"
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
34 35 36 37 38 39 40
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID

update-assembly-info:
  stage: update-assembly-info
  script:
41
    - PowerShell .\build.ps1 -Target UpdateAssemblyInfo
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
42 43 44 45 46 47 48 49 50 51 52 53 54
  variables:
    GIT_STRATEGY: none
  dependencies:
    - test
  only:
    - master
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID

build-release:
  stage: build-release
  script:
55 56
    - PowerShell .\build.ps1 -Target Build -Configuration Release
    - PowerShell .\build.ps1 -Configuration Release -Target NugetPack
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
  variables:
    GIT_STRATEGY: none
  dependencies:
    - update-assembly-info
  only:
    - master
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID

docs:
  stage: docs
  script:
    - .\publishDocs.ps1 $GITLAB_TOKEN
  variables:
    GIT_STRATEGY: none
  dependencies:
    - test
  only:
    - master
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID
80

Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
81 82 83
semantic-release:
  stage: semantic-release
  script:
84
    - PowerShell .\build.ps1 -Target SemanticRelease
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
85 86 87 88 89 90 91 92 93
  variables:
    GIT_STRATEGY: none
  dependencies:
    - test
  only:
    - master
  except:
    variables:
      - $GITLAB_USER_ID == $GIT_BOT_USER_ID
94

Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
95
release:
96
  before_script:
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
97 98
  stage: release
  script:
99 100 101
    - PowerShell .\build.ps1 -Target Build -Configuration Release
    - PowerShell .\build.ps1 -Configuration Release -Target NugetPack
    - PowerShell .\build.ps1 -Configuration Release -Target NugetPush --nugetApiKey="$NUGET_API_KEY"
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
102
  variables:
103
    GIT_STRATEGY: clone
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
104 105
  artifacts:
    paths:
106
      - "./Artifacts/*"
Benedikt Heinrichs's avatar
Benedikt Heinrichs committed
107 108
  only:
    - tags
109 110 111 112 113 114 115 116 117 118 119 120 121 122

pre_release:
  stage: pre_release
  script:
    - PowerShell .\build.ps1 -Target Build -Configuration Release
  variables:
    GIT_STRATEGY: clone
  artifacts:
    paths:
      - "./Artifacts/*"
  when: manual
  except:
    - tags
    - master