mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 02:29:01 +00:00
CI: build: fix matching for openwrt release branch for toolchain parsing
The current match logic doesn't handle test for push events related to stable release (example openwrt-22.03) but only fork with the related prefix (example openwrt-22.03-fixup) Fix wrong matching and while at it also add extra checks to other matching (check if the branch name actually start with the requested prefix) Fixes:e24a1e6f6d
("CI: build: add support for external toolchains from stable branch") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commite3cf2b84e5
)
This commit is contained in:
parent
63a2ea5470
commit
ec9ca325c0
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@ -151,16 +151,18 @@ jobs:
|
||||
TOOLCHAIN_PATH=snapshots
|
||||
|
||||
if [ -n "${{ github.base_ref }}" ]; then
|
||||
if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
|
||||
major_ver="$(echo ${{ github.base_ref }} | sed 's/openwrt-/v/')"
|
||||
if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')"
|
||||
fi
|
||||
elif [ "${{ github.ref_type }}" = "branch" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')"
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')"
|
||||
elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')"
|
||||
fi
|
||||
elif [ "${{ github.ref_type }}" = "tag" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
major_ver="$(sed 's/\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user