.drone.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. kind: pipeline
  2. type: docker
  3. name: clippy
  4. platform:
  5. arch: amd64
  6. clone:
  7. disable: true
  8. steps:
  9. - name: clone
  10. image: alpine/git:latest
  11. user: root
  12. commands:
  13. - git clone $DRONE_GIT_HTTP_URL .
  14. - git checkout $DRONE_COMMIT
  15. - chown -R 991:991 .
  16. - name: clippy
  17. image: asonix/rust-builder:latest-linux-amd64
  18. pull: always
  19. commands:
  20. - rustup component add clippy
  21. - cargo clippy --no-deps -- -D warnings
  22. trigger:
  23. event:
  24. - push
  25. - pull_request
  26. - tag
  27. ---
  28. kind: pipeline
  29. type: docker
  30. name: tests
  31. platform:
  32. arch: amd64
  33. clone:
  34. disable: true
  35. steps:
  36. - name: clone
  37. image: alpine/git:latest
  38. user: root
  39. commands:
  40. - git clone $DRONE_GIT_HTTP_URL .
  41. - git checkout $DRONE_COMMIT
  42. - chown -R 991:991 .
  43. - name: tests
  44. image: asonix/rust-builder:latest-linux-amd64
  45. pull: always
  46. commands:
  47. - cargo test
  48. trigger:
  49. event:
  50. - push
  51. - pull_request
  52. - tag
  53. ---
  54. kind: pipeline
  55. type: docker
  56. name: check-amd64
  57. platform:
  58. arch: amd64
  59. clone:
  60. disable: true
  61. steps:
  62. - name: clone
  63. image: alpine/git:latest
  64. user: root
  65. commands:
  66. - git clone $DRONE_GIT_HTTP_URL .
  67. - git checkout $DRONE_COMMIT
  68. - chown -R 991:991 .
  69. - name: check
  70. image: asonix/rust-builder:latest-linux-amd64
  71. pull: always
  72. commands:
  73. - cargo check --target=$TARGET
  74. trigger:
  75. event:
  76. - push
  77. - pull_request
  78. ---
  79. kind: pipeline
  80. type: docker
  81. name: build-amd64
  82. platform:
  83. arch: amd64
  84. clone:
  85. disable: true
  86. steps:
  87. - name: clone
  88. image: alpine/git:latest
  89. user: root
  90. commands:
  91. - git clone $DRONE_GIT_HTTP_URL .
  92. - git checkout $DRONE_COMMIT
  93. - chown -R 991:991 .
  94. - name: build
  95. image: asonix/rust-builder:latest-linux-amd64
  96. pull: always
  97. commands:
  98. - cargo build --target=$TARGET --release
  99. - $TOOL-strip target/$TARGET/release/relay
  100. - cp target/$TARGET/release/relay .
  101. - cp relay relay-linux-amd64
  102. - name: push
  103. image: plugins/docker:20
  104. settings:
  105. username: asonix
  106. password:
  107. from_secret: dockerhub_token
  108. repo: asonix/relay
  109. dockerfile: docker/drone/Dockerfile
  110. auto_tag: true
  111. auto_tag_suffix: linux-amd64
  112. build_args:
  113. - REPO_ARCH=amd64
  114. - name: publish
  115. image: plugins/gitea-release:1
  116. settings:
  117. api_key:
  118. from_secret: gitea_token
  119. base_url: https://git.asonix.dog
  120. files:
  121. - relay-linux-amd64
  122. depends_on:
  123. - clippy
  124. - tests
  125. trigger:
  126. event:
  127. - tag
  128. ---
  129. kind: pipeline
  130. type: docker
  131. name: check-arm64v8
  132. platform:
  133. arch: amd64
  134. clone:
  135. disable: true
  136. steps:
  137. - name: clone
  138. image: alpine/git:latest
  139. user: root
  140. commands:
  141. - git clone $DRONE_GIT_HTTP_URL .
  142. - git checkout $DRONE_COMMIT
  143. - chown -R 991:991 .
  144. - name: check
  145. image: asonix/rust-builder:latest-linux-arm64v8
  146. pull: always
  147. commands:
  148. - cargo check --target=$TARGET
  149. trigger:
  150. event:
  151. - push
  152. - pull_request
  153. ---
  154. kind: pipeline
  155. type: docker
  156. name: build-arm64v8
  157. platform:
  158. arch: amd64
  159. clone:
  160. disable: true
  161. steps:
  162. - name: clone
  163. image: alpine/git:latest
  164. user: root
  165. commands:
  166. - git clone $DRONE_GIT_HTTP_URL .
  167. - git checkout $DRONE_COMMIT
  168. - chown -R 991:991 .
  169. - name: build
  170. image: asonix/rust-builder:latest-linux-arm64v8
  171. pull: always
  172. commands:
  173. - cargo build --target=$TARGET --release
  174. - $TOOL-strip target/$TARGET/release/relay
  175. - cp target/$TARGET/release/relay .
  176. - cp relay relay-linux-arm64v8
  177. - name: push
  178. image: plugins/docker:20
  179. settings:
  180. username: asonix
  181. password:
  182. from_secret: dockerhub_token
  183. repo: asonix/relay
  184. dockerfile: docker/drone/Dockerfile
  185. auto_tag: true
  186. auto_tag_suffix: linux-arm64v8
  187. build_args:
  188. - REPO_ARCH=arm64v8
  189. - name: publish
  190. image: plugins/gitea-release:1
  191. settings:
  192. api_key:
  193. from_secret: gitea_token
  194. base_url: https://git.asonix.dog
  195. files:
  196. - relay-linux-arm64v8
  197. depends_on:
  198. - clippy
  199. - tests
  200. trigger:
  201. event:
  202. - tag
  203. ---
  204. kind: pipeline
  205. type: docker
  206. name: check-arm32v7
  207. platform:
  208. arch: amd64
  209. clone:
  210. disable: true
  211. steps:
  212. - name: clone
  213. image: alpine/git:latest
  214. user: root
  215. commands:
  216. - git clone $DRONE_GIT_HTTP_URL .
  217. - git checkout $DRONE_COMMIT
  218. - chown -R 991:991 .
  219. - name: check
  220. image: asonix/rust-builder:latest-linux-arm32v7
  221. pull: always
  222. commands:
  223. - cargo check --target=$TARGET
  224. trigger:
  225. event:
  226. - push
  227. - pull_request
  228. ---
  229. kind: pipeline
  230. type: docker
  231. name: build-arm32v7
  232. platform:
  233. arch: amd64
  234. clone:
  235. disable: true
  236. steps:
  237. - name: clone
  238. image: alpine/git:latest
  239. user: root
  240. commands:
  241. - git clone $DRONE_GIT_HTTP_URL .
  242. - git checkout $DRONE_COMMIT
  243. - chown -R 991:991 .
  244. - name: build
  245. image: asonix/rust-builder:latest-linux-arm32v7
  246. pull: always
  247. commands:
  248. - cargo build --target=$TARGET --release
  249. - $TOOL-strip target/$TARGET/release/relay
  250. - cp target/$TARGET/release/relay .
  251. - cp relay relay-linux-arm32v7
  252. - name: push
  253. image: plugins/docker:20
  254. settings:
  255. username: asonix
  256. password:
  257. from_secret: dockerhub_token
  258. repo: asonix/relay
  259. dockerfile: docker/drone/Dockerfile
  260. auto_tag: true
  261. auto_tag_suffix: linux-arm32v7
  262. build_args:
  263. - REPO_ARCH=arm32v7
  264. - name: publish
  265. image: plugins/gitea-release:1
  266. settings:
  267. api_key:
  268. from_secret: gitea_token
  269. base_url: https://git.asonix.dog
  270. files:
  271. - relay-linux-arm32v7
  272. depends_on:
  273. - clippy
  274. - tests
  275. trigger:
  276. event:
  277. - tag
  278. ---
  279. kind: pipeline
  280. type: docker
  281. name: manifest
  282. platform:
  283. arch: amd64
  284. clone:
  285. disable: true
  286. steps:
  287. - name: clone
  288. image: alpine/git:latest
  289. user: root
  290. commands:
  291. - git clone $DRONE_GIT_HTTP_URL .
  292. - git checkout $DRONE_COMMIT
  293. - chown -R 991:991 .
  294. - name: manifest
  295. image: plugins/manifest:1
  296. settings:
  297. username: asonix
  298. password:
  299. from_secret: dockerhub_token
  300. dump: true
  301. auto_tag: true
  302. ignore_missing: true
  303. spec: docker/drone/manifest.tmpl
  304. depends_on:
  305. - build-amd64
  306. - build-arm64v8
  307. - build-arm32v7
  308. trigger:
  309. event:
  310. - tag
  311. ---
  312. kind: pipeline
  313. type: docker
  314. name: publish-crate
  315. platform:
  316. arch: amd64
  317. clone:
  318. disable: true
  319. steps:
  320. - name: clone
  321. image: alpine/git:latest
  322. user: root
  323. commands:
  324. - git clone $DRONE_GIT_HTTP_URL .
  325. - git checkout $DRONE_COMMIT
  326. - chown -R 991:991 .
  327. - name: publish
  328. image: asonix/rust-builder:latest-linux-amd64
  329. pull: always
  330. environment:
  331. CRATES_IO_TOKEN:
  332. from_secret: crates_io_token
  333. commands:
  334. - cargo publish --token $CRATES_IO_TOKEN
  335. depends_on:
  336. - build-amd64
  337. - build-arm64v8
  338. - build-arm32v7
  339. trigger:
  340. event:
  341. - tag