forked from SilentCircle/silent-phone-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
64 lines (53 loc) · 1.58 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
stages:
- build
# Common build settings
.common_build: &ref_common_build
variables:
CI_DEBUG_TRACE: "false"
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_IMAGE_VER: "v0.6"
DOCKER_TAG: "hub.silentcircle.org/eng/sc-android-build:${DOCKER_IMAGE_VER}"
# All these are required by the build script
BUILD_NUMBER_PREFIX: "${CI_COMMIT_REF_SLUG}"
WORKSPACE: "${CI_PROJECT_DIR}"
GRADLE_USER_HOME: "$WORKSPACE/.gradle"
SRC_ROOT: "$WORKSPACE"
JNI_ROOT: "${WORKSPACE}/silentphone2/support"
BUILD_SCRIPT: "silentphone2/.build-release/android-build.sh"
# We want all the files downloaded by Gradle to persist across builds
# for the same branch or tag.
cache:
key: "${CI_COMMIT_REF_NAME}"
paths:
- "${GRADLE_USER_HOME}/caches"
- "${GRADLE_USER_HOME}/wrapper"
image: "${DOCKER_TAG}"
tags:
- docker-debian
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: on_success
expire_in: 8 weeks
paths:
- silentphone2/build/outputs
allow_failure: false
# Development build
dev_build_job:
stage: build
except: # Except any tags of format vN.M+ or VN.M-rcX
- /^v\d+\.\d+(\.\d+)*(-rc\d+)?$/
script:
- bash -xv $BUILD_SCRIPT DEVELOP
<<: *ref_common_build
# Beta/RC build
beta_build_job:
stage: build
only:
- /^v\d+\.\d+(\.\d+)*-rc\d+$/
script:
- bash -xv $BUILD_SCRIPT RELEASE
<<: *ref_common_build
# We don't have a prod build job. Prod builds
# are rc (beta) builds that have passed QA and
# are deemed ready for release. They don't get rebuilt
# because that's risky and unnecessary.