dylib.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. cd dylib
  17. xmake f -p windows -a x64
  18. xmake
  19. cp build/windows/x64/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