11
11
# * SPDX-License-Identifier: Apache-2.0
12
12
# ********************************************************************************/
13
13
14
- name : kuksa_databroker-cli_build
14
+ name : Build kuksa-databroker-cli
15
15
16
16
on :
17
17
push :
@@ -32,37 +32,59 @@ concurrency:
32
32
33
33
jobs :
34
34
lint :
35
- name : Linting
35
+ name : Lint
36
36
runs-on : ubuntu-latest
37
37
38
38
steps :
39
39
- uses : actions/checkout@v4
40
-
40
+ - uses : actions/cache@v4
41
+ with :
42
+ path : |
43
+ ~/.cargo/bin/
44
+ ~/.cargo/registry/index/
45
+ ~/.cargo/registry/cache/
46
+ ~/.cargo/git/db/
47
+ target/
48
+ key : databroker-cli-lint-${{ hashFiles('**/Cargo.lock') }}
41
49
- name : cargo fmt
42
50
working-directory : ${{github.workspace}}
43
51
run : cargo fmt -- --check
44
52
- name : cargo clippy
45
53
working-directory : ${{github.workspace}}
46
54
run : cargo clippy --all-targets -- -W warnings -D warnings
55
+
47
56
check_ghcr_push :
57
+ name : Check access rights
48
58
uses : eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2
49
59
secrets : inherit
50
60
51
- # Run on selfhosted, because our runner has native ARM build in a remote
52
- # builder (no need for qemu)
53
61
build-container :
62
+ name : Build multiarch container
54
63
runs-on : ubuntu-latest
55
64
needs : check_ghcr_push
56
65
57
66
steps :
58
67
- uses : actions/checkout@v4
59
68
with :
60
69
submodules : recursive
61
-
70
+ - uses : actions/cache@v4
71
+ with :
72
+ path : |
73
+ ~/.cargo/bin/
74
+ ~/.cargo/registry/index/
75
+ ~/.cargo/registry/cache/
76
+ ~/.cargo/git/db/
77
+ target/
78
+ key : databroker-cli-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
79
+
80
+ - name : Install build prerequisites
81
+ working-directory : ${{github.workspace}}/
82
+ run : |
83
+ which cargo-license || cargo install cargo-license
84
+ which cross || cargo install cross
62
85
- name : Building
63
86
working-directory : ${{github.workspace}}/
64
87
run : |
65
- cargo install cargo-license cross
66
88
./build-all-targets-cli.sh
67
89
68
90
- name : Docker meta
71
93
with :
72
94
# list of Docker images to use as base name for tags
73
95
images : |
74
- ghcr.io/eclipse-kuksa/kuksa-databrokerdatabroker -cli
96
+ ghcr.io/eclipse-kuksa/kuksa-databroker -cli
75
97
# generate Docker tags based on the following events/attributes
76
98
tags : |
77
99
type=ref,event=branch
80
102
type=semver,pattern={{major}}.{{minor}}
81
103
type=semver,pattern={{major}}
82
104
83
- - name : Set up QEMU
84
- uses : docker/setup-qemu-action@v3
85
-
86
105
- name : Set up Docker Buildx
87
106
id : buildx
88
107
uses : docker/setup-buildx-action@v3
95
114
username : ${{ github.repository_owner }}
96
115
password : ${{ secrets.GITHUB_TOKEN }}
97
116
98
- - name : Build kuksa.val databroker CLI container and push to ghcr.io (and ttl.sh)
117
+ - name : Build kuksa- databroker-cli container and push to ghcr.io (and ttl.sh)
99
118
id : ghcr-build
100
119
if : needs.check_ghcr_push.outputs.push == 'true'
101
120
uses : docker/build-push-action@v5
@@ -109,13 +128,13 @@ jobs:
109
128
push : true
110
129
tags : |
111
130
${{ steps.meta.outputs.tags }}
112
- ttl.sh/kuksa.val /kuksa-databroker-cli-${{github.sha}}
131
+ ttl.sh/eclipse- kuksa/kuksa-databroker-cli-${{github.sha}}
113
132
labels : ${{ steps.meta.outputs.labels }}
114
133
# Provenance to solve that an unknown/unkown image is shown on ghcr.io
115
134
# Same problem as described in https://github.com/orgs/community/discussions/45969
116
135
provenance : false
117
136
118
- - name : Build ephemeral KUKSA Databroker container and push to ttl.sh
137
+ - name : Build ephemeral kuksa-databroker-cli container and push to ttl.sh
119
138
if : needs.check_ghcr_push.outputs.push == 'false'
120
139
id : tmp-build
121
140
uses : docker/build-push-action@v5
@@ -127,7 +146,7 @@ jobs:
127
146
file : ./Dockerfile-cli
128
147
context : .
129
148
push : true
130
- tags : " ttl.sh/kuksa.val /kuksa-databroker-cli-${{github.sha}}"
149
+ tags : " ttl.sh/eclipse- kuksa/kuksa-databroker-cli-${{github.sha}}"
131
150
labels : ${{ steps.meta.outputs.labels }}
132
151
# Provenance to solve that an unknown/unkown image is shown on ghcr.io
133
152
# Same problem as described in https://github.com/orgs/community/discussions/45969
@@ -137,7 +156,7 @@ jobs:
137
156
- name : Posting message
138
157
uses : ./.github/actions/post-container-location
139
158
with :
140
- image : ttl.sh/kuksa.val /kuksa-databroker-cli-${{github.sha}}
159
+ image : ttl.sh/eclipse- kuksa/kuksa-databroker-cli-${{github.sha}}
141
160
142
161
- name : " Archiving AMD64 artifacts"
143
162
uses : actions/upload-artifact@v4
@@ -154,22 +173,30 @@ jobs:
154
173
- name : " Archiving RISCV64 artifacts"
155
174
uses : actions/upload-artifact@v4
156
175
with :
157
- name : databroker-- cli-riscv64
176
+ name : databroker-cli-riscv64
158
177
path : ${{github.workspace}}/dist/riscv64
159
178
160
179
161
180
bom :
162
- name : Bill of Material Check
181
+ name : Check Bill of Material
163
182
runs-on : ubuntu-latest
164
- needs : build-container
165
183
166
184
steps :
167
185
- uses : actions/checkout@v4
186
+ - uses : actions/cache@v4
187
+ with :
188
+ path : |
189
+ ~/.cargo/bin/
190
+ ~/.cargo/registry/index/
191
+ ~/.cargo/registry/cache/
192
+ ~/.cargo/git/db/
193
+ target/
194
+ key : databroker-cli-bom-${{ hashFiles('**/Cargo.lock') }}
168
195
169
196
- name : " Createbom: License check and Dash output generation"
170
197
working-directory : ${{github.workspace}}/createbom
171
198
run : |
172
- cargo install cargo-license
199
+ which cargo-license || cargo install cargo-license
173
200
python3 createbom.py --dash ${{github.workspace}}/dash-databroker-deps ../databroker
174
201
175
202
- name : Dash license check
0 commit comments