.github: generate package versions from input values

We do not need to specify each version from each workflow yaml file.
Make *-apply.patch scripts instead generate `$VERSION_SHORT` from the
input version value.
This commit is contained in:
Dongsu Park 2020-05-13 12:05:23 +02:00 committed by Kai Lüke
parent 596136827b
commit ee727b639f
8 changed files with 9 additions and 9 deletions

View File

@ -2,13 +2,16 @@
set -euo pipefail
# trim the 3rd part in the input semver, e.g. from 1.14.3 to 1.14
VERSION_SHORT=${VERSION_NEW%.*}
. .github/workflows/common.sh
checkout_branches "go-${VERSION_NEW}"
pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit
VERSION_OLD=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1)
VERSION_OLD=$(sed -n "s/^DIST go\(${VERSION_SHORT}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1)
[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && exit
git mv $(ls -1 dev-lang/go/go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "dev-lang/go/go-${VERSION_NEW}.ebuild"

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-alpha
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }}
GO_VERSION: 1.13
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
run: .github/workflows/go-apply-patch.sh

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-edge
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }}
GO_VERSION: 1.13
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}
run: .github/workflows/go-apply-patch.sh

View File

@ -2,15 +2,18 @@
set -euo pipefail
# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4
VERSION_SHORT=${VERSION_NEW%.*}
. .github/workflows/common.sh
checkout_branches "linux-${VERSION_NEW}"
pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit
VERSION_OLD=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest)
VERSION_OLD=$(sed -n "s/^DIST patch-\(${VERSION_SHORT}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest)
if [[ -z "${VERSION_OLD}" ]]; then
VERSION_OLD=$(sed -n "s/^DIST linux-\(${KERNEL_VERSION}*\).*/\1/p" sys-kernel/coreos-sources/Manifest)
VERSION_OLD=$(sed -n "s/^DIST linux-\(${VERSION_SHORT}*\).*/\1/p" sys-kernel/coreos-sources/Manifest)
fi
[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && exit

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-alpha
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }}
KERNEL_VERSION: 5.4
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
run: .github/workflows/kernel-apply-patch.sh

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-beta
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }}
KERNEL_VERSION: 4.19
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_BETA }}
run: .github/workflows/kernel-apply-patch.sh

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-edge
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }}
KERNEL_VERSION: 5.6
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}
run: .github/workflows/kernel-apply-patch.sh

View File

@ -27,7 +27,6 @@ jobs:
id: apply-patch-stable
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }}
KERNEL_VERSION: 4.19
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }}
run: .github/workflows/kernel-apply-patch.sh