File: action.yml

package info (click to toggle)
libavif 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,648 kB
  • sloc: ansic: 30,743; cpp: 14,606; xml: 1,507; sh: 1,296; java: 307; makefile: 57
file content (126 lines) | stat: -rw-r--r-- 5,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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:
    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=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 SVT-AV1 library
      if: ${{ inputs.codec-svt == 'SYSTEM' }}
      run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} svt-av1" >> "$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: 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

    - 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 }}