1
1
name : build
2
2
3
3
on :
4
- pull_request :
5
- branches :
6
- - main
7
-
8
4
workflow_call :
9
5
10
6
env :
11
7
CARGO_TERM_COLOR : always
12
8
RUST_BACKTRACE : 1
13
9
CARGO_INCREMENTAL : 0
14
10
RUSTFLAGS : -D warnings
15
- IMAGE : ghcr.io/grampelberg/kuberift
16
-
17
- concurrency :
18
- group : |-
19
- build-${{ github.event.pull_request.number || github.ref }}
20
- cancel-in-progress : true
21
11
22
12
jobs :
23
13
binary :
@@ -67,26 +57,30 @@ jobs:
67
57
path : kuberift*
68
58
retention-days : 1
69
59
70
- docker :
71
- runs-on : ${{ matrix.runner }}
72
-
60
+ # The state of include/exclude in matrices is tough because we want to add the
61
+ # runner to the matrix based on arch. Calling a sub-workflow allows for
62
+ # code-reuse without having to deal with that added complexity.
63
+ docker-linux-amd64 :
64
+ uses : ./.github/workflows/docker.yml
73
65
permissions :
74
66
packages : write
67
+ with :
68
+ os : linux
69
+ arch : amd64
70
+ runner : ubuntu-latest
71
+
72
+ docker-linux-arm64 :
73
+ if : ${{ github.event_name != 'pull_request' }}
74
+ uses : ./.github/workflows/docker.yml
75
+ permissions :
76
+ packages : write
77
+ with :
78
+ os : linux
79
+ arch : arm64
80
+ runner : buildjet-4vcpu-ubuntu-2204-arm
75
81
76
- strategy :
77
- matrix :
78
- os : [linux]
79
- arch :
80
- - amd64
81
- # The emulated arm64 builds are painfully slow (90m last time). Skip them until we have dedicated linux-arm64 hardware.
82
- - arm64
83
-
84
- include :
85
- - arch : amd64
86
- runner : ubuntu-latest
87
-
88
- - arch : arm64
89
- runner : buildjet-4vcpu-ubuntu-2204-arm
82
+ helm :
83
+ runs-on : ubuntu-latest
90
84
91
85
steps :
92
86
- uses : actions/checkout@v4
@@ -95,56 +89,21 @@ jobs:
95
89
96
90
- uses : taiki-e/install-action@v2
97
91
with :
98
- tool : just,git-cliff
99
- - name : set version
100
- run : just set-version
101
-
102
- - name : meta
103
- id : meta
104
- uses : docker/metadata-action@v5
105
- with :
106
- images : |
107
- ${{ env.IMAGE }}
108
- tags : |
109
- type=ref,event=tag
110
- type=raw,value=unstable,enable={{is_default_branch}}
111
- type=sha
112
-
113
- - name : buildx
114
- uses : docker/setup-buildx-action@v3
115
-
116
- - name : login
117
- uses : docker/login-action@v3
92
+ tool : git-cliff
93
+ - uses : jdx/mise-action@v2
118
94
with :
119
- registry : ghcr.io
120
- username : ${{ github.actor }}
121
- password : ${{ secrets.GITHUB_TOKEN }}
95
+ experimental : true
96
+ mise_toml : |
97
+ [tools]
98
+ helm = "latest"
99
+ just = "latest"
122
100
123
- - name : Build and push
124
- id : build
125
- uses : docker/build-push-action@v6
126
- with :
127
- context : .
128
- platforms : ${{ matrix.os }}/${{ matrix.arch }}
129
- cache-from : type=registry,ref=${{ env.IMAGE }}-cache
130
- cache-to : type=registry,ref=${{ env.IMAGE }}-cache,mode=max
131
- file : docker/kuberift.dockerfile
132
- labels : ${{ steps.meta.outputs.labels }}
133
- annotations : ${{ steps.meta.outputs.annotations }}
134
- push : ${{ github.event_name != 'pull_request' }}
135
- outputs : |-
136
- type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true
137
-
138
- - name : create digest
101
+ - name : helm
139
102
run : |
140
- mkdir -p /tmp/digests
141
- digest="${{ steps.build.outputs.digest }}"
142
- touch "/tmp/digests/${digest#sha256:}"
103
+ just set-version helm-build
143
104
144
- - name : upload digest
145
- uses : actions/upload-artifact@v4
105
+ - uses : actions/upload-artifact@v4
146
106
with :
147
- name : digests-${{ matrix.os }}-${{ matrix.arch }}
148
- path : /tmp/digests/*
149
- if-no-files-found : error
107
+ name : helm
108
+ path : /tmp/chart/*
150
109
retention-days : 1
0 commit comments