-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.drone.yml
81 lines (72 loc) · 3.04 KB
/
.drone.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
pipeline:
# Make sure the host machine is able to emulate arm devices
arm-support:
when:
matrix:
ARCHITECTURE: armhf
privileged: true
image: gcr.io/admobilize-testing/gce-builder:latest
commands:
- set +e
- mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
- test ! -e /proc/sys/fs/binfmt_misc/arm && echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register || echo 'arm file already exists'
build-debs:
image: gcr.io/admobilize-testing/creator-builder-${ARCHITECTURE}-${DISTRIBUTION}-${CODENAME}:${IMAGE_TAG}
privileged: true
commands:
- curl https://apt.matrix.one/doc/apt-key.gpg | apt-key add -
- echo "deb https://apt.matrix.one/raspbian ${CODENAME} main" > /etc/apt/sources.list.d/matrixlabs.list
- apt install -y dkms
- ${UPDATE_CMD}
- debuild -us -uc -b
- mv ../*.deb .
upload-debs:
when:
branch: master
event: [ push, tag ]
status: success
image: gcr.io/admobilize-testing/gce-builder:latest
secrets: [aws_access_key_id, aws_secret_access_key, gpg_key, gpg_pass]
commands:
# Prepare GPG
- echo "$${GPG_KEY}" > /tmp/tmpkey && gpg --import --batch /tmp/tmpkey && rm /tmp/tmpkey
- echo "personal-digest-preferences SHA512" >> /root/.gnupg/gpg.conf
# Only TAG events are published to main
- export COMPONENT=$([ "${DRONE_BUILD_EVENT}" = "tag" ] && echo "main" || echo "unstable")
- export PKG_VER=$(dpkg-parsechangelog --show-field Version -ldebian/changelog)
# Upload packages
- mv matrixio-kernel-modules_$${PKG_VER}_all.deb
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_all.deb
- echo "$${GPG_PASS}" | deb-s3 upload --bucket apt.matrix.one
--prefix $DISTRIBUTION
--component $COMPONENT
--codename $CODENAME
--access-key-id $${AWS_ACCESS_KEY_ID}
--secret-access-key $${AWS_SECRET_ACCESS_KEY}
--sign [email protected]
--gpg-options="--batch --passphrase-fd 0"
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_all.deb
# Render the notification template for the notify-slack step
- j2 --var-delimiter '%%' .drone/slack.tpl > notification.tpl
notify-always:
image: plugins/slack
secrets: [slack_webhook]
username: drone-ci-builder
channel: notifications
when:
status: [ success, failure ]
branch: master
event: [ push, tag ]
template: file:///drone/src/github.com/matrix-io/matrixio-kernel-modules/notification.tpl
matrix:
include:
- CODENAME: stretch
DISTRIBUTION: raspbian
ARCHITECTURE: armhf
UPDATE_CMD: "apt update"
IMAGE_TAG: 84d9bfb7
- CODENAME: buster
DISTRIBUTION: raspbian
ARCHITECTURE: armhf
UPDATE_CMD: "apt update -y --allow-releaseinfo-change"
IMAGE_TAG: 84d9bfb7