continuous_deployment.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  39. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  40. - run: ./update_glslang_sources.py
  41. - name: Build
  42. env:
  43. CC: ${{matrix.compiler.cc}}
  44. CXX: ${{matrix.compiler.cxx}}
  45. run: |
  46. mkdir build && cd build
  47. cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
  48. make -j4 install
  49. - name: Test
  50. run: |
  51. cd build
  52. ctest --output-on-failure
  53. - name: Zip
  54. if: ${{ matrix.compiler.cc == 'clang' }}
  55. env:
  56. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  57. run: |
  58. cd build/install
  59. zip ${ARCHIVE} \
  60. bin/glslang \
  61. bin/glslangValidator \
  62. include/glslang/* \
  63. include/glslang/**/* \
  64. lib/libGenericCodeGen.a \
  65. lib/libglslang.a \
  66. lib/libglslang-default-resource-limits.a \
  67. lib/libMachineIndependent.a \
  68. lib/libOSDependent.a \
  69. lib/libSPIRV.a \
  70. lib/libSPIRV-Tools.a \
  71. lib/libSPIRV-Tools-opt.a
  72. - name: Deploy
  73. if: ${{ matrix.compiler.cc == 'clang' }}
  74. env:
  75. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  76. uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
  77. with:
  78. script: |
  79. const script = require('.github/workflows/deploy.js')
  80. await script({github, context, core})
  81. macos:
  82. runs-on: ${{matrix.os.genus}}
  83. permissions:
  84. contents: write
  85. strategy:
  86. fail-fast: false
  87. matrix:
  88. os: [{genus: macos-13, family: osx}]
  89. compiler: [{cc: clang, cxx: clang++}]
  90. cmake_build_type: [Debug, Release]
  91. steps:
  92. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  93. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  94. - run: ./update_glslang_sources.py
  95. - name: Build
  96. env:
  97. CC: ${{matrix.compiler.cc}}
  98. CXX: ${{matrix.compiler.cxx}}
  99. run: |
  100. mkdir build && cd build
  101. cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
  102. make -j4 install
  103. - name: Test
  104. run: |
  105. cd build
  106. ctest --output-on-failure
  107. - name: Zip
  108. env:
  109. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  110. run: |
  111. cd build/install
  112. zip ${ARCHIVE} \
  113. bin/glslang \
  114. bin/glslangValidator \
  115. include/glslang/* \
  116. include/glslang/**/* \
  117. lib/libGenericCodeGen.a \
  118. lib/libglslang.a \
  119. lib/libglslang-default-resource-limits.a \
  120. lib/libMachineIndependent.a \
  121. lib/libOSDependent.a \
  122. lib/libSPIRV.a \
  123. lib/libSPIRV-Tools.a \
  124. lib/libSPIRV-Tools-opt.a
  125. - name: Deploy
  126. env:
  127. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  128. uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
  129. with:
  130. script: |
  131. const script = require('.github/workflows/deploy.js')
  132. await script({github, context, core})
  133. windows:
  134. runs-on: ${{matrix.os.genus}}
  135. permissions:
  136. contents: write
  137. strategy:
  138. fail-fast: false
  139. matrix:
  140. os: [{genus: windows-2022, family: windows}]
  141. cmake_build_type: [Debug, Release]
  142. steps:
  143. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  144. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  145. - run: python update_glslang_sources.py
  146. - name: Build
  147. run: |
  148. cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
  149. cmake --build build --config ${{matrix.cmake_build_type}} --target install
  150. - name: Test
  151. run: |
  152. cd build
  153. ctest -C ${{matrix.cmake_build_type}} --output-on-failure
  154. - name: Zip
  155. if: ${{ matrix.cmake_build_type == 'Debug' }}
  156. env:
  157. ARCHIVE: glslang-master-${{matrix.os.family}}-Debug.zip
  158. run: |
  159. cd build/install
  160. 7z a ${{env.ARCHIVE}} `
  161. bin/glslang.exe `
  162. bin/glslangValidator.exe `
  163. include/glslang/* `
  164. lib/GenericCodeGend.lib `
  165. lib/glslangd.lib `
  166. lib/glslang-default-resource-limitsd.lib `
  167. lib/MachineIndependentd.lib `
  168. lib/OSDependentd.lib `
  169. lib/SPIRVd.lib `
  170. lib/SPIRV-Toolsd.lib `
  171. lib/SPIRV-Tools-optd.lib
  172. - name: Zip
  173. if: ${{ matrix.cmake_build_type == 'Release' }}
  174. env:
  175. ARCHIVE: glslang-master-${{matrix.os.family}}-Release.zip
  176. run: |
  177. cd build/install
  178. 7z a ${{env.ARCHIVE}} `
  179. bin/glslang.exe `
  180. bin/glslangValidator.exe `
  181. include/glslang/* `
  182. lib/GenericCodeGen.lib `
  183. lib/glslang.lib `
  184. lib/glslang-default-resource-limits.lib `
  185. lib/MachineIndependent.lib `
  186. lib/OSDependent.lib `
  187. lib/SPIRV.lib `
  188. lib/SPIRV-Tools.lib `
  189. lib/SPIRV-Tools-opt.lib
  190. - name: Deploy
  191. env:
  192. ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  193. uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
  194. with:
  195. script: |
  196. const script = require('.github/workflows/deploy.js')
  197. await script({github, context, core})