diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2487d25..fb61c9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,43 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Build images + env: + zsh_tags: | + master + 5.9 + 5.8.1 + 5.8 + 5.7.1 + 5.7 + 5.6.2 + 5.6.1 + 5.6 + 5.5.1 + 5.5 + 5.4.2 + 5.4.1 + 5.4 + 5.3.1 + 5.3 + 5.2 + 5.1.1 + 5.1 + 5.0.8 + 5.0.7 + 5.0.6 + 5.0.5 + 5.0.4 + 5.0.3 + 5.0.2 + 5.0.1 + 5.0.0 + 4.3.17 + 4.3.16 + 4.3.15 + 4.3.14 + 4.3.13 + 4.3.12 + 4.3.11 run: | for image in */Dockerfile; do image="$(basename $(dirname $image))" diff --git a/zsh/build.sh b/zsh/build.sh index 7dd2ffd..2bfd712 100755 --- a/zsh/build.sh +++ b/zsh/build.sh @@ -8,14 +8,13 @@ USERNAME="$1" # Get image from directory name IMAGE="$(basename "$(pwd)")" -# List of published zshusers/zsh Docker images -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//')" +# $zsh_tags is an environment variable passed via secrets # Build images -for version in $versions; do +for version in $zsh_tags; do docker buildx build -t "$USERNAME/$IMAGE:$version" --build-arg ZSH_VERSION="$version" . done # Tag latest image -latest=$(tr ' ' '\n' <<< "$versions" | sed '/^$/d' | sort -V | tail -2 | head -1) +latest=$(tr ' ' '\n' <<< "$zsh_tags" | sed '/^$/d' | sort -V | tail -2 | head -1) docker tag "$USERNAME/$IMAGE:$latest" "$USERNAME/$IMAGE:latest"