2023-07-18 21:42:07 +00:00
|
|
|
name: Generate Windows patches
|
|
|
|
|
|
|
|
on:
|
2023-11-09 07:55:36 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'Driver Version'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
variant:
|
|
|
|
description: 'Driver Variant'
|
|
|
|
required: false
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- DCH
|
|
|
|
- Studio Driver
|
|
|
|
- DCH (Hotfix)
|
2023-11-09 08:30:55 +00:00
|
|
|
description:
|
|
|
|
description: 'Commit description'
|
|
|
|
required: false
|
|
|
|
type: string
|
2023-07-18 21:42:07 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
2023-11-23 20:15:49 +00:00
|
|
|
- name: Check variant
|
2023-11-09 07:55:36 +00:00
|
|
|
id: check_input
|
2023-07-18 21:42:07 +00:00
|
|
|
run: |
|
2023-11-09 07:55:36 +00:00
|
|
|
variant="${{ inputs.variant }}"
|
|
|
|
version="${{ inputs.version }}"
|
|
|
|
echo "Operating System: $os"
|
|
|
|
echo "Variant: $variant"
|
|
|
|
echo "Version: $version"
|
|
|
|
|
|
|
|
if [[ $version =~ ([0-9]+\.[0-9]+(-[a-zA-Z]+)?)(-.+)? ]]; then
|
2023-07-18 21:42:07 +00:00
|
|
|
echo "VARIANT=$variant" >> $GITHUB_ENV
|
|
|
|
echo "VERSION=$version" >> $GITHUB_ENV
|
2023-11-09 07:55:36 +00:00
|
|
|
|
2023-07-18 21:42:07 +00:00
|
|
|
else
|
2023-11-09 07:55:36 +00:00
|
|
|
echo "Invalid driver version."
|
2023-07-18 21:42:07 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
- name: Delete Existing Files
|
|
|
|
run: |
|
|
|
|
echo "Deleting existing files if they exist"
|
2023-10-12 11:03:21 +00:00
|
|
|
dir=${{ env.VERSION }}
|
|
|
|
|
|
|
|
if [ "${{ env.VARIANT }}" == "Studio Driver" ]; then
|
|
|
|
dir=nsd_${{ env.VERSION }}
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f "${{ github.workspace }}/win/win10_x64/$dir/nvencodeapi64.1337"
|
|
|
|
rm -f "${{ github.workspace }}/win/win10_x64/$dir/nvencodeapi.1337"
|
2023-07-18 21:42:07 +00:00
|
|
|
echo "Existing files deleted successfully"
|
|
|
|
|
|
|
|
- name: Run autopatch.py
|
|
|
|
run: |
|
2023-10-12 11:03:21 +00:00
|
|
|
echo "Running autopatch.py with version ${{ env.VERSION }} and variant ${{ env.VARIANT }}"
|
2023-07-18 21:42:07 +00:00
|
|
|
cd "${{ github.workspace }}/win/tools/autopatch"
|
2023-10-12 11:03:21 +00:00
|
|
|
|
|
|
|
if [ "${{ env.VARIANT }}" == "DCH" ]; then
|
|
|
|
python autopatch.py ${{ env.VERSION }}
|
|
|
|
elif [ "${{ env.VARIANT }}" == "Studio Driver" ]; then
|
|
|
|
python autopatch.py https://international.download.nvidia.com/Windows/${{ env.VERSION }}/${{ env.VERSION }}-desktop-win10-win11-64bit-international-nsd-dch-whql.exe
|
2023-11-09 07:55:36 +00:00
|
|
|
elif [ "${{ env.VARIANT }}" == "DCH (Hotfix)" ]; then
|
|
|
|
python autopatch.py https://international.download.nvidia.com/Windows/${{ env.VERSION }}hf/${{ env.VERSION }}-desktop-notebook-win10-win11-64bit-international-dch.hf.exe
|
2023-10-12 11:03:21 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-18 21:42:07 +00:00
|
|
|
echo "autopatch.py 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"
|
2023-10-12 11:03:21 +00:00
|
|
|
python add_driver.py -W -P GeForce --variant "${{ env.VARIANT }}" -w win10 ${{ env.VERSION }}
|
2023-07-18 21:42:07 +00:00
|
|
|
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"
|
|
|
|
cd "${{ github.workspace }}"
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
2023-11-23 20:15:49 +00:00
|
|
|
git checkout -b ${{ env.VERSION }}
|
2023-07-18 21:42:07 +00:00
|
|
|
git add -A
|
2023-11-23 20:15:49 +00:00
|
|
|
git diff --quiet --exit-code --cached || git commit -m "win: add support for ${{ env.VARIANT }} driver ${{ env.VERSION }}" -m "${{ inputs.description }}"
|
|
|
|
git push origin ${{ env.VERSION }}
|
2023-07-18 21:42:07 +00:00
|
|
|
echo "Committed and pushed changes"
|