spine-godot-extension-v4.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. name: Build spine-godot GDExtension (Godot 4.x)
  2. on:
  3. workflow_call:
  4. inputs:
  5. godot_tag:
  6. required: true
  7. type: string
  8. default: "Godot tag not specified!"
  9. godot_version:
  10. required: true
  11. type: string
  12. default: "Godot version not specified!"
  13. dev:
  14. required: true
  15. type: boolean
  16. default: false
  17. env:
  18. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  19. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  20. AWS_EC2_METADATA_DISABLED: true
  21. GODOT_TAG: ${{ inputs.godot_tag }}
  22. GODOT_VERSION: ${{ inputs.godot_version }}
  23. DEV_BUILD: ${{ inputs.dev }}
  24. jobs:
  25. build-windows:
  26. runs-on: windows-2022
  27. steps:
  28. - uses: actions/checkout@v3
  29. with:
  30. fetch-depth: 0
  31. - name: Setup python and scons
  32. uses: ./.github/actions/setup-godot-deps-4
  33. - name: Build GDExtension
  34. shell: bash
  35. run: |
  36. cd spine-godot/build
  37. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  38. ./build-extension.sh windows
  39. - name: Upload artifacts
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: gdextension-windows-${{ env.GODOT_TAG }}
  43. path: spine-godot/example-v4-extension/bin/windows/*.dll
  44. build-linux-x86_64:
  45. runs-on: ubuntu-22.04
  46. steps:
  47. - uses: actions/checkout@v3
  48. with:
  49. fetch-depth: 0
  50. - name: Setup python and scons
  51. uses: ./.github/actions/setup-godot-deps-4
  52. - name: Install dependencies
  53. run: |
  54. sudo apt-get update
  55. 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
  56. - name: Build GDExtension
  57. run: |
  58. cd spine-godot/build
  59. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  60. ./build-extension.sh linux
  61. - name: Upload artifacts
  62. uses: actions/upload-artifact@v4
  63. with:
  64. name: gdextension-linux-x86_64-${{ env.GODOT_TAG }}
  65. path: spine-godot/example-v4-extension/bin/linux/*.so
  66. build-macos:
  67. runs-on: macos-latest
  68. steps:
  69. - uses: actions/checkout@v3
  70. with:
  71. fetch-depth: 0
  72. - name: Setup python and scons
  73. uses: ./.github/actions/setup-godot-deps-4
  74. - name: Build GDExtension
  75. run: |
  76. cd spine-godot/build
  77. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  78. ./build-extension.sh macos
  79. - name: Upload artifacts
  80. uses: actions/upload-artifact@v4
  81. with:
  82. name: gdextension-macos-${{ env.GODOT_TAG }}
  83. path: spine-godot/example-v4-extension/bin/macos/**/*
  84. build-ios:
  85. runs-on: macos-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. with:
  89. fetch-depth: 0
  90. - name: Setup python and scons
  91. uses: ./.github/actions/setup-godot-deps-4
  92. - name: Build GDExtension
  93. run: |
  94. cd spine-godot/build
  95. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  96. ./build-extension.sh ios
  97. - name: Upload artifacts
  98. uses: actions/upload-artifact@v4
  99. with:
  100. name: gdextension-ios-${{ env.GODOT_TAG }}
  101. path: spine-godot/example-v4-extension/bin/ios/**/*
  102. build-android:
  103. runs-on: ubuntu-latest
  104. steps:
  105. - uses: actions/checkout@v3
  106. with:
  107. fetch-depth: 0
  108. - name: Make apt sources.list use the default Ubuntu repositories
  109. run: |
  110. sudo rm -f /etc/apt/sources.list.d/*
  111. sudo cp -f spine-godot/build/sources.lst /etc/apt/sources.list
  112. sudo apt-get update
  113. - name: Set up Java 17
  114. uses: actions/setup-java@v4
  115. with:
  116. distribution: temurin
  117. java-version: 17
  118. - name: Setup Android SDK & NDK
  119. uses: android-actions/setup-android@v2
  120. - name: Install NDK
  121. run: |
  122. yes | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
  123. ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;23.2.8568313"
  124. - name: Setup python and scons
  125. uses: ./.github/actions/setup-godot-deps-4
  126. - name: Build GDExtension
  127. run: |
  128. cd spine-godot/build
  129. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  130. ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/23.2.8568313 ./build-extension.sh android
  131. ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/23.2.8568313 ./build-extension.sh android x86_64
  132. - name: Upload artifacts
  133. uses: actions/upload-artifact@v4
  134. with:
  135. name: gdextension-android-${{ env.GODOT_TAG }}
  136. path: spine-godot/example-v4-extension/bin/android/*.so
  137. build-web:
  138. runs-on: ubuntu-latest
  139. steps:
  140. - uses: actions/checkout@v3
  141. with:
  142. fetch-depth: 0
  143. - name: Set up Emscripten latest
  144. uses: mymindstorm/setup-emsdk@v11
  145. with:
  146. version: 3.1.26
  147. - name: Setup python and scons
  148. uses: ./.github/actions/setup-godot-deps-4
  149. - name: Build GDExtension
  150. run: |
  151. cd spine-godot/build
  152. ./setup-extension.sh $GODOT_TAG $DEV_BUILD
  153. ./build-extension.sh web
  154. - name: Upload artifacts
  155. uses: actions/upload-artifact@v4
  156. with:
  157. name: gdextension-web-${{ env.GODOT_TAG }}
  158. path: spine-godot/example-v4-extension/bin/web/*.wasm
  159. upload-to-s3:
  160. needs: [build-windows, build-linux-x86_64, build-macos, build-ios, build-android, build-web]
  161. runs-on: ubuntu-latest
  162. steps:
  163. - uses: actions/checkout@v3
  164. with:
  165. fetch-depth: 0
  166. - name: Download windows artifact
  167. uses: actions/download-artifact@v4
  168. with:
  169. name: gdextension-windows-${{ env.GODOT_TAG }}
  170. path: artifacts/gdextension-windows-${{ env.GODOT_TAG }}
  171. - name: Download linux-x86_64 artifact
  172. uses: actions/download-artifact@v4
  173. with:
  174. name: gdextension-linux-x86_64-${{ env.GODOT_TAG }}
  175. path: artifacts/gdextension-linux-x86_64-${{ env.GODOT_TAG }}
  176. - name: Download macos artifact
  177. uses: actions/download-artifact@v4
  178. with:
  179. name: gdextension-macos-${{ env.GODOT_TAG }}
  180. path: artifacts/gdextension-macos-${{ env.GODOT_TAG }}
  181. - name: Download ios artifact
  182. uses: actions/download-artifact@v4
  183. with:
  184. name: gdextension-ios-${{ env.GODOT_TAG }}
  185. path: artifacts/gdextension-ios-${{ env.GODOT_TAG }}
  186. - name: Download android artifact
  187. uses: actions/download-artifact@v4
  188. with:
  189. name: gdextension-android-${{ env.GODOT_TAG }}
  190. path: artifacts/gdextension-android-${{ env.GODOT_TAG }}
  191. - name: Download web artifact
  192. uses: actions/download-artifact@v4
  193. with:
  194. name: gdextension-web-${{ env.GODOT_TAG }}
  195. path: artifacts/gdextension-web-${{ env.GODOT_TAG }}
  196. - name: Package and upload artifacts
  197. shell: bash
  198. if: env.AWS_ACCESS_KEY_ID != null
  199. run: |
  200. BRANCH=${GITHUB_REF#refs/heads/}
  201. echo "branch: $BRANCH"
  202. cd artifacts
  203. # Create directories matching the expected structure
  204. mkdir -p bin/{windows,linux,macos/macos.framework,ios,android,web}
  205. # Ensure gdextension file is in root
  206. cp ../spine-godot/spine_godot_extension.gdextension bin/
  207. # Move artifacts to their correct locations
  208. mv gdextension-windows-$GODOT_TAG/* bin/windows/
  209. mv gdextension-linux-x86_64-$GODOT_TAG/* bin/linux/
  210. mv gdextension-macos-$GODOT_TAG/* bin/macos/
  211. mv gdextension-ios-$GODOT_TAG/* bin/ios/
  212. mv gdextension-android-$GODOT_TAG/* bin/android/
  213. mv gdextension-web-$GODOT_TAG/* bin/web/
  214. # Create the final zip with branch and tag
  215. zip -r ../spine-godot-extension-$BRANCH-$GODOT_TAG.zip spine_godot_extension.gdextension bin/
  216. cd ..
  217. aws s3 cp spine-godot-extension-$BRANCH-$GODOT_TAG.zip s3://spine-godot/$BRANCH/$GODOT_TAG/