dylib.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. name: build dylib
  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: Compile
  10. shell: powershell
  11. run: |
  12. Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
  13. mkdir -p output/windows/x86_64
  14. xmake f -y -p windows -a x64
  15. xmake build test
  16. cp build/windows/x64/release/test.dll output/windows/x86_64
  17. - uses: actions/upload-artifact@v3
  18. with:
  19. path: output
  20. build_linux_android:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - uses: actions/checkout@v3
  24. - name: Install xmake
  25. run: |
  26. wget https://xmake.io/shget.text -O - | bash
  27. xmake --version
  28. - name: Compile linux
  29. run: |
  30. mkdir -p output/linux/x86_64
  31. xmake f -y -p linux -a x86_64
  32. xmake build test
  33. cp build/linux/x86_64/release/libtest.so output/linux/x86_64
  34. - uses: android-actions/setup-android@v2
  35. - uses: nttld/setup-ndk@v1
  36. id: setup-ndk
  37. with:
  38. ndk-version: r25b
  39. add-to-path: false
  40. local-cache: true
  41. - name: Compile android
  42. run: |
  43. mkdir -p output/android/armeabi-v7a
  44. mkdir -p output/android/arm64-v8a
  45. xmake f -y -p android -a armeabi-v7a --ndk=$ANDROID_NDK_HOME
  46. xmake build test
  47. cp build/android/armeabi-v7a/release/libtest.so output/android/armeabi-v7a
  48. xmake f -y -p android -a arm64-v8a --ndk=$ANDROID_NDK_HOME
  49. xmake build test
  50. cp build/android/arm64-v8a/release/libtest.so output/android/arm64-v8a
  51. env:
  52. ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
  53. - uses: actions/upload-artifact@v3
  54. with:
  55. path: output
  56. build_macos:
  57. runs-on: macos-latest
  58. steps:
  59. - uses: actions/checkout@v3
  60. - name: Install xmake
  61. run: |
  62. wget https://xmake.io/shget.text -O - | bash
  63. source ~/.xmake/profile
  64. xmake --version
  65. - name: Compile
  66. run: |
  67. source ~/.xmake/profile
  68. mkdir -p output/macos/x86_64
  69. xmake f -y -p macosx -a x86_64
  70. xmake build test
  71. cp build/macosx/x86_64/release/libtest.dylib output/macos/x86_64
  72. - uses: actions/upload-artifact@v3
  73. with:
  74. path: output