continuous_deployment.yml 8.1 KB

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