| name: "Setup on Windows" | |
| description: "Installs dependencies specific to Windows" | |
| inputs: | |
| codec-aom: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| codec-avm: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| codec-dav1d: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| codec-rav1e: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| codec-svt: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| extra-cache-key: | |
| description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow." | |
| default: "" | |
| libjpeg-turbo: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| libxml2: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| libyuv: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| zlibpng: | |
| description: "Can take the values: OFF, LOCAL, SYSTEM" | |
| default: "OFF" | |
| outputs: | |
| ext-cache-hit: | |
| value: ${{ steps.cache.outputs.ext-cache-hit }} | |
| vcpkg-cmake-config: | |
| # Disable vcpkg applocal deployment to prevent race conditions during parallel Ninja builds. | |
| # Dependent DLLs are added to PATH instead. | |
| value: ${{ steps.vcpkg.outputs.vcpkg-cmake-config != '' && format('{0} -DVCPKG_APPLOCAL_DEPS=OFF', steps.vcpkg.outputs.vcpkg-cmake-config) || '' }} | |
| runs: | |
| using: "composite" | |
| steps: | |
| - name: Setup Developer Command Prompt for Microsoft Visual C++ | |
| uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 | |
| - name: Set up meson | |
| if: ${{ inputs.codec-dav1d == 'LOCAL' }} | |
| run: pip install meson | |
| shell: bash | |
| - name: Install libaom library | |
| if: ${{ inputs.codec-aom == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=aom" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install libdav1d library | |
| if: ${{ inputs.codec-dav1d == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} dav1d" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install SVT-AV1 library | |
| if: ${{ inputs.codec-svt == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} svt-av1" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install libjpeg-turbo library | |
| if: ${{ inputs.libjpeg-turbo == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} libjpeg-turbo" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install libxml2 library | |
| if: ${{ inputs.libxml2 == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} libxml2" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install libyuv library | |
| if: ${{ inputs.libyuv == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} libyuv" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install zlibpng library | |
| if: ${{ inputs.zlibpng == 'SYSTEM' }} | |
| run: echo "AVIF_WIN_LIBRARIES=${AVIF_WIN_LIBRARIES} libpng zlib" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Install libraries | |
| uses: johnwason/vcpkg-action@04c68c847bf5196ecaa72331ecf51208583916ef # v8.0.0 | |
| if: env.AVIF_WIN_LIBRARIES != '' | |
| id: vcpkg | |
| with: | |
| pkgs: ${{ env.AVIF_WIN_LIBRARIES }} | |
| triplet: x64-windows-release | |
| token: ${{ github.token }} | |
| cache-key: ${{ hashFiles('cmake/Modules/*', 'ext/*.cmd', 'ext/*.sh') }} | |
| - name: Install nasm | |
| if: ${{ inputs.codec-aom == 'LOCAL' || inputs.codec-avm == 'LOCAL' || inputs.codec-dav1d == 'LOCAL' || inputs.codec-svt == 'LOCAL' }} | |
| uses: ilammy/setup-nasm@72793074d3c8cdda771dba85f6deafe00623038b # v1.5.2 | |
| - name: Create folders | |
| if: env.AVIF_WIN_LIBRARIES == '' | |
| run: | | |
| mkdir -p ${{ github.workspace }}\vcpkg\installed\x64-windows-release\bin | |
| mkdir -p ${{ github.workspace }}\vcpkg\installed\x64-windows-release\include | |
| mkdir -p ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib | |
| mkdir -p ${{ github.workspace }}\vcpkg\installed\x64-windows-release\pkgconfig | |
| shell: pwsh | |
| - name: Install rav1e | |
| if: ${{ inputs.codec-rav1e == 'SYSTEM' }} | |
| run: | | |
| $LINK = "https://github.com/xiph/rav1e/releases/download/v0.8.1" | |
| $FILE = "rav1e-0.8.1-windows-msvc-generic" | |
| curl -LO "$LINK/$FILE.zip" | |
| mkdir -p ${{ github.workspace }}\tmp | |
| 7z x -y "$FILE.zip" -o"${{ github.workspace }}\tmp" | |
| # Do not mv the folder's content to not overwrite, and rsync is not installed. | |
| mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\bin\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\bin | |
| mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\include\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\include | |
| mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\rav1e* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib | |
| mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\pkgconfig\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib\pkgconfig | |
| shell: pwsh | |
| - name: Add dependent DLLs to PATH | |
| if: env.AVIF_WIN_LIBRARIES != '' || inputs.codec-rav1e == 'SYSTEM' | |
| run: | | |
| echo "${{ github.workspace }}\vcpkg\installed\x64-windows-release\bin" >> $env:GITHUB_PATH | |
| echo "${{ github.workspace }}\build" >> $env:GITHUB_PATH | |
| shell: pwsh | |
| - uses: ./.github/actions/cache | |
| id: cache | |
| with: | |
| extra-key: ${{ inputs.extra-cache-key }} | |
| use-meson: ${{ inputs.codec-dav1d == 'LOCAL' }} | |
| use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }} | |
| - uses: ./.github/actions/setup-common | |
| with: | |
| codec-aom: ${{ inputs.codec-aom }} | |
| codec-dav1d: ${{ inputs.codec-dav1d }} | |
| codec-rav1e: ${{ inputs.codec-rav1e }} | |
| codec-svt: ${{ inputs.codec-svt }} |