1
0

main.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. name: build
  2. on: [push, pull_request]
  3. jobs:
  4. build_win:
  5. runs-on: windows-latest
  6. steps:
  7. - uses: actions/checkout@v3
  8. - uses: ilammy/msvc-dev-cmd@v1
  9. - name: Set up Clang
  10. uses: egor-tensin/setup-clang@v1
  11. with:
  12. version: 15
  13. platform: x64
  14. - name: Compiling
  15. shell: bash
  16. run: |
  17. clang-cl.exe -std:c++17 -GR- -EHsc -O2 -Wno-deprecated-declarations -stdlib=libc++ -Fe:pocketpy src/main.cpp
  18. echo '#include "pocketpy.h"' > src/tmp.cpp
  19. clang-cl.exe -std:c++17 -GR- -EHsc -O2 -Wno-deprecated-declarations -stdlib=libc++ -LD -Fe:pocketpy src/tmp.cpp
  20. python3 scripts/run_tests.py
  21. python3 scripts/run_tests.py benchmark
  22. mkdir -p output/windows/x86_64
  23. mv pocketpy.exe output/windows/x86_64
  24. mv pocketpy.dll output/windows/x86_64
  25. - uses: actions/upload-artifact@v3
  26. with:
  27. path: output
  28. build_web:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - uses: actions/checkout@v3
  32. - name: Setup emsdk
  33. uses: mymindstorm/setup-emsdk@v11
  34. with:
  35. version: 3.1.25
  36. actions-cache-folder: 'emsdk-cache'
  37. - name: Verify emsdk
  38. run: emcc -v
  39. - name: Compiling
  40. run: |
  41. mkdir -p output/web/lib
  42. bash build_wasm.sh
  43. cp web/lib/* output/web/lib
  44. - uses: crazy-max/ghaction-github-pages@v3
  45. with:
  46. target_branch: gh-pages
  47. build_dir: web
  48. env:
  49. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  50. if: github.event_name == 'push'
  51. - uses: actions/upload-artifact@v3
  52. with:
  53. path: output
  54. build_linux:
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v3
  58. - name: Set up Clang
  59. uses: egor-tensin/setup-clang@v1
  60. with:
  61. version: 15
  62. platform: x64
  63. - name: Compiling
  64. run: |
  65. bash build_cpp.sh
  66. bash build_linux.sh
  67. python3 scripts/run_tests.py
  68. python3 scripts/run_tests.py benchmark
  69. mkdir -p output/linux/x86_64
  70. mv pocketpy output/linux/x86_64
  71. mv pocketpy.so output/linux/x86_64
  72. - uses: actions/upload-artifact@v3
  73. with:
  74. path: output
  75. build_android:
  76. runs-on: ubuntu-latest
  77. steps:
  78. - uses: actions/checkout@v3
  79. - uses: subosito/flutter-action@v2
  80. with:
  81. flutter-version: '3.3.0'
  82. channel: 'stable'
  83. - run: flutter --version
  84. - name: Compiling
  85. run: |
  86. python3 amalgamate.py
  87. cd plugins/flutter/example
  88. flutter build apk --split-debug-info=.debug-info --split-per-abi
  89. cd build/app/outputs/flutter-apk
  90. mkdir -p output/android/arm64-v8a
  91. mkdir -p output/android/armeabi-v7a
  92. mkdir -p output/android/x86_64
  93. unzip -q app-arm64-v8a-release.apk -d tmp
  94. mv tmp/lib/arm64-v8a/libpocketpy.so output/android/arm64-v8a/libpocketpy.so
  95. rm -rf tmp
  96. unzip -q app-armeabi-v7a-release.apk -d tmp
  97. mv tmp/lib/armeabi-v7a/libpocketpy.so output/android/armeabi-v7a/libpocketpy.so
  98. rm -rf tmp
  99. unzip -q app-x86_64-release.apk -d tmp
  100. mv tmp/lib/x86_64/libpocketpy.so output/android/x86_64/libpocketpy.so
  101. rm -rf tmp
  102. - uses: actions/upload-artifact@v3
  103. with:
  104. path: plugins/flutter/example/build/app/outputs/flutter-apk/output
  105. build_macos:
  106. runs-on: macos-latest
  107. steps:
  108. - uses: actions/checkout@v3
  109. - run: |
  110. python3 amalgamate.py
  111. cd plugins/macos/pocketpy
  112. mkdir -p output/macos
  113. xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  114. cp -r build/Release/pocketpy.bundle output/macos
  115. - uses: actions/upload-artifact@v3
  116. with:
  117. path: plugins/macos/pocketpy/output