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