-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
138 lines (126 loc) · 3.21 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
133
134
135
136
137
138
image: barichello/godot-ci:3.2.3
# Cache imported assets between runs
cache:
key: import-assets
paths:
- .import/
stages:
- export
- deploy
- notification
variables:
PROJECT_DIRECTORY: project
EXPORT_NAME: wojowniczy_myszojelen
LINK_ARTIFACT: 'true'
linux:
stage: export
script:
- mkdir -v -p build/linux
- cd $PROJECT_DIRECTORY
- godot -v --export "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/linux
rules:
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "release"'
when: on_success
windows:
stage: export
script:
- mkdir -v -p build/windows
- cd $PROJECT_DIRECTORY
- godot -v --export "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
untracked: true
paths:
- build/windows
rules:
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "release"'
when: on_success
web:
stage: export
script:
- mkdir -v -p build/web
- cd $PROJECT_DIRECTORY
- godot -v --export "HTML5" ../build/web/index.html
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/web
rules:
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "release"'
when: on_success
# Itch.io Deploy
itchio:linux:
stage: deploy
script:
- butler push ./build/linux $ITCHIO_USERNAME/$ITCHIO_GAME:linux
dependencies:
- linux
only:
- release
itchio:windows:
stage: deploy
script:
- butler push ./build/windows $ITCHIO_USERNAME/$ITCHIO_GAME:windows
dependencies:
- windows
only:
- release
itchio:web:
stage: deploy
script:
- butler push ./build/web $ITCHIO_USERNAME/$ITCHIO_GAME:web
dependencies:
- web
only:
- release
success_notification:
stage: notification
dependencies:
- windows
artifacts:
paths:
- build/*
script:
- apt-get update -qq
- apt-get -qq -y install curl
- wget https://raw.githubusercontent.com/Flying-Octopus-Team/gitlab-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
rules:
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "release"'
when: on_success
failure_notification:
stage: notification
script:
- apt-get update -qq
- apt-get -qq -y install curl
- wget https://raw.githubusercontent.com/Flying-Octopus-Team/gitlab-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
rules:
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: on_failure
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_failure
- if: '$CI_COMMIT_BRANCH == "release"'
when: on_failure