nightly.yml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. - name: (Linux) Download LLVM and Build Odin
  49. run: |
  50. docker run --rm -v "$PWD:/src" -w /src alpine sh -c '
  51. apk add --no-cache \
  52. musl-dev llvm20-dev clang20 git mold lz4 \
  53. libxml2-static llvm20-static zlib-static zstd-static \
  54. make &&
  55. ./ci/build_linux_static.sh
  56. '
  57. - name: Odin run
  58. run: ./odin run examples/demo
  59. - name: Copy artifacts
  60. run: |
  61. FILE="odin-linux-amd64-nightly+$(date -I)"
  62. mkdir $FILE
  63. cp odin $FILE
  64. cp LICENSE $FILE
  65. cp -r shared $FILE
  66. cp -r base $FILE
  67. cp -r core $FILE
  68. cp -r vendor $FILE
  69. cp -r examples $FILE
  70. ./ci/remove_windows_binaries.sh $FILE
  71. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  72. tar -czvf dist.tar.gz $FILE
  73. - name: Odin run
  74. run: |
  75. FILE="odin-linux-amd64-nightly+$(date -I)"
  76. $FILE/odin run examples/demo
  77. - name: Upload artifact
  78. uses: actions/upload-artifact@v4
  79. with:
  80. name: linux_artifacts
  81. path: dist.tar.gz
  82. build_linux_arm:
  83. name: Linux ARM Build
  84. if: github.repository == 'odin-lang/Odin'
  85. runs-on: ubuntu-24.04-arm
  86. steps:
  87. - uses: actions/checkout@v4
  88. - name: (Linux ARM) Download LLVM and Build Odin
  89. run: |
  90. docker run --rm -v "$PWD:/src" -w /src arm64v8/alpine sh -c '
  91. apk add --no-cache \
  92. musl-dev llvm20-dev clang20 git mold lz4 \
  93. libxml2-static llvm20-static zlib-static zstd-static \
  94. make &&
  95. ./ci/build_linux_static.sh
  96. '
  97. - name: Odin run
  98. run: ./odin run examples/demo
  99. - name: Copy artifacts
  100. run: |
  101. FILE="odin-linux-arm64-nightly+$(date -I)"
  102. mkdir $FILE
  103. cp odin $FILE
  104. cp LICENSE $FILE
  105. cp -r shared $FILE
  106. cp -r base $FILE
  107. cp -r core $FILE
  108. cp -r vendor $FILE
  109. cp -r examples $FILE
  110. ./ci/remove_windows_binaries.sh $FILE
  111. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  112. tar -czvf dist.tar.gz $FILE
  113. - name: Odin run
  114. run: |
  115. FILE="odin-linux-arm64-nightly+$(date -I)"
  116. $FILE/odin run examples/demo
  117. - name: Upload artifact
  118. uses: actions/upload-artifact@v4
  119. with:
  120. name: linux_arm_artifacts
  121. path: dist.tar.gz
  122. build_macos:
  123. name: MacOS Build
  124. if: github.repository == 'odin-lang/Odin'
  125. runs-on: macos-13
  126. steps:
  127. - uses: actions/checkout@v4
  128. - name: Download LLVM and setup PATH
  129. run: |
  130. brew update
  131. brew install llvm@20 dylibbundler lld
  132. - name: build odin
  133. # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to
  134. # not link with libunwind bundled with LLVM but link with libunwind on the system.
  135. run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly
  136. - name: Bundle
  137. run: |
  138. FILE="odin-macos-amd64-nightly+$(date -I)"
  139. mkdir $FILE
  140. cp odin $FILE
  141. cp LICENSE $FILE
  142. cp -r shared $FILE
  143. cp -r base $FILE
  144. cp -r core $FILE
  145. cp -r vendor $FILE
  146. cp -r examples $FILE
  147. ./ci/remove_windows_binaries.sh $FILE
  148. dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs
  149. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  150. tar -czvf dist.tar.gz $FILE
  151. - name: Odin run
  152. run: |
  153. FILE="odin-macos-amd64-nightly+$(date -I)"
  154. $FILE/odin run examples/demo
  155. - name: Upload artifact
  156. uses: actions/upload-artifact@v4
  157. with:
  158. name: macos_artifacts
  159. path: dist.tar.gz
  160. build_macos_arm:
  161. name: MacOS ARM Build
  162. if: github.repository == 'odin-lang/Odin'
  163. runs-on: macos-14 # ARM machine
  164. steps:
  165. - uses: actions/checkout@v4
  166. - name: Download LLVM and setup PATH
  167. run: |
  168. brew update
  169. brew install llvm@20 dylibbundler lld
  170. - name: build odin
  171. # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to
  172. # not link with libunwind bundled with LLVM but link with libunwind on the system.
  173. run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly
  174. - name: Bundle
  175. run: |
  176. FILE="odin-macos-arm64-nightly+$(date -I)"
  177. mkdir $FILE
  178. cp odin $FILE
  179. cp LICENSE $FILE
  180. cp -r shared $FILE
  181. cp -r base $FILE
  182. cp -r core $FILE
  183. cp -r vendor $FILE
  184. cp -r examples $FILE
  185. ./ci/remove_windows_binaries.sh $FILE
  186. dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs
  187. # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38
  188. tar -czvf dist.tar.gz $FILE
  189. - name: Odin run
  190. run: |
  191. FILE="odin-macos-arm64-nightly+$(date -I)"
  192. $FILE/odin run examples/demo
  193. - name: Upload artifact
  194. uses: actions/upload-artifact@v4
  195. with:
  196. name: macos_arm_artifacts
  197. path: dist.tar.gz
  198. upload_b2:
  199. runs-on: [ubuntu-latest]
  200. needs: [build_windows, build_macos, build_macos_arm, build_linux, build_linux_arm]
  201. steps:
  202. - uses: actions/checkout@v4
  203. - uses: actions/setup-python@v5
  204. with:
  205. python-version: '3.8.x'
  206. - name: Install B2 SDK
  207. shell: bash
  208. run: |
  209. python -m pip install --upgrade pip
  210. pip install --upgrade b2sdk
  211. - name: Display Python version
  212. run: python -c "import sys; print(sys.version)"
  213. - name: Download Windows artifacts
  214. uses: actions/[email protected]
  215. with:
  216. name: windows_artifacts
  217. path: windows_artifacts
  218. - name: Download Ubuntu artifacts
  219. uses: actions/[email protected]
  220. with:
  221. name: linux_artifacts
  222. path: linux_artifacts
  223. - name: Download Ubuntu ARM artifacts
  224. uses: actions/[email protected]
  225. with:
  226. name: linux_arm_artifacts
  227. path: linux_arm_artifacts
  228. - name: Download macOS artifacts
  229. uses: actions/[email protected]
  230. with:
  231. name: macos_artifacts
  232. path: macos_artifacts
  233. - name: Download macOS arm artifacts
  234. uses: actions/[email protected]
  235. with:
  236. name: macos_arm_artifacts
  237. path: macos_arm_artifacts
  238. - name: Debug
  239. run: |
  240. tree -L 2
  241. - name: Create archives and upload
  242. shell: bash
  243. env:
  244. APPID: ${{ secrets.B2_APPID }}
  245. APPKEY: ${{ secrets.B2_APPKEY }}
  246. BUCKET: ${{ secrets.B2_BUCKET }}
  247. DAYS_TO_KEEP: ${{ secrets.B2_DAYS_TO_KEEP }}
  248. run: |
  249. file linux_artifacts/dist.tar.gz
  250. python3 ci/nightly.py artifact windows-amd64 windows_artifacts/
  251. python3 ci/nightly.py artifact linux-amd64 linux_artifacts/dist.tar.gz
  252. python3 ci/nightly.py artifact linux-arm64 linux_arm_artifacts/dist.tar.gz
  253. python3 ci/nightly.py artifact macos-amd64 macos_artifacts/dist.tar.gz
  254. python3 ci/nightly.py artifact macos-arm64 macos_arm_artifacts/dist.tar.gz
  255. python3 ci/nightly.py prune
  256. python3 ci/nightly.py json