-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (146 loc) · 5.55 KB
/
build.yml
File metadata and controls
160 lines (146 loc) · 5.55 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Controller CI
on:
push:
# branches:
# - master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
native-image:
- coordinator
- 'deconz-server'
- 'broadlink-server'
- 'tplink-server'
- 'sonos-server'
- 'kodi-server'
steps:
- name: checkout
uses: actions/checkout@v1
with:
submodules: true
- name: setup-graalvm-ce
uses: rinx/setup-graalvm-ce@v0.0.5
with:
graalvm-version: "20.1.0"
java-version: "java11"
native-image: "true"
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Cache ivy2
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
restore-keys: |
${{ runner.os }}-ivy2-
${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
- name: Use Node.js 12.x
if: ${{ matrix.native-image == 'all-in-one' || matrix.native-image == 'coordinator' }}
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install, build, and test
if: ${{ matrix.native-image == 'all-in-one' || matrix.native-image == 'coordinator' }}
run: |
mkdir -p modules/api/src/main/resources/static
cd controller-ui
npm install
npm run build --if-present
- name: scala build
run: |
sbt -Dsbt.coursier.home=~/.sbt/coursier/ '; project ${{ matrix.native-image }}; graalvm-native-image:packageBin' -J-Xms3G -J-Xmx6G
- name: docker login
run: docker login -u janstenpickle -p '${{secrets.DOCKERHUB}}'
- name: docker build
run: |
pushd docker/${{ matrix.native-image }}
sh build.sh
popd
homekit:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '15'
- name: Cache ivy2
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
restore-keys: |
${{ runner.os }}-ivy2-
${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
- name: scala build
run: |
sbt -Dsbt.coursier.home=~/.sbt/coursier/ '; project homekitServer; docker:publishLocal' -J-Xms3G -J-Xmx6G
- name: docker login
run: docker login -u janstenpickle -p '${{secrets.DOCKERHUB}}'
- name: docker build
run: |
docker tag janstenpickle/controller-homekit-server:latest janstenpickle/controller-homekit-server:$GITHUB_RUN_NUMBER
docker push janstenpickle/controller-homekit-server:$GITHUB_RUN_NUMBER
all-in-one:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '15'
- name: Cache ivy2
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
restore-keys: |
${{ runner.os }}-ivy2-
${{ runner.os }}-ivy2-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}
${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/project/plugins.sbt') }}
- name: scala build
run: |
sbt -Dsbt.coursier.home=~/.sbt/coursier/ '; project all-in-one; docker:publishLocal' -J-Xms3G -J-Xmx6G
- name: docker login
run: docker login -u janstenpickle -p '${{secrets.DOCKERHUB}}'
- name: docker build
run: |
docker tag janstenpickle/controller:latest janstenpickle/controller-all-in-one:$GITHUB_RUN_NUMBER
docker push janstenpickle/controller-all-in-one:$GITHUB_RUN_NUMBER