yum-mirror/glslang

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

dependabot[bot]Bump softprops/action-gh-release from 3.0.2 to 3.0.36be8299e

main
14.0 KiB304 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# softprops/action-gh-release: https://github.com/softprops/action-gh-release
8
9name: Continuous Deployment
10
11on:
12    workflow_dispatch:
13    push:
14        branches:
15            - main
16        paths-ignore:
17            - 'README.md'
18            - 'LICENSE.txt'
19            - 'CODE_OF_CONDUCT.md'
20            - 'BUILD.*'
21            - 'WORKSPACE'
22            - 'kokoro/*'
23            - 'make-revision'
24            - 'Android.mk'
25            - '_config.yml'
26        tags:
27            - '[0-9]*.[0-9]*.[0-9]*'
28
29permissions: read-all
30
31jobs:
32    linux:
33        runs-on: ${{matrix.os.runner}}
34        permissions:
35            contents: write
36        strategy:
37            fail-fast: false
38            matrix:
39                os: [{runner: ubuntu-22.04, platform: linux, arch: x86_64}]
40                compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
41                cmake_build_type: [Debug, Release]
42        steps:
43            - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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 -DSPIRV_SKIP_EXECUTABLES=ON ..
52                  make -j4 install
53            - name: Test
54              run: |
55                  cd build
56                  ctest --output-on-failure
57            - name: Package
58              if: ${{ matrix.compiler.cc == 'clang' }}
59              id: package
60              shell: bash
61              env:
62                  BUILD_TYPE: ${{matrix.cmake_build_type}}
63                  PLATFORM: ${{matrix.os.platform}}
64                  ARCH: ${{matrix.os.arch}}
65              run: |
66                  cd build/install
67                  BUILD_TYPE_LOWER="${BUILD_TYPE,,}"
68                  if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
69                      VERSION="${{ github.ref_name }}"
70                      ARCHIVE_BASE="glslang-${VERSION}-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
71                  else
72                      ARCHIVE_BASE="glslang-main-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
73                  fi
74                  FILES=(
75                      bin/glslang
76                      bin/glslangValidator
77                      include/glslang/build_info.h
78                      include/glslang/Include/ResourceLimits.h
79                      include/glslang/Include/glslang_c_interface.h
80                      include/glslang/Include/glslang_c_shader_types.h
81                      include/glslang/Include/visibility.h
82                      include/glslang/MachineIndependent/Versions.h
83                      include/glslang/Public/ResourceLimits.h
84                      include/glslang/Public/ShaderLang.h
85                      include/glslang/Public/resource_limits_c.h
86                      include/glslang/SPIRV/GlslangToSpv.h
87                      include/glslang/SPIRV/Logger.h
88                      include/glslang/SPIRV/SpvTools.h
89                      include/glslang/SPIRV/disassemble.h
90                      include/glslang/SPIRV/spirv.hpp11
91                      lib/libGenericCodeGen.a
92                      lib/libMachineIndependent.a
93                      lib/libOSDependent.a
94                      lib/libSPIRV.a
95                      lib/libSPIRV-Tools.a
96                      lib/libSPIRV-Tools-opt.a
97                      lib/libglslang.a
98                      lib/libglslang-default-resource-limits.a
99                  )
100                  # -y stores the glslangValidator symlink as-is rather than dereferencing it.
101                  zip -y "${ARCHIVE_BASE}.zip" "${FILES[@]}"
102                  tar -czf "${ARCHIVE_BASE}.tar.gz" "${FILES[@]}"
103                  echo "ARCHIVE_ZIP=build/install/${ARCHIVE_BASE}.zip" >> $GITHUB_OUTPUT
104                  echo "ARCHIVE_TAR=build/install/${ARCHIVE_BASE}.tar.gz" >> $GITHUB_OUTPUT
105            - name: Update main-tot tag
106              if: ${{ matrix.compiler.cc == 'clang' && !startsWith(github.ref, 'refs/tags/') }}
107              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
108              with:
109                  script: |
110                      await github.rest.git.updateRef({
111                          owner: context.repo.owner,
112                          repo: context.repo.repo,
113                          ref: 'tags/main-tot',
114                          sha: context.sha
115                      })
116            - name: Upload assets
117              if: ${{ matrix.compiler.cc == 'clang' }}
118              uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
119              with:
120                  tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'main-tot' }}
121                  fail_on_unmatched_files: true
122                  files: |
123                      ${{steps.package.outputs.ARCHIVE_ZIP}}
124                      ${{steps.package.outputs.ARCHIVE_TAR}}
125              env:
126                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127
128    macos:
129        runs-on: ${{matrix.os.runner}}
130        permissions:
131            contents: write
132        strategy:
133            fail-fast: false
134            matrix:
135                os: [{runner: macos-latest, platform: macos, arch: universal}]
136                compiler: [{cc: clang, cxx: clang++}]
137                cmake_build_type: [Debug, Release]
138        steps:
139            - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
140            - run: ./update_glslang_sources.py
141            - name: Build
142              env:
143                  CC: ${{matrix.compiler.cc}}
144                  CXX: ${{matrix.compiler.cxx}}
145                  MACOSX_DEPLOYMENT_TARGET: 11.0
146              run: |
147                  mkdir build && cd build
148                  cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install -DSPIRV_SKIP_EXECUTABLES=ON "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" ..
149                  make -j4 install
150            - name: Test
151              run: |
152                  cd build
153                  ctest --output-on-failure
154            - name: Package
155              id: package
156              shell: bash
157              env:
158                  BUILD_TYPE: ${{matrix.cmake_build_type}}
159                  PLATFORM: ${{matrix.os.platform}}
160                  ARCH: ${{matrix.os.arch}}
161              run: |
162                  cd build/install
163                  # macOS ships bash 3.2, which lacks ${VAR,,} lowercasing; use tr for portability.
164                  BUILD_TYPE_LOWER=$(echo "${BUILD_TYPE}" | tr '[:upper:]' '[:lower:]')
165                  if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
166                      VERSION="${{ github.ref_name }}"
167                      ARCHIVE_BASE="glslang-${VERSION}-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
168                  else
169                      ARCHIVE_BASE="glslang-main-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
170                  fi
171                  FILES=(
172                      bin/glslang
173                      bin/glslangValidator
174                      include/glslang/build_info.h
175                      include/glslang/Include/ResourceLimits.h
176                      include/glslang/Include/glslang_c_interface.h
177                      include/glslang/Include/glslang_c_shader_types.h
178                      include/glslang/Include/visibility.h
179                      include/glslang/MachineIndependent/Versions.h
180                      include/glslang/Public/ResourceLimits.h
181                      include/glslang/Public/ShaderLang.h
182                      include/glslang/Public/resource_limits_c.h
183                      include/glslang/SPIRV/GlslangToSpv.h
184                      include/glslang/SPIRV/Logger.h
185                      include/glslang/SPIRV/SpvTools.h
186                      include/glslang/SPIRV/disassemble.h
187                      include/glslang/SPIRV/spirv.hpp11
188                      lib/libGenericCodeGen.a
189                      lib/libMachineIndependent.a
190                      lib/libOSDependent.a
191                      lib/libSPIRV.a
192                      lib/libSPIRV-Tools.a
193                      lib/libSPIRV-Tools-opt.a
194                      lib/libglslang.a
195                      lib/libglslang-default-resource-limits.a
196                  )
197                  # -y stores the glslangValidator symlink as-is rather than dereferencing it.
198                  zip -y "${ARCHIVE_BASE}.zip" "${FILES[@]}"
199                  tar -czf "${ARCHIVE_BASE}.tar.gz" "${FILES[@]}"
200                  echo "ARCHIVE_ZIP=build/install/${ARCHIVE_BASE}.zip" >> $GITHUB_OUTPUT
201                  echo "ARCHIVE_TAR=build/install/${ARCHIVE_BASE}.tar.gz" >> $GITHUB_OUTPUT
202            - name: Update main-tot tag
203              if: ${{ !startsWith(github.ref, 'refs/tags/') }}
204              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
205              with:
206                  script: |
207                      await github.rest.git.updateRef({
208                          owner: context.repo.owner,
209                          repo: context.repo.repo,
210                          ref: 'tags/main-tot',
211                          sha: context.sha
212                      })
213            - name: Upload assets
214              uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
215              with:
216                  tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'main-tot' }}
217                  fail_on_unmatched_files: true
218                  files: |
219                      ${{steps.package.outputs.ARCHIVE_ZIP}}
220                      ${{steps.package.outputs.ARCHIVE_TAR}}
221              env:
222                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223
224    windows:
225        runs-on: ${{matrix.os.runner}}
226        permissions:
227            contents: write
228        strategy:
229            fail-fast: false
230            matrix:
231                os: [{runner: windows-2022, platform: windows, arch: x86_64}]
232                cmake_build_type: [Debug, Release]
233        steps:
234            - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
235            - run: python update_glslang_sources.py
236            - name: Build
237              run: |
238                  cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DSPIRV_SKIP_EXECUTABLES=ON
239                  cmake --build build --config ${{matrix.cmake_build_type}} --target install
240            - name: Test
241              run: |
242                  cd build
243                  ctest -C ${{matrix.cmake_build_type}} --output-on-failure
244            - name: Package
245              id: package
246              shell: bash
247              env:
248                  BUILD_TYPE: ${{matrix.cmake_build_type}}
249                  PLATFORM: ${{matrix.os.platform}}
250                  ARCH: ${{matrix.os.arch}}
251              run: |
252                  cd build/install
253                  BUILD_TYPE_LOWER="${BUILD_TYPE,,}"
254                  if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
255                      VERSION="${{ github.ref_name }}"
256                      ARCHIVE_BASE="glslang-${VERSION}-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
257                  else
258                      ARCHIVE_BASE="glslang-main-${PLATFORM}-${ARCH}-${BUILD_TYPE_LOWER}"
259                  fi
260                  if [ "${BUILD_TYPE}" == "Debug" ]; then
261                      7z a "${ARCHIVE_BASE}.zip" \
262                          bin/glslang.exe \
263                          include/glslang/* \
264                          lib/GenericCodeGend.lib \
265                          lib/glslangd.lib \
266                          lib/glslang-default-resource-limitsd.lib \
267                          lib/MachineIndependentd.lib \
268                          lib/OSDependentd.lib \
269                          lib/SPIRVd.lib \
270                          lib/SPIRV-Toolsd.lib \
271                          lib/SPIRV-Tools-optd.lib
272                  else
273                      7z a "${ARCHIVE_BASE}.zip" \
274                          bin/glslang.exe \
275                          include/glslang/* \
276                          lib/GenericCodeGen.lib \
277                          lib/glslang.lib \
278                          lib/glslang-default-resource-limits.lib \
279                          lib/MachineIndependent.lib \
280                          lib/OSDependent.lib \
281                          lib/SPIRV.lib \
282                          lib/SPIRV-Tools.lib \
283                          lib/SPIRV-Tools-opt.lib
284                  fi
285                  echo "ARCHIVE_ZIP=build/install/${ARCHIVE_BASE}.zip" >> $GITHUB_OUTPUT
286            - name: Update main-tot tag
287              if: ${{ !startsWith(github.ref, 'refs/tags/') }}
288              uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
289              with:
290                  script: |
291                      await github.rest.git.updateRef({
292                          owner: context.repo.owner,
293                          repo: context.repo.repo,
294                          ref: 'tags/main-tot',
295                          sha: context.sha
296                      })
297            - name: Upload assets
298              uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
299              with:
300                  tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'main-tot' }}
301                  fail_on_unmatched_files: true
302                  files: ${{steps.package.outputs.ARCHIVE_ZIP}}
303              env:
304                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}