continuous_deployment.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
  39. - uses: lukka/get-cmake@bb2faa721a800324b726fec00f7c1ff7641964d1 # v4.2.0
  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-latest, family: osx}]
  89. compiler: [{cc: clang, cxx: clang++}]
  90. cmake_build_type: [Debug, Release]
  91. steps:
  92. - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
  93. - uses: lukka/get-cmake@bb2faa721a800324b726fec00f7c1ff7641964d1 # v4.2.0
  94. - run: ./update_glslang_sources.py
  95. - name: Build
  96. env:
  97. CC: ${{matrix.compiler.cc}}
  98. CXX: ${{matrix.compiler.cxx}}
  99. MACOSX_DEPLOYMENT_TARGET: 11.0
  100. run: |
  101. mkdir build && cd build
  102. cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" ..
  103. make -j4 install
  104. - name: Test
  105. run: |
  106. cd build
  107. ctest --output-on-failure
  108. - name: Zip
  109. env:
  110. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  111. run: |
  112. cd build/install
  113. zip ${ARCHIVE} \
  114. bin/glslang \
  115. bin/glslangValidator \
  116. include/glslang/* \
  117. include/glslang/**/* \
  118. lib/libGenericCodeGen.a \
  119. lib/libglslang.a \
  120. lib/libglslang-default-resource-limits.a \
  121. lib/libMachineIndependent.a \
  122. lib/libOSDependent.a \
  123. lib/libSPIRV.a \
  124. lib/libSPIRV-Tools.a \
  125. lib/libSPIRV-Tools-opt.a
  126. - name: Deploy
  127. env:
  128. ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  129. uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
  130. with:
  131. script: |
  132. const script = require('.github/workflows/deploy.js')
  133. await script({github, context, core})
  134. windows:
  135. runs-on: ${{matrix.os.genus}}
  136. permissions:
  137. contents: write
  138. strategy:
  139. fail-fast: false
  140. matrix:
  141. os: [{genus: windows-2022, family: windows}]
  142. cmake_build_type: [Debug, Release]
  143. steps:
  144. - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
  145. - uses: lukka/get-cmake@bb2faa721a800324b726fec00f7c1ff7641964d1 # v4.2.0
  146. - run: python update_glslang_sources.py
  147. - name: Build
  148. run: |
  149. cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
  150. cmake --build build --config ${{matrix.cmake_build_type}} --target install
  151. - name: Test
  152. run: |
  153. cd build
  154. ctest -C ${{matrix.cmake_build_type}} --output-on-failure
  155. - name: Zip
  156. if: ${{ matrix.cmake_build_type == 'Debug' }}
  157. env:
  158. ARCHIVE: glslang-master-${{matrix.os.family}}-Debug.zip
  159. run: |
  160. cd build/install
  161. 7z a ${{env.ARCHIVE}} `
  162. bin/glslang.exe `
  163. bin/glslangValidator.exe `
  164. include/glslang/* `
  165. lib/GenericCodeGend.lib `
  166. lib/glslangd.lib `
  167. lib/glslang-default-resource-limitsd.lib `
  168. lib/MachineIndependentd.lib `
  169. lib/OSDependentd.lib `
  170. lib/SPIRVd.lib `
  171. lib/SPIRV-Toolsd.lib `
  172. lib/SPIRV-Tools-optd.lib
  173. - name: Zip
  174. if: ${{ matrix.cmake_build_type == 'Release' }}
  175. env:
  176. ARCHIVE: glslang-master-${{matrix.os.family}}-Release.zip
  177. run: |
  178. cd build/install
  179. 7z a ${{env.ARCHIVE}} `
  180. bin/glslang.exe `
  181. bin/glslangValidator.exe `
  182. include/glslang/* `
  183. lib/GenericCodeGen.lib `
  184. lib/glslang.lib `
  185. lib/glslang-default-resource-limits.lib `
  186. lib/MachineIndependent.lib `
  187. lib/OSDependent.lib `
  188. lib/SPIRV.lib `
  189. lib/SPIRV-Tools.lib `
  190. lib/SPIRV-Tools-opt.lib
  191. - name: Deploy
  192. env:
  193. ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
  194. uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
  195. with:
  196. script: |
  197. const script = require('.github/workflows/deploy.js')
  198. await script({github, context, core})