ci: Actually check for version numbers

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2021-05-22 00:47:10 +02:00
parent 547173be40
commit 89507374e7
+9 -8
View File
@@ -63,9 +63,10 @@ jobs:
echo "::set-output name=commit::$(git rev-parse --short=8 HEAD)" echo "::set-output name=commit::$(git rev-parse --short=8 HEAD)"
# Version # Version
echo "::set-output name=version_major::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/')" VERSION=$(cat RELEASE)
echo "::set-output name=version_minor::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/')" 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_patch::$(cat RELEASE | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/')" 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" - name: "Dependency: Packages"
shell: bash shell: bash
run: | run: |
@@ -100,16 +101,16 @@ jobs:
sudo make PREFIX=/usr/${{ steps.data.outputs.cross_prefix }} install sudo make PREFIX=/usr/${{ steps.data.outputs.cross_prefix }} install
popd > /dev/null 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" echo "::set-output name=flags::--enable-ffnvcodec --enable-nvdec --enable-nvenc"
elif [[ ${{ steps.data.outputs.version_major >= 3 }} ]]; then elif (( "${{ steps.data.outputs.version_major }}" >= 3 )); then
if [[ ${{ steps.data.outputs.version_minor >= 2 }} ]]; then if (( "${{ steps.data.outputs.version_minor }}" >= 2 )); then
# 3.2+ has cuda, cuvid, nvenc # 3.2+ has cuda, cuvid, nvenc
echo "::set-output name=flags::--enable-cuda --enable-cuvid --enable-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 # 3.1 has cuda, nvenc
echo "::set-output name=flags::--enable-cuda --enable-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 # 3.0 has nvenc
echo "::set-output name=flags::--enable-nvenc" echo "::set-output name=flags::--enable-nvenc"
fi fi