nightly.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. name: Nightly
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: 0 20 * * *
  6. jobs:
  7. build_windows:
  8. runs-on: windows-latest
  9. steps:
  10. - uses: actions/checkout@v1
  11. - name: build Odin
  12. shell: cmd
  13. run: |
  14. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
  15. ./build.bat 1 1
  16. - name: Odin run
  17. shell: cmd
  18. run: |
  19. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
  20. odin run examples/demo/demo.odin
  21. - name: Copy artifacts
  22. run: |
  23. rm bin/llvm/windows/LLVM-C.lib
  24. mkdir dist
  25. cp odin.exe dist
  26. cp LLVM-C.dll dist
  27. cp -r shared dist
  28. cp -r core dist
  29. cp -r bin dist
  30. cp -r examples dist
  31. - name: Upload artifact
  32. uses: actions/upload-artifact@v1
  33. with:
  34. name: windows_artifacts
  35. path: dist
  36. build_ubuntu:
  37. runs-on: ubuntu-latest
  38. steps:
  39. - uses: actions/checkout@v1
  40. - name: (Linux) Download LLVM
  41. run: sudo apt-get install llvm-11 clang-11 llvm
  42. - name: build odin
  43. run: make nightly
  44. - name: Odin run
  45. run: ./odin run examples/demo/demo.odin
  46. - name: Copy artifacts
  47. run: |
  48. mkdir dist
  49. cp odin dist
  50. cp -r shared dist
  51. cp -r core dist
  52. cp -r examples dist
  53. - name: Upload artifact
  54. uses: actions/upload-artifact@v1
  55. with:
  56. name: ubuntu_artifacts
  57. path: dist
  58. build_macos:
  59. runs-on: macOS-latest
  60. steps:
  61. - uses: actions/checkout@v1
  62. - name: Download LLVM and setup PATH
  63. run: |
  64. brew install llvm@11
  65. echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH
  66. TMP_PATH=$(xcrun --show-sdk-path)/user/include
  67. echo "CPATH=$TMP_PATH" >> $GITHUB_ENV
  68. - name: build odin
  69. run: make nightly
  70. - name: Odin run
  71. run: ./odin run examples/demo/demo.odin
  72. - name: Copy artifacts
  73. run: |
  74. mkdir dist
  75. cp odin dist
  76. cp -r shared dist
  77. cp -r core dist
  78. cp -r examples dist
  79. - name: Upload artifact
  80. uses: actions/upload-artifact@v1
  81. with:
  82. name: macos_artifacts
  83. path: dist
  84. upload_b2:
  85. runs-on: [ubuntu-latest]
  86. needs: [build_windows, build_macos, build_ubuntu]
  87. steps:
  88. - uses: actions/checkout@v1
  89. - uses: actions/setup-python@v2
  90. with:
  91. python-version: '3.x'
  92. - name: Install B2 CLI
  93. shell: bash
  94. run: |
  95. python -m pip install --upgrade pip
  96. pip install --upgrade b2
  97. - name: Display Python version
  98. run: python -c "import sys; print(sys.version)"
  99. - name: Download Windows artifacts
  100. uses: actions/download-artifact@v1
  101. with:
  102. name: windows_artifacts
  103. - name: Download Ubuntu artifacts
  104. uses: actions/download-artifact@v1
  105. with:
  106. name: ubuntu_artifacts
  107. - name: Download macOS artifacts
  108. uses: actions/download-artifact@v1
  109. with:
  110. name: macos_artifacts
  111. - name: Create archives and upload
  112. shell: bash
  113. env:
  114. APPID: ${{ secrets.B2_APPID }}
  115. APPKEY: ${{ secrets.B2_APPKEY }}
  116. BUCKET: ${{ secrets.B2_BUCKET }}
  117. DAYS_TO_KEEP: ${{ secrets.B2_DAYS_TO_KEEP }}
  118. run: |
  119. b2 authorize-account "$APPID" "$APPKEY"
  120. chmod +x ./ci/upload_create_nightly.sh
  121. ./ci/upload_create_nightly.sh "$BUCKET" windows-amd64 windows_artifacts/
  122. ./ci/upload_create_nightly.sh "$BUCKET" ubuntu-amd64 ubuntu_artifacts/
  123. ./ci/upload_create_nightly.sh "$BUCKET" macos-amd64 macos_artifacts/
  124. python3 ci/delete_old_binaries.py "$BUCKET" "$DAYS_TO_KEEP"
  125. python3 ci/create_nightly_json.py "$BUCKET" > nightly.json
  126. b2 upload-file "$BUCKET" nightly.json nightly.json
  127. b2 clear-account