dylib.yml 2.5 KB

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