dylib.yml 2.3 KB

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