@@ -33,24 +33,22 @@ jobs:
33
33
with :
34
34
images : cogstacksystems/jupyter-hub
35
35
tags : |
36
-
37
- # vX.Y.Z -> X.Y.Z and X.Y (strip "v")
38
- type=semver,pattern={{version}},prefix=v
39
- type=semver,pattern={{major}}.{{minor}},prefix=v
40
- # latest on main AND on v-tags
41
- type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
42
- # branches (non-PR)
43
- type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
44
- # short sha
45
- type=sha,format=short
36
+ # vX.Y.Z -> X.Y.Z and X.Y (strip leading "v")
37
+ type=semver,pattern={{version}},prefix=v
38
+ type=semver,pattern={{major}}.{{minor}},prefix=v
39
+ # latest on main and on v-tags
40
+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
41
+ # branch tag for non-PR branches
42
+ type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
43
+ # short sha
44
+ type=sha,format=short
46
45
47
46
- name : Docker meta (singleuser)
48
47
id : meta_su
49
48
uses : docker/metadata-action@v5
50
49
with :
51
50
images : cogstacksystems/jupyter-singleuser
52
51
tags : |
53
-
54
52
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
55
53
type=semver,pattern={{version}},prefix=v
56
54
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -120,7 +118,6 @@ jobs:
120
118
with :
121
119
images : cogstacksystems/jupyter-hub
122
120
tags : |
123
-
124
121
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
125
122
type=semver,pattern={{version}},prefix=v
126
123
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -137,7 +134,6 @@ jobs:
137
134
with :
138
135
images : cogstacksystems/jupyter-singleuser
139
136
tags : |
140
-
141
137
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
142
138
type=semver,pattern={{version}},prefix=v
143
139
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -147,6 +143,7 @@ jobs:
147
143
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
148
144
# short sha
149
145
type=sha,format=short
146
+
150
147
151
148
- uses : docker/login-action@v3
152
149
with :
@@ -203,7 +200,6 @@ jobs:
203
200
with :
204
201
images : cogstacksystems/jupyter-singleuser-gpu
205
202
tags : |
206
-
207
203
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
208
204
type=semver,pattern={{version}},prefix=v
209
205
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -252,7 +248,6 @@ jobs:
252
248
with :
253
249
images : cogstacksystems/jupyter-hub
254
250
tags : |
255
-
256
251
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
257
252
type=semver,pattern={{version}},prefix=v
258
253
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -269,7 +264,6 @@ jobs:
269
264
with :
270
265
images : cogstacksystems/jupyter-singleuser
271
266
tags : |
272
-
273
267
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
274
268
type=semver,pattern={{version}},prefix=v
275
269
type=semver,pattern={{major}}.{{minor}},prefix=v
@@ -287,21 +281,22 @@ jobs:
287
281
ARM64 : ${{ needs.build-arm64.outputs.hub_digest }}
288
282
run : |
289
283
set -euo pipefail
284
+
290
285
# must have both digests
291
286
if [ -z "${AMD64:-}" ] || [ -z "${ARM64:-}" ]; then
292
287
echo "Missing hub digests (amd64='${AMD64:-}', arm64='${ARM64:-}')."
293
288
exit 1
294
289
fi
295
290
296
- # stitch each tag from the hub meta
297
291
while IFS= read -r ref; do
298
292
[[ -z "$ref" ]] && continue
299
- img="${ref%%:*}"; tag="${ref#*:}"
293
+ img="${ref%%:*}"
294
+ tag="${ref#*:}"
300
295
301
- # optional: refuse v-prefixed tags (defensive )
296
+ # normalize: if tag starts with 'v', strip it (v2.0.9 -> 2.0.9 )
302
297
if [[ "$tag" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
303
- echo "Refusing to publish v-prefixed tag: $img:$tag"
304
- exit 1
298
+ echo "normalize: $img:$tag -> $img:${ tag#v} "
299
+ tag="${tag#v}"
305
300
fi
306
301
307
302
echo "⛵ ${img}:${tag}"
@@ -318,18 +313,25 @@ jobs:
318
313
ARM64 : ${{ needs.build-arm64.outputs.su_digest }}
319
314
run : |
320
315
set -euo pipefail
316
+
321
317
# must have both digests
322
318
if [ -z "${AMD64:-}" ] || [ -z "${ARM64:-}" ]; then
323
- echo "Missing singleuser digests (amd64='${AMD64:-}', arm64='${ARM64:-}')."; exit 1
319
+ echo "Missing singleuser digests (amd64='${AMD64:-}', arm64='${ARM64:-}')."
320
+ exit 1
324
321
fi
325
- # stitch each tag
322
+
323
+ # stitch each tag from the singleuser meta
326
324
while IFS= read -r ref; do
327
325
[[ -z "$ref" ]] && continue
328
- img="${ref%%:*}"; tag="${ref#*:}"
329
- # optional: assert we aren't accidentally using a v-prefixed tag
326
+ img="${ref%%:*}"
327
+ tag="${ref#*:}"
328
+
329
+ # normalize: if tag starts with 'v', strip it (v2.0.9 -> 2.0.9)
330
330
if [[ "$tag" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
331
- echo "Refuses to publish v-prefixed tag: $img:$tag"; exit 1
331
+ echo "normalize: $img:$tag -> $img:${tag#v}"
332
+ tag="${tag#v}"
332
333
fi
334
+
333
335
echo "⛵ ${img}:${tag}"
334
336
docker buildx imagetools create \
335
337
--tag "${img}:${tag}" \
0 commit comments