-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.cnb.yml
More file actions
97 lines (94 loc) · 3.19 KB
/
Copy path.cnb.yml
File metadata and controls
97 lines (94 loc) · 3.19 KB
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
$:
vscode:
- runner:
cpus: 16
docker:
image: docker.cnb.cool/zhxycn/env:latest
volumes:
- /opt/android-sdk:copy-on-write
- /root/.bun/install/cache:copy-on-write
services:
- vscode
- docker
imports:
- https://cnb.cool/TokenTeam/secrets/-/blob/main/expo.yml
env:
CNB_WELCOME_CMD: bash scripts/build-android.sh development
main:
push:
- docker:
image: docker.cnb.cool/zhxycn/env:latest
volumes:
- /root/.bun/install/cache:copy-on-write
- node_modules:copy-on-write
stages:
- script: |
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
bun install --frozen-lockfile
bun run lint
web_trigger_ota:
- docker:
image: docker.cnb.cool/zhxycn/env:latest
volumes:
- /root/.bun/install/cache:copy-on-write
- node_modules:copy-on-write
imports:
- https://cnb.cool/TokenTeam/secrets/-/blob/main/expo.yml
stages:
- script: |
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
bun install --frozen-lockfile
bash scripts/ota-update.sh --token "$OTA_TOKEN"
"**":
web_trigger_job:
- runner:
cpus: 16
docker:
image: docker.cnb.cool/zhxycn/env:latest
volumes:
- /opt/android-sdk:copy-on-write
- /root/.gradle:copy-on-write
- /root/.bun/install/cache:copy-on-write
- node_modules:copy-on-write
stages:
- imports:
- https://cnb.cool/TokenTeam/secrets/-/blob/main/expo.yml
script: |
IFS=',' read -ra PROFILES <<< "$BUILD_PROFILES"
for profile in "${PROFILES[@]}"; do
echo "=== Building $profile ==="
bash scripts/build-android.sh "$profile"
for f in *.apk; do
[ -f "$f" ] || continue
[[ "$f" == iwut-* ]] && continue
mv "$f" "iwut-${profile}.apk"
done
done
timeout: 2h
- image: cnbcool/attachments:latest
settings:
attachments:
- "./iwut-*.apk"
ttl: 7
- if: '[ "$UPLOAD" = "true" ]'
imports:
- https://cnb.cool/TokenTeam/secrets/-/blob/main/r2.yml
script: |
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
VERSION="$(bun -p "require('./package.json').version")"
ENDPOINT="https://${ACCOUNT_ID}.r2.cloudflarestorage.com"
for f in iwut-*.apk; do
[ -f "$f" ] || continue
NAME="${f#iwut-}"
aws s3 cp "$f" "s3://${BUCKET}/iwut/${VERSION}/${NAME}" \
--endpoint-url "$ENDPOINT" \
--content-type "application/vnd.android.package-archive" \
--only-show-errors
aws s3 cp "$f" "s3://${BUCKET}/iwut/latest/${NAME}" \
--endpoint-url "$ENDPOINT" \
--content-type "application/vnd.android.package-archive" \
--only-show-errors
done