dylib.yml 2.4 KB

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