From 2d97c3f46f25a9411b156a3b4d6465484feaaff1 Mon Sep 17 00:00:00 2001 From: Jai Luthra Date: Fri, 24 Nov 2023 03:03:52 +0530 Subject: [PATCH] temp --- .github/workflows/gen_linux_patches.yml | 71 +++++++++++++++++++------ 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/.github/workflows/gen_linux_patches.yml b/.github/workflows/gen_linux_patches.yml index ccac673..354e548 100644 --- a/.github/workflows/gen_linux_patches.yml +++ b/.github/workflows/gen_linux_patches.yml @@ -79,38 +79,75 @@ jobs: echo "find_bytecode.sh executed successfully" - - name: Update Patch + - name: Update NVENC run: | echo "Running update_patch.sh for version ${{ env.VERSION }}" - cd "${{ github.workspace }}/tools/autopatch" - ./update_patch.sh -f ../../patch.sh -b $(./find_bytecode.sh ${{ env.VERSION }} ${{ env.DRIVER_URL }}) -o ${{ env.VERSION }} + + old_version="${{ inputs.old_version }}" + + case "${{ inputs.mode }}" in + search) + if [[ -z $old_version ]]; then + ./update_patch.sh -f ../../patch.sh -b $(./find_bytecode.sh ${{ env.VERSION }} ${{ env.DRIVER_URL }}) + else + ./update_patch.sh -f ../../patch.sh -b $(./find_bytecode.sh ${{ env.VERSION }} ${{ env.DRIVER_URL }}) -o $old_version + fi + ;; + copy) + if [[ -z $old_version ]]; then + ./update_patch.sh -f ../../patch.sh -v ${{ env.VERSION }} + else + ./update_patch.sh -f ../../patch.sh -v ${{ env.VERSION }} -o $old_version + fi + ;; + *) + echo "ERROR: Wrong mode" + ;; + esac echo "update_patch.sh executed successfully" - #- name: Run add_driver.py - #run: | - #echo "Running add_driver.py with variant ${{ env.VARIANT }} and version ${{ env.VERSION }}" - #cd "${{ github.workspace }}/tools/readme-autogen" - #python add_driver.py -W -P GeForce --variant "${{ env.VARIANT }}" -w win10 ${{ env.VERSION }} - #echo "add_driver.py executed successfully" + - name: Update NVFBC + run: | - #- name: Run readme_autogen.py - #run: | - #echo "Running readme_autogen.py" - #cd "${{ github.workspace }}/tools/readme-autogen" - #python readme_autogen.py - #echo "readme_autogen.py executed successfully" + echo "Running update_patch.sh for FBC for version ${{ env.VERSION }}" + cd "${{ github.workspace }}/tools/autopatch" + + old_version="${{ inputs.old_version }}" + + if [[ -z $old_version ]]; then + ./update_patch.sh -f ../../patch-fbc.sh -v ${{ env.VERSION }} + else + ./update_patch.sh -f ../../patch-fbc.sh -v ${{ env.VERSION }} -o $old_version + fi + + echo "update_patch.sh for FBC executed successfully" + + - name: Run add_driver.py + run: | + echo "Running add_driver.py with version ${{ env.VERSION }}" + cd "${{ github.workspace }}/tools/readme-autogen" + python add_driver.py -L -U ${{ env.DRIVER_URL }} ${{ env.VERSION }} + echo "add_driver.py executed successfully" + + - name: Run readme_autogen.py + run: | + echo "Running readme_autogen.py" + cd "${{ github.workspace }}/tools/readme-autogen" + python readme_autogen.py + echo "readme_autogen.py executed successfully" - name: Commit and push changes run: | echo "Committing and pushing changes" + branch=autopatch_${{ env.VERSION }} cd "${{ github.workspace }}" git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git checkout -b ${{ env.VERSION }} + git checkout -b $branch git add -A git diff --quiet --exit-code --cached || git commit -m "linux: add support for driver ${{ env.VERSION }}" -m "${{ inputs.description }}" - git push origin ${{env.VERSION }} + git push origin $branch echo "Committed and pushed changes"