forked from parity-js/shell
-
Notifications
You must be signed in to change notification settings - Fork 21
/
.gitlab-ci.yml
106 lines (98 loc) · 2.73 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
stages:
- build
- package
- publish
image: parity/rust:gitlab-ci
cache:
key: "${CI_JOB_NAME}"
paths:
- ${CI_PROJECT_DIR}/target/
- ${CI_PROJECT_DIR}/cargo/
- node_modules/
- .cache
- $HOME/.cache
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
only: &releaseable_branches
- schedules # Our nightly builds from schedule, on `master`
- /^v[0-9]+\.[0-9]+\.[0-9]+$/ # Our version tags
- ci-package
- master
.publishable_branches: # list of git refs for publishing builds to the "production" locations
only: &publishable_branches
- schedules # Our nightly builds from schedule, on `master`
- /^v[0-9]+\.[0-9]+\.[0-9]+$/ # Our version tags
- ci-package
- master
before_script:
- npm install
- export VERSION=$(node -p "require('./package.json').version")
# Stage - build
build:
stage: build
script:
- scripts/lint.sh
- scripts/test.sh
- scripts/build.sh
tags:
- rust-stable
# Stage package binaries
package:binaries:linux:
stage: package
only: *releaseable_branches
script:
- npm run release --linux
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 week
paths:
- dist/*.deb
- dist/*.snap
- dist/*.AppImage
- dist/*.xz
tags:
- rust-stable
package:binaries:mac:
stage: package
only: *releaseable_branches
script:
- export ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true
- npm run release -- --mac
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 week
paths:
- dist/*.pkg
tags:
- osx
package:binaries:windows:
stage: package
only: *releaseable_branches
image: electronuserland/builder:wine
script:
- npm run release -- --win
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 week
paths:
- dist/*.exe
tags:
- rust-stable
# Stage publish
publish:snap:
stage: publish
only: *publishable_branches
image: snapcore/snapcraft:stable
dependencies:
- package:binaries:linux
variables:
BUILD_ARCH: amd64
before_script:
- export VERSION=$(grep -m 1 "version" package.json | awk '{print $2}' | tr -d '",' | tr -d "\n")&&echo "Version:" $VERSION
script:
- scripts/publish-snap.sh
tags:
- rust-stable
#gitsync enabled