debug.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. name: Debug build
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. - v5
  7. paths-ignore:
  8. - '**.md'
  9. - '.github/**'
  10. - '!.github/workflows/debug.yml'
  11. pull_request:
  12. branches:
  13. - dev
  14. - v5
  15. jobs:
  16. libcore:
  17. name: Native Build (LibCore)
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v2
  22. - name: Fetch Status
  23. run: git submodule status library/core > libcore_status
  24. - name: LibCore Cache
  25. id: cache
  26. uses: actions/cache@v2
  27. with:
  28. path: |
  29. app/libs/libcore.aar
  30. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  31. - name: Install Golang
  32. uses: actions/setup-go@v2
  33. if: steps.cache.outputs.cache-hit != 'true'
  34. with:
  35. go-version: 1.17.1
  36. - name: Native Build
  37. if: steps.cache.outputs.cache-hit != 'true'
  38. run: ./run lib core
  39. trojan-go:
  40. name: Native Build (Trojan-Go)
  41. runs-on: ubuntu-latest
  42. steps:
  43. - name: Checkout
  44. uses: actions/checkout@v2
  45. - name: Fetch Status
  46. run: git submodule status 'plugin/trojan-go/*' > trojan_go_status
  47. - name: Trojan-Go Cache
  48. id: cache
  49. uses: actions/cache@v2
  50. with:
  51. path: |
  52. plugin/trojan-go/src/main/jniLibs
  53. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/trojan_go/*', 'trojan_go_status') }}
  54. - name: Install Golang
  55. uses: actions/setup-go@v2
  56. if: steps.cache.outputs.cache-hit != 'true'
  57. with:
  58. go-version: 1.17.1
  59. - name: Native Build
  60. if: steps.cache.outputs.cache-hit != 'true'
  61. run: ./run plugin trojan_go
  62. naive:
  63. runs-on: ubuntu-latest
  64. name: Native Build (NaïveProxy)
  65. strategy:
  66. fail-fast: false
  67. matrix:
  68. arch: [ armeabi-v7a, arm64-v8a, x86, x86_64 ]
  69. steps:
  70. - name: Checkout
  71. uses: actions/checkout@v2
  72. - name: Fetch Status
  73. run: git submodule status 'plugin/naive/*' > naive_status
  74. - name: Naive Cache
  75. id: cache
  76. uses: actions/cache@v2
  77. with:
  78. path: |
  79. plugin/naive/src/main/jniLibs/${{ matrix.arch }}
  80. key: naive-${{ matrix.arch }}-${{ hashFiles('bin/plugin/naive/*', 'naive_status') }}
  81. - name: Native Build
  82. if: steps.cache.outputs.cache-hit != 'true'
  83. run: |
  84. ./run init action naive
  85. ./run plugin naive init
  86. ./run plugin naive ${{ matrix.arch }}
  87. - name: Calculate SHA256
  88. run: |
  89. openssl sha256 plugin/naive/src/main/jniLibs/${{ matrix.arch }}/libnaive.so > sha256sum.txt
  90. echo "SHA256SUM=$(cut -d' ' -f2 sha256sum.txt)" >>$GITHUB_ENV
  91. - uses: actions/upload-artifact@v2
  92. with:
  93. name: "NAIVE-SHA256-${{ matrix.arch }} ${{ env.SHA256SUM }}"
  94. path: sha256sum.txt
  95. pingtunnel:
  96. name: Native Build (PingTunnel)
  97. runs-on: ubuntu-latest
  98. steps:
  99. - name: Checkout
  100. uses: actions/checkout@v2
  101. - name: Fetch Status
  102. run: git submodule status 'plugin/pingtunnel/*' > pt_status
  103. - name: PingTunnel Cache
  104. id: cache
  105. uses: actions/cache@v2
  106. with:
  107. path: |
  108. plugin/pingtunnel/src/main/jniLibs
  109. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/pingtunnel/*', 'pt_status') }}
  110. - name: Install Golang
  111. uses: actions/setup-go@v2
  112. if: steps.cache.outputs.cache-hit != 'true'
  113. with:
  114. go-version: 1.16
  115. - name: Native Build
  116. if: steps.cache.outputs.cache-hit != 'true'
  117. run: ./run plugin pingtunnel
  118. relaybaton:
  119. name: Native Build (RelayBaton)
  120. runs-on: ubuntu-latest
  121. steps:
  122. - name: Checkout
  123. uses: actions/checkout@v2
  124. - name: Fetch Status
  125. run: git submodule status 'plugin/relaybaton/*' > rb_status
  126. - name: RelayBaton Cache
  127. id: cache
  128. uses: actions/cache@v2
  129. with:
  130. path: |
  131. plugin/relaybaton/src/main/jniLibs
  132. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/relaybaton/*', 'rb_status') }}
  133. - name: Install Golang
  134. uses: actions/setup-go@v2
  135. if: steps.cache.outputs.cache-hit != 'true'
  136. with:
  137. go-version: 1.16
  138. - name: Native Build
  139. if: steps.cache.outputs.cache-hit != 'true'
  140. run: ./run plugin relaybaton
  141. brook:
  142. name: Native Build (Brook)
  143. runs-on: ubuntu-latest
  144. steps:
  145. - name: Checkout
  146. uses: actions/checkout@v2
  147. - name: Fetch Status
  148. run: git submodule status 'plugin/brook/*' > brook_status
  149. - name: Brook Cache
  150. id: cache
  151. uses: actions/cache@v2
  152. with:
  153. path: |
  154. plugin/brook/src/main/jniLibs
  155. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/brook/*', 'brook_status') }}
  156. - name: Install Golang
  157. uses: actions/setup-go@v2
  158. if: steps.cache.outputs.cache-hit != 'true'
  159. with:
  160. go-version: 1.16
  161. - name: Native Build
  162. if: steps.cache.outputs.cache-hit != 'true'
  163. run: ./run plugin brook
  164. hysteria:
  165. name: Native Build (Hysteria)
  166. runs-on: ubuntu-latest
  167. steps:
  168. - name: Checkout
  169. uses: actions/checkout@v2
  170. - name: Fetch Status
  171. run: git submodule status 'plugin/hysteria/*' > hysteria_status
  172. - name: Hysteria Cache
  173. id: cache
  174. uses: actions/cache@v2
  175. with:
  176. path: |
  177. plugin/hysteria/src/main/jniLibs
  178. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/hysteria/*', 'hysteria_status') }}
  179. - name: Install Golang
  180. uses: actions/setup-go@v2
  181. if: steps.cache.outputs.cache-hit != 'true'
  182. with:
  183. go-version: 1.17.1
  184. - name: Native Build
  185. if: steps.cache.outputs.cache-hit != 'true'
  186. run: ./run plugin hysteria
  187. wireguard:
  188. name: Native Build (WireGuard)
  189. runs-on: ubuntu-latest
  190. steps:
  191. - name: Checkout
  192. uses: actions/checkout@v2
  193. - name: Fetch Status
  194. run: git submodule status 'plugin/wireguard/*' > wireguard_status
  195. - name: WireGuard Cache
  196. id: cache
  197. uses: actions/cache@v2
  198. with:
  199. path: |
  200. plugin/wireguard/src/main/jniLibs
  201. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/wireguard/*', 'wireguard_status') }}
  202. - name: Install Golang
  203. uses: actions/setup-go@v2
  204. if: steps.cache.outputs.cache-hit != 'true'
  205. with:
  206. go-version: 1.17.1
  207. - name: Native Build
  208. if: steps.cache.outputs.cache-hit != 'true'
  209. run: ./run plugin wireguard
  210. shadowsocks:
  211. name: Native Build (shadowsocks-rust)
  212. runs-on: ubuntu-latest
  213. steps:
  214. - name: Checkout
  215. uses: actions/checkout@v2
  216. - name: Fetch Status
  217. run: git submodule status 'library/shadowsocks/*' > shadowsocks_status
  218. - name: Shadowsocks Cache
  219. id: cache
  220. uses: actions/cache@v2
  221. with:
  222. path: |
  223. app/libs/shadowsocks.aar
  224. key: ${{ hashFiles('gradle/**', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }}
  225. - name: Install Rust
  226. if: steps.cache.outputs.cache-hit != 'true'
  227. run: ./run init action shadowsocks
  228. - name: Gradle cache
  229. uses: actions/cache@v2
  230. if: steps.cache.outputs.cache-hit != 'true'
  231. with:
  232. path: ~/.gradle
  233. key: native-${{ hashFiles('**/*.gradle.kts') }}
  234. - name: Native Build
  235. if: steps.cache.outputs.cache-hit != 'true'
  236. env:
  237. BUILD_PLUGIN: none
  238. run: |
  239. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  240. echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
  241. ./run init action library
  242. ./run lib shadowsocks
  243. shadowsocks_libev:
  244. name: Native Build (shadowsocks-libev)
  245. runs-on: ubuntu-latest
  246. steps:
  247. - name: Checkout
  248. uses: actions/checkout@v2
  249. - name: Fetch Status
  250. run: git submodule status 'library/shadowsocks-libev/*' > shadowsocks_status
  251. - name: shadowsocks-libev Cache
  252. id: cache
  253. uses: actions/cache@v2
  254. with:
  255. path: |
  256. app/libs/shadowsocks-libev.aar
  257. key: ${{ hashFiles('gradle/**', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_status') }}
  258. - name: Gradle cache
  259. uses: actions/cache@v2
  260. if: steps.cache.outputs.cache-hit != 'true'
  261. with:
  262. path: ~/.gradle
  263. key: native-${{ hashFiles('**/*.gradle.kts') }}
  264. - name: Native Build
  265. if: steps.cache.outputs.cache-hit != 'true'
  266. env:
  267. BUILD_PLUGIN: none
  268. run: |
  269. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  270. echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
  271. ./run init action library
  272. ./run lib shadowsocks_libev
  273. build:
  274. name: Gradle Build
  275. runs-on: ubuntu-latest
  276. needs:
  277. - libcore
  278. - shadowsocks
  279. - shadowsocks_libev
  280. steps:
  281. - name: Checkout
  282. uses: actions/checkout@v2
  283. - name: Fetch Status
  284. run: |
  285. git submodule status 'library/shadowsocks/*' > shadowsocks_status
  286. git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status
  287. git submodule status library/core > libcore_status
  288. - name: LibCore Cache
  289. uses: actions/cache@v2
  290. with:
  291. path: |
  292. app/libs/libcore.aar
  293. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  294. - name: Shadowsocks Cache
  295. uses: actions/cache@v2
  296. with:
  297. path: |
  298. app/libs/shadowsocks.aar
  299. key: ${{ hashFiles('library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }}
  300. - name: Shadowsocks (libev) Cache
  301. uses: actions/cache@v2
  302. with:
  303. path: |
  304. app/libs/shadowsocks-libev.aar
  305. key: ${{ hashFiles('library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }}
  306. - name: Gradle cache
  307. uses: actions/cache@v2
  308. with:
  309. path: ~/.gradle
  310. key: gradle-${{ hashFiles('**/*.gradle.kts') }}
  311. - name: Debug Build
  312. env:
  313. BUILD_PLUGIN: none
  314. run: |
  315. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  316. echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
  317. ./run init action library
  318. ./gradlew app:assembleOssDebug