Skip to content

Commit 62fbba8

Browse files
committed
Update check_new_release.yml
1 parent a931b86 commit 62fbba8

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

.github/workflows/check_new_release.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,26 @@ jobs:
3737

3838
steps:
3939
- name: Get latest esnet/iperf tag
40-
run: |
41-
cat > "upstream_iperf3_tag.sh" <<- UPSTREAM_IPERF3_TAG
42-
declare -A upstream_iperf3_tag
43-
upstream_iperf3_tag[iperf3]="$(git ls-remote -q -t --refs "https://github.com/esnet/iperf.git" | awk '{sub("refs/tags/", "");sub("(.*)(-|rc|iperf|trunk|3.1b1|3.1b2|3.1b3)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)"
44-
UPSTREAM_IPERF3_TAG
40+
run: echo "upstream_iperf3_tag=$(git ls-remote -q -t --refs "https://github.com/esnet/iperf.git" | awk '{sub("refs/tags/", "");sub("(.*)(-|rc|iperf|trunk|3.1b1|3.1b2|3.1b3)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)" >> $GITHUB_ENV
4541

4642
- name: Get latest userdocs/iperf3-static tag
47-
run: |
48-
cat > "local_iperf3_tag.sh" <<- LOCAL_IPERF3_TAG
49-
declare -A local_iperf3_tag
50-
local_iperf3_tag[iperf3]="$(git ls-remote -q -t --refs "https://github.com/userdocs/iperf3-static.git" | awk '{sub("refs/tags/", "");sub("(.*)(-|rc|iperf|trunk|3.1b1|3.1b2|3.1b3)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)"
51-
LOCAL_IPERF3_TAG
43+
run: echo "local_iperf3_tag=$(git ls-remote -q -t --refs "https://github.com/userdocs/iperf3-static.git" | awk '{sub("refs/tags/", "");sub("(.*)(-|rc|iperf|trunk|3.1b1|3.1b2|3.1b3)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)" >> $GITHUB_ENV
5244

5345
- name: Test values - latest upstream vs local tags
5446
id: continue_build
5547
run: |
56-
source upstream_iperf3_tag.sh
57-
source local_iperf3_tag.sh
58-
5948
ver() {
6049
local test_array
6150
read -ra test_array < <(printf "%s" "${@//./ }")
6251
printf "%d%03d%03d%03d" "${test_array[@]}"
6352
}
6453
65-
for iray in "${!upstream_iperf3_tag[@]}"; do
66-
if [[ "$(ver "${upstream_iperf3_tag[$iray]}")" -gt "$(ver "${local_iperf3_tag[$iray]}")" ]]; then
67-
printf "%-14s latest:%-10s iperf3-static:%-10s %s\n" "$iray" "${upstream_iperf3_tag[$iray]}" "${local_iperf3_tag[$iray]}" "< New version available - workflow will be triggered"
68-
echo "continue_build=yes" >> $GITHUB_ENV
69-
else
70-
printf "%-14s latest:%-10s iperf3-static:%-10s\n" "$iray" "${upstream_iperf3_tag[$iray]}" "${local_iperf3_tag[$iray]}"
71-
fi
72-
done
54+
if [[ "$(ver "${{ env.upstream_iperf3_tag }}")" -gt "$(ver "${{ env.local_iperf3_tag }}")" ]]; then
55+
printf "%-14s latest:%-10s iperf3-static:%-10s %s\n" "$iray" "${{ env.upstream_iperf3_tag }}" "${{ env.local_iperf3_tag }}" "< New version available - workflow will be triggered"
56+
echo "continue_build=yes" >> $GITHUB_ENV
57+
else
58+
printf "%-14s latest:%-10s iperf3-static:%-10s\n" "$iray" "${{ env.upstream_iperf3_tag }}" "${{ env.local_iperf3_tag }}"
59+
fi
7360
7461
echo "continue_build=${{ env.continue_build }}" >> $GITHUB_OUTPUT
7562

0 commit comments

Comments
 (0)