Skip to content

Commit 4f235ef

Browse files
committed
Fixes
1 parent 9d8c9a2 commit 4f235ef

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

.github/actions/action.yml

+5-18
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,17 @@ inputs:
77
latest:
88
description: if tag latest
99
required: false
10+
latest_major:
11+
description: if tag latest major version
12+
required: false
1013
runs:
1114
using: "composite"
1215
steps:
1316
- name: Build image
1417
env:
1518
VERSION: ${{ inputs.version }}
1619
LATEST: ${{ inputs.latest }}
20+
LATEST_MAJOR: ${{ inputs.latest_major }}
1721
run: |
18-
if [[ "${GITHUB_REF}" == refs/heads/master || "${GITHUB_REF}" == refs/tags/* ]]; then
19-
minor_ver="${VERSION%.*}"
20-
major_ver="${minor_ver%.*}"
21-
22-
tags=("${minor_ver}" "${major_ver}")
23-
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
24-
stability_tag=("${GITHUB_REF##*/}")
25-
tags=("${minor_ver}-${stability_tag}" "${major_ver}-${stability_tag}")
26-
else
27-
if [[ -n "${LATEST}" ]]; then
28-
tags+=("latest")
29-
fi
30-
fi
31-
32-
for tag in "${tags[@]}"; do
33-
make buildx-imagetools-create TAG=${tag}
34-
done
35-
fi
22+
. $GITHUB_ACTION_PATH/release.sh
3623
shell: bash

.github/actions/release.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -exo pipefail
4+
5+
if [[ "${GITHUB_REF}" == refs/heads/master || "${GITHUB_REF}" == refs/tags/* ]]; then
6+
minor_ver="${VERSION%.*}"
7+
major_ver="${minor_ver%.*}"
8+
9+
tags=("${minor_ver}")
10+
11+
if [[ -n "${LATEST_MAJOR}" ]]; then
12+
tags+=("${major_ver}")
13+
fi
14+
15+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
16+
stability_tag=("${GITHUB_REF##*/}")
17+
tags=("${minor_ver}-${stability_tag}")
18+
if [[ -n "${LATEST_MAJOR}" ]]; then
19+
tags+=("${major_ver}-${stability_tag}")
20+
fi
21+
else
22+
if [[ -n "${LATEST}" ]]; then
23+
tags+=("latest")
24+
fi
25+
fi
26+
27+
for tag in "${tags[@]}"; do
28+
make buildx-imagetools-create TAG=${tag}
29+
done
30+
fi

.github/workflows/workflow.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ jobs:
5858
with:
5959
version: ${{ env.VARNISH60 }}
6060
latest: true
61+
latest_major: true

0 commit comments

Comments
 (0)