nightly.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. name: Nightly
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: 0 20 * * *
  6. jobs:
  7. build_windows:
  8. name: Windows Build
  9. if: github.repository == 'odin-lang/Odin'
  10. runs-on: windows-2022
  11. steps:
  12. - uses: actions/checkout@v4
  13. - name: build Odin
  14. shell: cmd
  15. run: |
  16. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
  17. ./build.bat 1 1
  18. - name: Odin run
  19. shell: cmd
  20. run: |
  21. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
  22. odin run examples/demo
  23. - name: Copy artifacts
  24. run: |
  25. rm bin/llvm/windows/LLVM-C.lib
  26. mkdir dist
  27. cp odin.exe dist
  28. cp LICENSE dist
  29. cp LLVM-C.dll dist
  30. cp -r shared dist
  31. cp -r base dist
  32. cp -r core dist
  33. cp -r vendor dist
  34. cp -r bin dist
  35. cp -r examples dist
  36. - name: Upload artifact
  37. uses: actions/upload-artifact@v4
  38. with:
  39. include-hidden-files: true
  40. name: windows_artifacts
  41. path: dist
  42. build_linux:
  43. name: Linux Build
  44. if: github.repository == 'odin-lang/Odin'
  45. runs-on: ubuntu-latest
  46. steps:
  47. - uses: actions/checkout@v4
  48. - uses: jirutka/setup-alpine@v1
  49. with:
  50. branch: edge
  51. - name: (Linux) Download LLVM
  52. run: |
  53. apk add --no-cache \
  54. musl-dev llvm20-dev clang20 git mold lz4 \
  55. libxml2-static llvm20-static zlib-static zstd-static \
  56. make
  57. shell: alpine.sh --root {0}
  58. - name: build odin
  59. # NOTE: this build does slow compile times because of musl
  60. run: ci/build_linux_static.sh
  61. shell: alpine.sh {0}
  62. - name: Odin run
  63. run: ./odin run examples/demo
  64. - name: Copy artifacts
  65. run: |
  66. FILE="odin-linux-amd64-nightly+$(date -I)"
  67. mkdir $FILE
  68. cp odin $FILE
  69. cp LICENSE $FILE
  70. cp -r shared $FILE
  71. cp -r base $FILE
  72. cp -r core $FILE
  73. cp -r vendor $FILE
  74. cp -r examples $FILE
  75. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  76. tar -czvf dist.tar.gz $FILE
  77. - name: Odin run
  78. run: |
  79. FILE="odin-linux-amd64-nightly+$(date -I)"
  80. $FILE/odin run examples/demo
  81. - name: Upload artifact
  82. uses: actions/upload-artifact@v4
  83. with:
  84. name: linux_artifacts
  85. path: dist.tar.gz
  86. build_macos:
  87. name: MacOS Build
  88. if: github.repository == 'odin-lang/Odin'
  89. runs-on: macos-13
  90. steps:
  91. - uses: actions/checkout@v4
  92. - name: Download LLVM and setup PATH
  93. run: |
  94. brew update
  95. brew install llvm dylibbundler lld
  96. brew --prefix llvm@20 # Verifies it is LLVM 20
  97. - name: build odin
  98. # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to
  99. # not link with libunwind bundled with LLVM but link with libunwind on the system.
  100. run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly
  101. - name: Bundle
  102. run: |
  103. FILE="odin-macos-amd64-nightly+$(date -I)"
  104. mkdir $FILE
  105. cp odin $FILE
  106. cp LICENSE $FILE
  107. cp -r shared $FILE
  108. cp -r base $FILE
  109. cp -r core $FILE
  110. cp -r vendor $FILE
  111. cp -r examples $FILE
  112. dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs
  113. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  114. tar -czvf dist.tar.gz $FILE
  115. - name: Odin run
  116. run: |
  117. FILE="odin-macos-amd64-nightly+$(date -I)"
  118. $FILE/odin run examples/demo
  119. - name: Upload artifact
  120. uses: actions/upload-artifact@v4
  121. with:
  122. name: macos_artifacts
  123. path: dist.tar.gz
  124. build_macos_arm:
  125. name: MacOS ARM Build
  126. if: github.repository == 'odin-lang/Odin'
  127. runs-on: macos-14 # ARM machine
  128. steps:
  129. - uses: actions/checkout@v4
  130. - name: Download LLVM and setup PATH
  131. run: |
  132. brew update
  133. brew install llvm dylibbundler lld
  134. brew --prefix llvm@20 # Verifies it is LLVM 20
  135. - name: build odin
  136. # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to
  137. # not link with libunwind bundled with LLVM but link with libunwind on the system.
  138. run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly
  139. - name: Bundle
  140. run: |
  141. FILE="odin-macos-arm64-nightly+$(date -I)"
  142. mkdir $FILE
  143. cp odin $FILE
  144. cp LICENSE $FILE
  145. cp -r shared $FILE
  146. cp -r base $FILE
  147. cp -r core $FILE
  148. cp -r vendor $FILE
  149. cp -r examples $FILE
  150. dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs
  151. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  152. tar -czvf dist.tar.gz $FILE
  153. - name: Odin run
  154. run: |
  155. FILE="odin-macos-arm64-nightly+$(date -I)"
  156. $FILE/odin run examples/demo
  157. - name: Upload artifact
  158. uses: actions/upload-artifact@v4
  159. with:
  160. name: macos_arm_artifacts
  161. path: dist.tar.gz
  162. upload_b2:
  163. runs-on: [ubuntu-latest]
  164. needs: [build_windows, build_macos, build_macos_arm, build_linux]
  165. steps:
  166. - uses: actions/checkout@v4
  167. - uses: actions/setup-python@v5
  168. with:
  169. python-version: '3.8.x'
  170. - name: Install B2 SDK
  171. shell: bash
  172. run: |
  173. python -m pip install --upgrade pip
  174. pip install --upgrade b2sdk
  175. - name: Display Python version
  176. run: python -c "import sys; print(sys.version)"
  177. - name: Download Windows artifacts
  178. uses: actions/[email protected]
  179. with:
  180. name: windows_artifacts
  181. path: windows_artifacts
  182. - name: Download Ubuntu artifacts
  183. uses: actions/[email protected]
  184. with:
  185. name: linux_artifacts
  186. path: linux_artifacts
  187. - name: Download macOS artifacts
  188. uses: actions/[email protected]
  189. with:
  190. name: macos_artifacts
  191. path: macos_artifacts
  192. - name: Download macOS arm artifacts
  193. uses: actions/[email protected]
  194. with:
  195. name: macos_arm_artifacts
  196. path: macos_arm_artifacts
  197. - name: Debug
  198. run: |
  199. tree -L 2
  200. - name: Create archives and upload
  201. shell: bash
  202. env:
  203. APPID: ${{ secrets.B2_APPID }}
  204. APPKEY: ${{ secrets.B2_APPKEY }}
  205. BUCKET: ${{ secrets.B2_BUCKET }}
  206. DAYS_TO_KEEP: ${{ secrets.B2_DAYS_TO_KEEP }}
  207. run: |
  208. file linux_artifacts/dist.tar.gz
  209. python3 ci/nightly.py artifact windows-amd64 windows_artifacts/
  210. python3 ci/nightly.py artifact linux-amd64 linux_artifacts/dist.tar.gz
  211. python3 ci/nightly.py artifact macos-amd64 macos_artifacts/dist.tar.gz
  212. python3 ci/nightly.py artifact macos-arm64 macos_arm_artifacts/dist.tar.gz
  213. python3 ci/nightly.py prune
  214. python3 ci/nightly.py json