forked from home-assistant/operating-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-release.yml
95 lines (87 loc) · 2.34 KB
/
azure-pipelines-release.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
# https://dev.azure.com/home-assistant
trigger:
batch: true
tags:
include:
- '*'
exclude:
- untagged*
pr: none
variables:
- name: versionGHR
value: 'v0.13.0'
- group: github
- group: rauc
jobs:
- job: 'VersionValidate'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
. buildroot-external/meta
if [ "${VERSION_MAJOR}.${VERSION_BUILD}" != "$(Build.SourceBranchName)" ]; then
exit 1
fi
displayName: 'Check version of branch/tag'
- job: 'Release'
dependsOn:
- 'VersionValidate'
timeoutInMinutes: 240
pool:
name: 'Buildroot'
strategy:
maxParallel: 1
matrix:
OpenVirtualAppliance:
board: 'ova'
IntelNuc:
board: 'intel_nuc'
OdroidC2:
board: 'odroid_c2'
OdroidN2:
board: 'odroid_n2'
OdroidXU4:
board: 'odroid_xu4'
RaspberryPi:
board: 'rpi'
RaspberryPi0-W:
board: 'rpi0_w'
RaspberryPi2:
board: 'rpi2'
RaspberryPi3:
board: 'rpi3'
RaspberryPi3-64:
board: 'rpi3_64'
RaspberryPi4:
board: 'rpi4'
RaspberryPi4-64:
board: 'rpi4_64'
AsusTinker:
board: 'tinker'
workspace:
clean: 'all'
steps:
- script: |
echo -e "-----BEGIN CERTIFICATE-----\n$(releaseCertificate)\n-----END CERTIFICATE-----" > cert.pem
echo -e "-----BEGIN PRIVATE KEY-----\n$(releaseKey)\n-----END PRIVATE KEY-----" > key.pem
displayName: 'Add release PKI certs'
- script: |
sudo docker build -t hassos:azure .
displayName: 'Build container for HassOS'
- script: |
curl -SsL https://github.com/tcnksm/ghr/releases/download/$(versionGHR)/ghr_$(versionGHR)_linux_amd64.tar.gz | tar xzf -
cp ghr_$(versionGHR)_linux_amd64/ghr .
rm -rf ghr_$(versionGHR)_linux_amd64
displayName: 'Install GHR'
- script: |
BUILDER_UID="$(id -u)"
BUILDER_GID="$(id -g)"
sudo docker run --rm --privileged -v "$(pwd):/build" \
-e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \
-v "/mnt/build-cache:/cache" \
hassos:azure make $(board)
displayName: 'Build $(board)'
- script: |
./ghr -t $(githubToken) -replace $(Build.SourceBranchName) release/
displayName: 'Upload $(board)'