-
Notifications
You must be signed in to change notification settings - Fork 44
/
.gitlab-ci.yml
132 lines (120 loc) · 3.68 KB
/
.gitlab-ci.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
stages:
# - test
- build
- deploy
# - post_deploy
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
before_script:
- gem install bundler
- bundle install
- cp $DOT_ENV .env
- git config --replace-all user.name "$GIT_USER_NAME"
- git config --replace-all user.email $GIT_USER_EMAIL
- git remote set-url origin git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
- git update-index --skip-worktree ExposureNotification/Configurations.swift
## Stage: test
#test_project:
# stage: test
# script:
# - bundle exec fastlane tests
# artifacts:
# name: "$CI_PROJECT_TITLE-Test-Report-$CI_COMMIT_SHORT_SHA"
# paths:
# - fastlane/test_output/report.*
# reports:
# junit: fastlane/test_output/report.junit
# tags:
# - mac
## Stage: build
build_debug:
stage: build
script:
- cp $CONFIG_DEBUG ExposureNotification/Configurations.swift
- bundle exec fastlane build_debug
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH =~ /^feature\//'
when: manual
allow_failure: true
artifacts:
name: "$CI_PROJECT_TITLE-Debug-$CI_COMMIT_SHORT_SHA"
paths:
- "build/ExposureNotification.app.dSYM.zip"
- "build/ExposureNotification.ipa"
tags:
- mac
bump_version:
stage: build
script:
- bundle exec fastlane bump_version commit:"true"
- git push origin HEAD:$CI_COMMIT_BRANCH
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
when: never
- if: '$CI_COMMIT_BRANCH == "develop"'
when: manual
allow_failure: true
- if: '$CI_COMMIT_BRANCH =~ /^release\//'
- if: '$CI_COMMIT_BRANCH =~ /^hotfix\//'
tags:
- mac
- deploy
build_release:
stage: build
script:
- cp $CONFIG_RELEASE ExposureNotification/Configurations.swift
- bundle exec fastlane build_project config:"release"
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_COMMIT_BRANCH == "develop" && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
- if: '$CI_COMMIT_BRANCH =~ /^release\// && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
- if: '$CI_COMMIT_BRANCH =~ /^hotfix\// && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
artifacts:
name: "$CI_PROJECT_TITLE-Release-$CI_COMMIT_SHORT_SHA"
paths:
- "build/ExposureNotification.app.dSYM.zip"
- "build/ExposureNotification.ipa"
tags:
- mac
- deploy
## Stage: deploy
deploy_release:
stage: deploy
script:
- bundle exec fastlane deploy_to_testflight
dependencies:
- build_release
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_COMMIT_BRANCH == "develop" && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
- if: '$CI_COMMIT_BRANCH =~ /^release\// && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
- if: '$CI_COMMIT_BRANCH =~ /^hotfix\// && $CI_COMMIT_TITLE =~ /^^Bump Version to v(\d+\.){2}\d+ build \d+/'
tags:
- mac
- deploy
## Stage: post_deploy
#upload_dsyms:
# stage: post_deploy
# script:
# - bundle exec fastlane refresh_dsyms
# dependencies:
# - deploy_release
# rules:
# - if: $CI_COMMIT_TAG
# when: never
# - if: '$CI_COMMIT_BRANCH == "develop" && $CI_COMMIT_TITLE =~ /^Bump Version to v(\d+\.){2}\d+ build \d+/'
# allow_failure: true
# - if: '$CI_COMMIT_BRANCH =~ /^release\// && $CI_COMMIT_TITLE =~ /^Bump Version to v(\d+\.){2}\d+ build \d+/'
# allow_failure: true
# - if: '$CI_COMMIT_BRANCH =~ /^hotfix\// && $CI_COMMIT_TITLE =~ /^Bump Version to v(\d+\.){2}\d+ build \d+/'
# allow_failure: true
# tags:
# - mac