spine-godot.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. name: Build and Publish Godot editor and templates
  2. on:
  3. push:
  4. paths:
  5. - ".github/workflows/spine-godot.yml"
  6. - 'spine-godot/**'
  7. - 'spine-cpp/**'
  8. workflow_dispatch:
  9. env:
  10. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  11. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  12. AWS_EC2_METADATA_DISABLED: true
  13. EM_VERSION: 3.1.10
  14. GODOT_TAG: 3.4.4-stable
  15. GODOT_VERSION: 3.4.4.stable
  16. jobs:
  17. godot-editor-windows:
  18. runs-on: windows-latest
  19. steps:
  20. - uses: actions/checkout@v2
  21. with:
  22. fetch-depth: 0
  23. - name: Setup python and scons
  24. uses: ./.github/actions/setup-godot-deps
  25. - name: Build Godot artifact
  26. shell: bash
  27. run: |
  28. ./spine-godot/build/setup.sh $GODOT_TAG false
  29. ./spine-godot/build/build.sh release_debug
  30. - name: Upload artifacts
  31. uses: actions/upload-artifact@v2
  32. with:
  33. name: godot-editor-windows.zip
  34. path: spine-godot/godot/bin/godot.windows.opt.tools.64.exe
  35. godot-editor-linux:
  36. runs-on: ubuntu-18.04
  37. steps:
  38. - uses: actions/checkout@v2
  39. with:
  40. fetch-depth: 0
  41. - name: Setup python and scons
  42. uses: ./.github/actions/setup-godot-deps
  43. - name: Build Godot artifact
  44. shell: bash
  45. run: |
  46. sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev
  47. ./spine-godot/build/setup.sh $GODOT_TAG false
  48. ./spine-godot/build/build.sh release_debug
  49. - name: Upload artifacts
  50. uses: actions/upload-artifact@v2
  51. with:
  52. name: godot-editor-linux.zip
  53. path: spine-godot/godot/bin/godot.x11.opt.tools.64
  54. godot-editor-macos:
  55. runs-on: macos-latest
  56. steps:
  57. - uses: actions/checkout@v2
  58. with:
  59. fetch-depth: 0
  60. - name: Setup python and scons
  61. uses: ./.github/actions/setup-godot-deps
  62. - name: Build Godot artifact
  63. shell: bash
  64. run: |
  65. ./spine-godot/build/setup.sh $GODOT_TAG false
  66. ./spine-godot/build/build.sh release_debug
  67. pushd spine-godot/godot/bin
  68. zip -r godot-editor-macos.zip Godot.app
  69. popd
  70. - name: Upload artifacts
  71. uses: actions/upload-artifact@v2
  72. with:
  73. name: godot-editor-macos.zip
  74. path: spine-godot/godot/bin/godot-editor-macos.zip
  75. godot-template-ios:
  76. runs-on: macos-latest
  77. steps:
  78. - uses: actions/checkout@v2
  79. with:
  80. fetch-depth: 0
  81. - name: Setup python and scons
  82. uses: ./.github/actions/setup-godot-deps
  83. - name: Build Godot artifact
  84. run: |
  85. ./spine-godot/build/setup.sh $GODOT_TAG false
  86. ./spine-godot/build/build-templates.sh ios
  87. - name: Upload artifacts
  88. uses: actions/upload-artifact@v2
  89. with:
  90. name: godot-template-ios.zip
  91. path: spine-godot/godot/bin/iphone.zip
  92. godot-template-macos:
  93. runs-on: macos-latest
  94. steps:
  95. - uses: actions/checkout@v2
  96. with:
  97. fetch-depth: 0
  98. - name: Setup python and scons
  99. uses: ./.github/actions/setup-godot-deps
  100. - name: Build Godot artifact
  101. run: |
  102. ./spine-godot/build/setup.sh $GODOT_TAG false
  103. ./spine-godot/build/build-templates.sh macos
  104. - name: Upload artifacts
  105. uses: actions/upload-artifact@v2
  106. with:
  107. name: godot-template-macos.zip
  108. path: spine-godot/godot/bin/osx.zip
  109. godot-template-linux:
  110. runs-on: ubuntu-18.04
  111. steps:
  112. - uses: actions/checkout@v2
  113. with:
  114. fetch-depth: 0
  115. - name: Setup python and scons
  116. uses: ./.github/actions/setup-godot-deps
  117. - name: Build Godot artifact
  118. run: |
  119. sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev
  120. ./spine-godot/build/setup.sh $GODOT_TAG false
  121. ./spine-godot/build/build-templates.sh linux
  122. - name: Upload artifacts debug
  123. uses: actions/upload-artifact@v2
  124. with:
  125. name: godot-template-linux-debug.zip
  126. path: spine-godot/godot/bin/linux_x11_64_debug
  127. - name: Upload artifacts release
  128. uses: actions/upload-artifact@v2
  129. with:
  130. name: godot-template-linux-release.zip
  131. path: spine-godot/godot/bin/linux_x11_64_release
  132. godot-template-windows:
  133. runs-on: windows-latest
  134. steps:
  135. - uses: actions/checkout@v2
  136. with:
  137. fetch-depth: 0
  138. - name: Setup python and scons
  139. uses: ./.github/actions/setup-godot-deps
  140. - name: Build Godot artifact
  141. shell: bash
  142. run: |
  143. ./spine-godot/build/setup.sh $GODOT_TAG false
  144. ./spine-godot/build/build-templates.sh windows
  145. - name: Upload artifacts debug
  146. uses: actions/upload-artifact@v2
  147. with:
  148. name: godot-template-windows-debug.zip
  149. path: spine-godot/godot/bin/windows_64_debug.exe
  150. - name: Upload artifacts release
  151. uses: actions/upload-artifact@v2
  152. with:
  153. name: godot-template-windows-release.zip
  154. path: spine-godot/godot/bin/windows_64_release.exe
  155. godot-template-android:
  156. runs-on: ubuntu-20.04
  157. steps:
  158. - uses: actions/checkout@v2
  159. with:
  160. fetch-depth: 0
  161. # Azure repositories are not reliable, we need to prevent azure giving us packages.
  162. - name: Make apt sources.list use the default Ubuntu repositories
  163. run: |
  164. sudo rm -f /etc/apt/sources.list.d/*
  165. sudo cp -f spine-godot/build/sources.lst /etc/apt/sources.list
  166. sudo apt-get update
  167. - name: Set up Java 11
  168. uses: actions/setup-java@v1
  169. with:
  170. java-version: 11
  171. - name: Setup python and scons
  172. uses: ./.github/actions/setup-godot-deps
  173. - name: Build Godot artifact
  174. shell: bash
  175. run: |
  176. ./spine-godot/build/setup.sh $GODOT_TAG false
  177. ./spine-godot/build/build-templates.sh android
  178. - name: Upload artifacts debug
  179. uses: actions/upload-artifact@v2
  180. with:
  181. name: godot-template-android-debug.zip
  182. path: spine-godot/godot/bin/android_debug.apk
  183. - name: Upload artifacts release
  184. uses: actions/upload-artifact@v2
  185. with:
  186. name: godot-template-android-release.zip
  187. path: spine-godot/godot/bin/android_release.apk
  188. - name: Upload artifacts source
  189. uses: actions/upload-artifact@v2
  190. with:
  191. name: godot-template-android-source.zip
  192. path: spine-godot/godot/bin/android_source.zip
  193. godot-template-web:
  194. runs-on: ubuntu-20.04
  195. steps:
  196. - uses: actions/checkout@v2
  197. with:
  198. fetch-depth: 0
  199. - name: Set up Emscripten latest
  200. uses: mymindstorm/setup-emsdk@v10
  201. with:
  202. version: ${{env.EM_VERSION}}
  203. - name: Verify Emscripten setup
  204. run: |
  205. emcc -v
  206. - name: Setup python and scons
  207. uses: ./.github/actions/setup-godot-deps
  208. - name: Build Godot artifact
  209. run: |
  210. ./spine-godot/build/setup.sh $GODOT_TAG false
  211. ./spine-godot/build/build-templates.sh web
  212. - name: Upload artifacts debug
  213. uses: actions/upload-artifact@v2
  214. with:
  215. name: godot-template-web-debug.zip
  216. path: spine-godot/godot/bin/webassembly_debug.zip
  217. - name: Upload artifacts release
  218. uses: actions/upload-artifact@v2
  219. with:
  220. name: godot-template-web-release.zip
  221. path: spine-godot/godot/bin/webassembly_release.zip
  222. upload-to-s3:
  223. needs: [godot-editor-windows, godot-editor-linux, godot-editor-macos, godot-template-ios, godot-template-macos, godot-template-windows, godot-template-linux, godot-template-android, godot-template-web]
  224. runs-on: ubuntu-latest
  225. steps:
  226. - name: Download godot-editor-windows artifact
  227. uses: actions/download-artifact@v2
  228. with:
  229. name: godot-editor-windows.zip
  230. - name: Download godot-editor-linux artifact
  231. uses: actions/download-artifact@v2
  232. with:
  233. name: godot-editor-linux.zip
  234. - name: Download godot-editor-macos artifact
  235. uses: actions/download-artifact@v2
  236. with:
  237. name: godot-editor-macos.zip
  238. - name: Download godot-template-ios artifact
  239. uses: actions/download-artifact@v2
  240. with:
  241. name: godot-template-ios.zip
  242. - name: Download godot-template-macos artifact
  243. uses: actions/download-artifact@v2
  244. with:
  245. name: godot-template-macos.zip
  246. - name: Download godot-template-windows-release artifact
  247. uses: actions/download-artifact@v2
  248. with:
  249. name: godot-template-windows-release.zip
  250. - name: Download godot-template-windows-debug artifact
  251. uses: actions/download-artifact@v2
  252. with:
  253. name: godot-template-windows-debug.zip
  254. - name: Download godot-template-linux-release artifact
  255. uses: actions/download-artifact@v2
  256. with:
  257. name: godot-template-linux-release.zip
  258. - name: Download godot-template-linux-debug artifact
  259. uses: actions/download-artifact@v2
  260. with:
  261. name: godot-template-linux-debug.zip
  262. - name: Download godot-template-android-release artifact
  263. uses: actions/download-artifact@v2
  264. with:
  265. name: godot-template-android-release.zip
  266. - name: Download godot-template-android-debug artifact
  267. uses: actions/download-artifact@v2
  268. with:
  269. name: godot-template-android-debug.zip
  270. - name: Download godot-template-android-source artifact
  271. uses: actions/download-artifact@v2
  272. with:
  273. name: godot-template-android-source.zip
  274. - name: Download godot-template-web-release artifact
  275. uses: actions/download-artifact@v2
  276. with:
  277. name: godot-template-web-release.zip
  278. - name: Download godot-template-web-debug artifact
  279. uses: actions/download-artifact@v2
  280. with:
  281. name: godot-template-web-debug.zip
  282. - name: Upload artifacts to S3
  283. shell: bash
  284. if: env.AWS_ACCESS_KEY_ID != null
  285. run: |
  286. BRANCH=${GITHUB_REF#refs/heads/}
  287. echo "branch: $BRANCH"
  288. mv godot.windows.opt.tools.64.exe godot-$BRANCH-$GODOT_TAG.exe
  289. mv godot.x11.opt.tools.64 godot-$BRANCH-$GODOT_TAG
  290. zip godot-editor-windows.zip godot-$BRANCH-$GODOT_TAG.exe
  291. zip godot-editor-linux.zip godot-$BRANCH-$GODOT_TAG
  292. aws s3 cp godot-editor-windows.zip s3://spine-godot/$BRANCH/$GODOT_TAG/
  293. aws s3 cp godot-editor-linux.zip s3://spine-godot/$BRANCH/$GODOT_TAG/
  294. aws s3 cp godot-editor-macos.zip s3://spine-godot/$BRANCH/$GODOT_TAG/
  295. echo "$GODOT_VERSION" > version.txt
  296. ls -lah
  297. zip spine-godot-templates-$BRANCH-$GODOT_TAG.zip iphone.zip osx.zip windows_64_debug.exe windows_64_release.exe linux_x11_64_debug linux_x11_64_release webassembly_debug.zip webassembly_release.zip android_release.apk android_debug.apk android_source.zip version.txt
  298. aws s3 cp spine-godot-templates-$BRANCH-$GODOT_TAG.zip s3://spine-godot/$BRANCH/$GODOT_TAG/spine-godot-templates-$BRANCH-$GODOT_TAG.tpz