mirror of https://github.com/marcosfad/mbp-ubuntu
Add scheduler workflow
This commit is contained in:
parent
d2d1c37fff
commit
c5f4291ff3
|
@ -10,8 +10,14 @@ on:
|
|||
type: string
|
||||
default: ''
|
||||
description: (optional) Choose kernel version to use from T2Linux. Without the "v".
|
||||
workflow_call:
|
||||
inputs:
|
||||
KERNEL_VERSION:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
KERNEL_VERSION: ${{ github.event.inputs.KERNEL_VERSION }}
|
||||
KERNEL_VERSION: ${{ github.event.inputs.KERNEL_VERSION || inputs.KERNEL_VERSION }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -26,7 +32,7 @@ jobs:
|
|||
run: |
|
||||
if [ -z "${KERNEL_VERSION}" ]; then
|
||||
echo "KERNEL_VERSION not set, calculating it"
|
||||
KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
|
||||
KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
|
||||
fi
|
||||
echo "::set-output name=build::${KERNEL_VERSION}"
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
name: CI
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
jobs:
|
||||
check-update:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
update_available: ${{ steps.variables.outputs.update_available }}
|
||||
latest_kernel: ${{ steps.variables.outputs.update_available }}
|
||||
steps:
|
||||
- name: Configure variables
|
||||
id: variables
|
||||
run: |
|
||||
LATEST_KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
|
||||
curl -Ls https://github.com/marcosfad/mbp-ubuntu/releases | grep zip | grep download | grep "${KERNEL_VERSION}" | cut -d'/' -f6 && REQUIRE_BUILD="false" || REQUIRE_BUILD="true"
|
||||
echo "::set-output name=update_available::${REQUIRE_BUILD}"
|
||||
echo "::set-output name=latest_kernel::${LATEST_KERNEL_VERSION}"
|
||||
trigger-build:
|
||||
needs: ['check-update']
|
||||
uses: ./.github/workflows/CI.yml
|
||||
if: ${{ needs.check-update.outputs.update_available == true }}
|
||||
with:
|
||||
KERNEL_VERSION: ${{ needs.check-update.outputs.latest_kernel }}
|
Loading…
Reference in New Issue