dylib.yml 2.4 KB

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