yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

dependabot[bot]Bump actions/github-script from 8.0.0 to 9.0.00af41187

16.3.0
8.1 KiB202 linesraw
1# NOTE: The following documentation may be useful to maintainers of this workflow.
2# Github actions: https://docs.github.com/en/actions
3# Github github-script action: https://github.com/actions/github-script
4# GitHub REST API: https://docs.github.com/en/rest
5# Octokit front-end to the GitHub REST API: https://octokit.github.io/rest.js/v18
6# Octokit endpoint methods: https://github.com/octokit/plugin-rest-endpoint-methods.js/tree/master/docs/repos
7
8# TODO: Use actions/upload-artifact and actions/download-artifact to simplify deployment.
9# TODO: Use composite actions to refactor redundant code.
10
11name: Continuous Deployment
12
13on:
14    workflow_dispatch:
15    push:
16        branches:
17            - main
18        paths-ignore:
19            - 'README.md'
20            - 'LICENSE.txt'
21            - 'CODE_OF_CONDUCT.md'
22            - 'BUILD.*'
23            - 'WORKSPACE'
24            - 'kokoro/*'
25            - 'make-revision'
26            - 'Android.mk'
27            - '_config.yml'
28
29permissions: read-all
30
31jobs:
32    linux:
33        runs-on: ${{matrix.os.genus}}
34        permissions:
35            contents: write
36        strategy:
37            fail-fast: false
38            matrix:
39                os: [{genus: ubuntu-22.04, family: linux}]
40                compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
41                cmake_build_type: [Debug, Release]
42        steps:
43            - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44            - run: ./update_glslang_sources.py
45            - name: Build
46              env:
47                  CC: ${{matrix.compiler.cc}}
48                  CXX: ${{matrix.compiler.cxx}}
49              run: |
50                  mkdir build && cd build
51                  cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
52                  make -j4 install
53            - name: Test
54              run: |
55                  cd build
56                  ctest --output-on-failure
57            - name: Zip
58              if: ${{ matrix.compiler.cc == 'clang' }}
59              env:
60                  ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
61              run: |
62                  cd build/install
63                  zip ${ARCHIVE} \
64                      bin/glslang \
65                      bin/glslangValidator \
66                      include/glslang/* \
67                      include/glslang/**/* \
68                      lib/libGenericCodeGen.a \
69                      lib/libglslang.a \
70                      lib/libglslang-default-resource-limits.a \
71                      lib/libMachineIndependent.a \
72                      lib/libOSDependent.a \
73                      lib/libSPIRV.a \
74                      lib/libSPIRV-Tools.a \
75                      lib/libSPIRV-Tools-opt.a
76            - name: Deploy
77              if: ${{ matrix.compiler.cc == 'clang' }}
78              env:
79                  ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
80              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
81              with:
82                  script: |
83                      const script = require('.github/workflows/deploy.js')
84                      await script({github, context, core})
85
86    macos:
87        runs-on: ${{matrix.os.genus}}
88        permissions:
89            contents: write
90        strategy:
91            fail-fast: false
92            matrix:
93                os: [{genus: macos-latest, family: osx}]
94                compiler: [{cc: clang, cxx: clang++}]
95                cmake_build_type: [Debug, Release]
96        steps:
97            - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
98            - run: ./update_glslang_sources.py
99            - name: Build
100              env:
101                  CC: ${{matrix.compiler.cc}}
102                  CXX: ${{matrix.compiler.cxx}}
103                  MACOSX_DEPLOYMENT_TARGET: 11.0
104              run: |
105                  mkdir build && cd build
106                  cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" ..
107                  make -j4 install
108            - name: Test
109              run: |
110                  cd build
111                  ctest --output-on-failure
112            - name: Zip
113              env:
114                  ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
115              run: |
116                  cd build/install
117                  zip ${ARCHIVE} \
118                      bin/glslang \
119                      bin/glslangValidator \
120                      include/glslang/* \
121                      include/glslang/**/* \
122                      lib/libGenericCodeGen.a \
123                      lib/libglslang.a \
124                      lib/libglslang-default-resource-limits.a \
125                      lib/libMachineIndependent.a \
126                      lib/libOSDependent.a \
127                      lib/libSPIRV.a \
128                      lib/libSPIRV-Tools.a \
129                      lib/libSPIRV-Tools-opt.a
130            - name: Deploy
131              env:
132                  ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
133              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
134              with:
135                  script: |
136                      const script = require('.github/workflows/deploy.js')
137                      await script({github, context, core})
138
139    windows:
140        runs-on: ${{matrix.os.genus}}
141        permissions:
142            contents: write
143        strategy:
144            fail-fast: false
145            matrix:
146                os: [{genus: windows-2022, family: windows}]
147                cmake_build_type: [Debug, Release]
148        steps:
149            - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
150            - run: python update_glslang_sources.py
151            - name: Build
152              run: |
153                  cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
154                  cmake --build build --config ${{matrix.cmake_build_type}} --target install
155            - name: Test
156              run: |
157                  cd build
158                  ctest -C ${{matrix.cmake_build_type}} --output-on-failure
159            - name: Zip
160              if: ${{ matrix.cmake_build_type == 'Debug' }}
161              env:
162                  ARCHIVE: glslang-master-${{matrix.os.family}}-Debug.zip
163              run: |
164                  cd build/install
165                  7z a ${{env.ARCHIVE}} `
166                      bin/glslang.exe `
167                      bin/glslangValidator.exe `
168                      include/glslang/* `
169                      lib/GenericCodeGend.lib `
170                      lib/glslangd.lib `
171                      lib/glslang-default-resource-limitsd.lib `
172                      lib/MachineIndependentd.lib `
173                      lib/OSDependentd.lib `
174                      lib/SPIRVd.lib `
175                      lib/SPIRV-Toolsd.lib `
176                      lib/SPIRV-Tools-optd.lib
177            - name: Zip
178              if: ${{ matrix.cmake_build_type == 'Release' }}
179              env:
180                  ARCHIVE: glslang-master-${{matrix.os.family}}-Release.zip
181              run: |
182                  cd build/install
183                  7z a ${{env.ARCHIVE}} `
184                      bin/glslang.exe `
185                      bin/glslangValidator.exe `
186                      include/glslang/* `
187                      lib/GenericCodeGen.lib `
188                      lib/glslang.lib `
189                      lib/glslang-default-resource-limits.lib `
190                      lib/MachineIndependent.lib `
191                      lib/OSDependent.lib `
192                      lib/SPIRV.lib `
193                      lib/SPIRV-Tools.lib `
194                      lib/SPIRV-Tools-opt.lib
195            - name: Deploy
196              env:
197                  ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
198              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
199              with:
200                  script: |
201                      const script = require('.github/workflows/deploy.js')
202                      await script({github, context, core})