| name: "Setup on Windows" |
| description: "Installs dependencies specific to Windows" |
| inputs: |
| codec-aom: |
| 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" |
| 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: |
| value: ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} |
| runs: |
| using: "composite" |
| steps: |
| - name: Setup Developer Command Prompt for Microsoft Visual C++ |
| uses: ilammy/msvc-dev-cmd@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=${{ env.AVIF_WIN_LIBRARIES }} aom" >> "$GITHUB_ENV" |
| shell: bash |
| - name: Install libdav1d library |
| if: ${{ inputs.codec-dav1d == 'SYSTEM' }} |
| run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} dav1d" >> "$GITHUB_ENV" |
| shell: bash |
| - name: Install libjpeg-turbo library |
| if: ${{ inputs.libjpeg-turbo == 'SYSTEM' }} |
| run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} libjpeg-turbo" >> "$GITHUB_ENV" |
| shell: bash |
| - name: Install libxml2 library |
| if: ${{ inputs.libxml2 == 'SYSTEM' }} |
| run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} libxml2" >> "$GITHUB_ENV" |
| shell: bash |
| - name: Install libyuv library |
| if: ${{ inputs.libyuv == 'SYSTEM' }} |
| run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} libyuv" >> "$GITHUB_ENV" |
| shell: bash |
| - name: Install zlibpng library |
| if: ${{ inputs.zlibpng == 'SYSTEM' }} |
| run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} libpng zlib" >> "$GITHUB_ENV" |
| shell: bash |
| |
| - name: Install libraries |
| uses: johnwason/vcpkg-action@caa1c94fbb94d8b023a0cc93edf10cd3791349a7 # v7.0.1 |
| 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: 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 |
| |
| - uses: ./.github/actions/setup-common |
| with: |
| codec-aom: ${{ inputs.codec-aom }} |
| codec-dav1d: ${{ inputs.codec-dav1d }} |
| codec-rav1e: ${{ inputs.codec-rav1e }} |
| - 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' }} |