-
Notifications
You must be signed in to change notification settings - Fork 40
/
.cirrus.yml
158 lines (125 loc) · 4.52 KB
/
.cirrus.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
container:
image: andronixapp/package-builder:latest
##
## When doing release builds (branch 'master'), update Docker image if
## required.
##
docker_builder:
name: Update docker image
only_if: $CIRRUS_BRANCH == 'master'
env:
DOCKER_USERNAME: andronixapp
DOCKER_PASSWORD: ENCRYPTED[f1e136ddb0b71978bd017089b1ba5101d43e263b5e22d3121055b948890110b8f98208eb26424ffe4bdbd99a7a0502b5]
script: |
bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --update-docker
##
## Perform basic check for errors in build.sh package scripts.
## If error found, exit with error code to stop build.
##
task:
container:
cpu: 1
memory: 4
name: Lint packages
timeout_in: 5m
depends_on:
- Update docker image
script: |
bash scripts/lint-packages.sh
##
## Determine changes in the last push, find modified packages and
## build them for aarch64/arm/i686/x86_64 architectures.
##
## Built packages are accessible from Cirrus CI web interface.
##
task:
container:
# Max configuration required by few large packages such as `rust`.
cpu: 8
memory: 24
name: Build packages
# 2 hours is a maximal timeout available for free use.
timeout_in: 120m
depends_on:
- Lint packages
environment:
TERMUX_MAKE_PROCESSES: 8
matrix:
- TERMUX_ARCH: aarch64
- TERMUX_ARCH: arm
- TERMUX_ARCH: i686
- TERMUX_ARCH: x86_64
# Do not use built-in git client provided by Cirrus as it may
# cause problems when determining changed files.
clone_script: |
if [[ -z "$CIRRUS_PR" ]]; then
git clone --recursive --branch="$CIRRUS_BRANCH" "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR"
git reset --hard "$CIRRUS_CHANGE_IN_REPO"
else
git clone --recursive "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR"
git fetch origin "pull/$CIRRUS_PR/head:pull/$CIRRUS_PR"
git reset --hard "$CIRRUS_CHANGE_IN_REPO"
fi
build_script: |
export TERMUX_DEBDIR="/tmp/debs-${TERMUX_ARCH}"
ln -s "$TERMUX_DEBDIR" debs
bash ./scripts/build/ci/cirrus-ci_dispatcher.sh
aarch64_debs_cache:
folder: "/tmp/debs-aarch64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64"
arm_debs_cache:
folder: "/tmp/debs-arm"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm"
i686_debs_cache:
folder: "/tmp/debs-i686"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686"
x86-64_debs_cache:
folder: "/tmp/debs-x86_64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64"
output_artifacts:
path: "./debs/*.deb"
##
## When doing release build (branch 'master'), upload built packages
## to APT repository on Bintray.
##
task:
container:
cpu: 1
memory: 4
name: Upload packages to Bintray
only_if: $CIRRUS_BRANCH == 'master'
timeout_in: 60m
depends_on:
- Build packages
environment:
BINTRAY_USERNAME: imprakharshukla
BINTRAY_API_KEY: ENCRYPTED[6dd62eec639e531a066d198368d73a890d91f28d92652b4b7b4eed40a175c1bb13b43b66e74441c3d4b7e85d2eb3e808]
BINTRAY_GPG_SUBJECT: andronixapp
BINTRAY_GPG_PASSPHRASE: ENCRYPTED[c766a2569ac7b479de6aba07da6ba146e90d96013cdc8a86d1d68e4d76e9e855c05d93f8727d2838140856ff85ac655a]
TERMUX_ANDROID_HOME: /data/data/studio.com.techriz.andronix/files/home
TERMUX_PREFIX: /data/data/studio.com.techriz.andronix/files/usr
# Do not use built-in git client provided by Cirrus as it may
# cause problems when determining changed files.
clone_script: |
if [[ -z "$CIRRUS_PR" ]]; then
git clone --recursive --branch="$CIRRUS_BRANCH" "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR"
git reset --hard "$CIRRUS_CHANGE_IN_REPO"
else
git clone --recursive "https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git" "$CIRRUS_WORKING_DIR"
git fetch origin "pull/$CIRRUS_PR/head:pull/$CIRRUS_PR"
git reset --hard "$CIRRUS_CHANGE_IN_REPO"
fi
aarch64_debs_cache:
folder: "./debs"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64"
arm_debs_cache:
folder: "./debs"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm"
i686_debs_cache:
folder: "./debs"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686"
x86-64_debs_cache:
folder: "./debs"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64"
script: |
bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --upload