Skip to content

Commit fd1811e

Browse files
committed
Hardcode zsh tags in ohmyzsh/zsh docker image build
1 parent cc13383 commit fd1811e

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

.github/workflows/main.yml

+37
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,43 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v2
1414
- name: Build images
15+
env:
16+
zsh_tags: |
17+
master
18+
5.9
19+
5.8.1
20+
5.8
21+
5.7.1
22+
5.7
23+
5.6.2
24+
5.6.1
25+
5.6
26+
5.5.1
27+
5.5
28+
5.4.2
29+
5.4.1
30+
5.4
31+
5.3.1
32+
5.3
33+
5.2
34+
5.1.1
35+
5.1
36+
5.0.8
37+
5.0.7
38+
5.0.6
39+
5.0.5
40+
5.0.4
41+
5.0.3
42+
5.0.2
43+
5.0.1
44+
5.0.0
45+
4.3.17
46+
4.3.16
47+
4.3.15
48+
4.3.14
49+
4.3.13
50+
4.3.12
51+
4.3.11
1552
run: |
1653
for image in */Dockerfile; do
1754
image="$(basename $(dirname $image))"

zsh/build.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ USERNAME="$1"
88
# Get image from directory name
99
IMAGE="$(basename "$(pwd)")"
1010

11-
# List of published zshusers/zsh Docker images
12-
versions="$(wget -qO- https://registry.hub.docker.com/v1/repositories/zshusers/zsh/tags | sed 's/[^0-9.]*"name": "\([^"]*\)"[^0-9.]*/\n\1\n/g;s/^\n//')"
11+
# $zsh_tags is an environment variable passed via secrets
1312

1413
# Build images
15-
for version in $versions; do
14+
for version in $zsh_tags; do
1615
docker buildx build -t "$USERNAME/$IMAGE:$version" --build-arg ZSH_VERSION="$version" .
1716
done
1817

1918
# Tag latest image
20-
latest=$(tr ' ' '\n' <<< "$versions" | sed '/^$/d' | sort -V | tail -2 | head -1)
19+
latest=$(tr ' ' '\n' <<< "$zsh_tags" | sed '/^$/d' | sort -V | tail -2 | head -1)
2120
docker tag "$USERNAME/$IMAGE:$latest" "$USERNAME/$IMAGE:latest"

0 commit comments

Comments
 (0)