From 89507374e73d57638513e44426a5ffcb0783d64c Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 22 May 2021 00:47:10 +0200 Subject: [PATCH] ci: Actually check for version numbers --- .github/workflows/build.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40608f2caa..c75645292d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,9 +63,10 @@ jobs: echo "::set-output name=commit::$(git rev-parse --short=8 HEAD)" # Version - echo "::set-output name=version_major::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/')" - echo "::set-output name=version_minor::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/')" - echo "::set-output name=version_patch::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/')" + VERSION=$(cat RELEASE) + echo "::set-output name=version_major::$(echo ${VERSION} | sed -E 's/([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)/\1/')" + echo "::set-output name=version_minor::$(echo ${VERSION} | sed -E 's/([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)/\2/')" + echo "::set-output name=version_patch::$(echo ${VERSION} | sed -E 's/([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)/\3/')" - name: "Dependency: Packages" shell: bash run: | @@ -100,16 +101,16 @@ jobs: sudo make PREFIX=/usr/${{ steps.data.outputs.cross_prefix }} install popd > /dev/null - if [[ ${{ steps.data.outputs.version_major >= 4 }} ]]; then + if (( "${{ steps.data.outputs.version_major }}" >= 4 )); then echo "::set-output name=flags::--enable-ffnvcodec --enable-nvdec --enable-nvenc" - elif [[ ${{ steps.data.outputs.version_major >= 3 }} ]]; then - if [[ ${{ steps.data.outputs.version_minor >= 2 }} ]]; then + elif (( "${{ steps.data.outputs.version_major }}" >= 3 )); then + if (( "${{ steps.data.outputs.version_minor }}" >= 2 )); then # 3.2+ has cuda, cuvid, nvenc echo "::set-output name=flags::--enable-cuda --enable-cuvid --enable-nvenc" - elif [[ ${{ steps.data.outputs.version_minor >= 1 }} ]]; then + elif (( "${{ steps.data.outputs.version_minor }}" >= 1 )); then # 3.1 has cuda, nvenc echo "::set-output name=flags::--enable-cuda --enable-nvenc" - elif [[ ${{ steps.data.outputs.version_minor >= 0 }} ]]; then + elif (( "${{ steps.data.outputs.version_minor }}" >= 0 )); then # 3.0 has nvenc echo "::set-output name=flags::--enable-nvenc" fi