From 0066ee57e0f53252ac015f4efffc2a96871d52ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Fri, 24 Jul 2020 11:48:52 +0200 Subject: [PATCH] .github: Setup kernel updates for maintenance branches --- .../workflows/kernel-releases-alpha.yml | 48 +++++++++++++++++++ .../workflows/kernel-releases-beta.yml | 48 +++++++++++++++++++ .../workflows/kernel-releases-main.yml | 2 +- .../workflows/kernel-releases-stable.yml | 48 +++++++++++++++++++ 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml new file mode 100644 index 0000000000..afffda7026 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Alpha maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: alpha + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml new file mode 100644 index 0000000000..562e9ec065 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Beta maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: beta + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml index 11df18d52f..351cea0261 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml @@ -26,7 +26,7 @@ jobs: - name: Apply patch for main id: apply-patch-main env: - TARGET: main + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml new file mode 100644 index 0000000000..bfba811911 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Stable maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: stable + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }}