dylib.yml 2.4 KB

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