forked from apertus-open-source-cinema/axiom-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
57 lines (55 loc) · 3.28 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
docker_builder:
only_if: $CIRRUS_TAG !=~ "nightly/.*"
env:
TOKEN: ENCRYPTED[64daf2f8fbeaca02bfe024de054c12914298cff8d09eed14ef6e89d3730ad95b4b3f9efce43959f98318e31fcec7e53f]
matrix:
DEVICE: beta
DEVICE: micro
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
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;
make_script: |
./makefiles/docker-make.sh DEVICE=$DEVICE
# compress the image
FILE=axiom-$DEVICE$([ -z $CIRRUS_PR ] || echo "-pr-$CIRRUS_PR")-$(git describe --always --abbrev=8).img.xz
xz -kT $(nproc) build/axiom-$DEVICE.img
mv build/axiom-$DEVICE.img.xz build/$FILE
image_upload_artifacts:
path: "build/axiom-*.img.xz"
image_notify_script: |
if [ $DEVICE = 'beta' ]; then
if [[ ! -z "$CIRRUS_PR" ]]; then
wget https://github.com/cloudposse/github-commenter/releases/download/0.5.0/github-commenter_linux_amd64
chmod a+x github-commenter_linux_amd64
./github-commenter_linux_amd64 -token $TOKEN -owner $CIRRUS_REPO_OWNER -repo $CIRRUS_REPO_NAME -type pr -number $CIRRUS_PR \
-comment "[//]: # (tracking-code: wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa)
Download a build of the latest (untested) commit at https://api.cirrus-ci.com/v1/artifact/task/$CIRRUS_TASK_ID/image_upload/$(ls build/axiom-*.img.xz)" \
-delete-comment-regex "wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa"
fi
fi
test_script: |
./makefiles/docker-make.sh DEVICE=$DEVICE -o build/axiom-$DEVICE.img -o build/boot.fs/.install_stamp test
github_release_script: |
if [ $CIRRUS_BRANCH = 'master' ]; then
FILE=axiom-$DEVICE$([ -z $CIRRUS_PR ] || echo "-pr-$CIRRUS_PR")-$(git describe --always --abbrev=8).img.xz
# get the github-release tool
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
tar -xf linux-amd64-github-release.tar.bz2
# create the release and upload the compressed image
./bin/linux/amd64/github-release release -u $CIRRUS_REPO_OWNER -r $CIRRUS_REPO_NAME -t "nightly/$(git describe --always --abbrev=8)" -s $TOKEN -n "Unstable Development Snapshot $(./bin/linux/amd64/github-release info -u $CIRRUS_REPO_OWNER -r $CIRRUS_REPO_NAME | grep "Build on" | wc -l)" -c $CIRRUS_CHANGE_IN_REPO --pre-release -d " \
A development snapshot of the axiom firmware.
Build on $(date) for commit $(git describe --always --abbrev=8).
\`\`\`diff
- Warning! The nightly images are not veryfied by a human and might damage your camera permanently.
- Only continue, if you know, what you are doing!
\`\`\`
" || true
./bin/linux/amd64/github-release upload -u $CIRRUS_REPO_OWNER -r $CIRRUS_REPO_NAME -t "nightly/$(git describe --always --abbrev=8)" -s $TOKEN -n "$FILE" -f build/$FILE
else
echo "not creating a github release, because this is not a build for the master branch"
fi