-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
146 lines (125 loc) · 5.2 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
env:
CIRRUS_CLONE_DEPTH: 1
BUILD_HOSTNAME: "ak"
bot_api: "ENCRYPTED[5841801178484a8aa0f412210e7e109304b184fd1a1c754d882ee9bae52067acbca348430fa2a335429de490b830729f]"
task:
name: Test
skip: $CIRRUS_BRANCH == 'main'
only_if: $CIRRUS_REPO_OWNER == 'Ankits-lab'
timeout_in: 30m
persistent_worker:
labels:
name: ak
isolation:
container:
image: aarunalr/aosp-build
cpu: 2
memory: 4G
env_script:
- env
show_script:
- cat $CIRRUS_WORKING_DIR/build_rom.sh
notify_script:
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- your_telegram_id=@ROM_builders_junk
- show=$(cat $CIRRUS_WORKING_DIR/build_rom.sh)
- curl -s "https://api.telegram.org/bot${bot_api}/sendmessage" -d "text=<code>$device-$rom_name</code> Started
https://cirrus-ci.com/build/$CIRRUS_BUILD_ID
$show" -d "chat_id=${your_telegram_id}" -d "parse_mode=HTML"
test_script:
- set -e
- curl -Ls https://github.com/ROM-builders/temporary/raw/main/test.sh | bash
task:
name: Build
skip: $CIRRUS_BRANCH == 'main'
only_if: $CIRRUS_REPO_OWNER == 'ROM-builders'
depends_on:
- Test
timeout_in: 7h
persistent_worker:
labels:
name: ak
isolation:
container:
image: aarunalr/aosp-build
cpu: 8
memory: 28G
volumes:
- /home/cirrus/roms:/home/cirrus/roms
- /home/cirrus/ccache:/home/cirrus/ccache
- /home/cirrus/.config:/home/cirrus/.config
show_script:
- cat $CIRRUS_WORKING_DIR/build_rom.sh
sync_script:
- set -exv
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- mkdir -p ~/roms/$rom_name
- cd ~/roms/$rom_name
- rm -rf .repo/local_manifests
- command=$(head $CIRRUS_WORKING_DIR/build_rom.sh -n $(expr $(grep 'build/envsetup.sh' $CIRRUS_WORKING_DIR/build_rom.sh -n | cut -f1 -d:) - 1))
- only_sync=$(grep 'repo sync' $CIRRUS_WORKING_DIR/build_rom.sh)
- bash -c "$command" || (repo forall -c 'git checkout .' && bash -c "$only_sync") || (find -name shallow.lock -delete && find -name index.lock -delete && bash -c "$only_sync")
build_script:
- set -exv
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- cd ~/roms/$rom_name
- export CCACHE_DIR=~/ccache/$rom_name/$device
- export CCACHE_EXEC=$(which ccache)
- export USE_CCACHE=1
- ccache -M 10G
- ccache -z
- rm -rf device/*/*/vendorsetup.sh
- command=$(tail $CIRRUS_WORKING_DIR/build_rom.sh -n +$(expr $(grep 'build/envsetup.sh' $CIRRUS_WORKING_DIR/build_rom.sh -n | cut -f1 -d:) - 1)| head -n -1 | grep -v 'rclone copy')
- bash -c "$command"
ccache_stats_script:
- set -exv
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- export CCACHE_DIR=~/ccache/$rom_name/$device
- ccache -s
upload_script:
- set -exv
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- cd ~/roms/$rom_name
- engzip=$(ls out/target/product/$device/*-eng*.zip || true)
- otazip=$(ls out/target/product/$device/*-ota-*.zip | grep -v "hentai" | grep -v "evolution" || true)
- awaken=$(ls out/target/product/$device/Project-Awaken*.zip || true)
- octavi=$(ls out/target/product/$device/OctaviOS-R*.zip || true)
- p404=$(ls out/target/product/$device/?.*zip || true)
- rm -rf $engzip $otazip $awaken $octavi $p404
- dlink=$(basename out/target/product/$device/*.zip)
- command=$(grep 'rclone copy' $CIRRUS_WORKING_DIR/build_rom.sh)
- bash -c "$command"
- echo "Download link https://roms.cirrus-ci.workers.dev/0:/$device/$dlink"
remove_script:
- set -exv
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- cd ~/roms/$rom_name
- rm -rf out/target/product/$device
task:
name: Post Build
skip: $CIRRUS_BRANCH == 'main'
only_if: $CIRRUS_REPO_OWNER == 'Ankits-lab'
skip_notifications: true
depends_on:
- Build
timeout_in: 30m
persistent_worker:
labels:
name: ak
isolation:
container:
image: aarunalr/aosp-build
cpu: 2
memory: 4G
post_build_script:
- set -e
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d ' ' -f 2 | cut -d _ -f 2 | cut -d - -f 1)
- your_telegram_id=@ROM_builders_channel
- curl -s "https://api.telegram.org/bot${bot_api}/sendmessage" -d "text=<code>$device-$rom_name</code> Succeed
https://cirrus-ci.com/build/$CIRRUS_BUILD_ID" -d "chat_id=${your_telegram_id}" -d "parse_mode=HTML"