You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 31KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507
  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: compliance
  5. platform:
  6. os: linux
  7. arch: amd64
  8. trigger:
  9. event:
  10. - push
  11. - tag
  12. - pull_request
  13. volumes:
  14. - name: deps
  15. temp: {}
  16. steps:
  17. - name: deps-frontend
  18. image: node:18
  19. pull: always
  20. commands:
  21. - make deps-frontend
  22. - name: deps-backend
  23. image: golang:1.19
  24. pull: always
  25. commands:
  26. - make deps-backend
  27. volumes:
  28. - name: deps
  29. path: /go
  30. - name: lint-frontend
  31. image: node:18
  32. commands:
  33. - make lint-frontend
  34. depends_on: [deps-frontend]
  35. - name: lint-backend
  36. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  37. pull: always
  38. commands:
  39. - make lint-backend
  40. environment:
  41. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  42. GOSUMDB: sum.golang.org
  43. TAGS: bindata sqlite sqlite_unlock_notify
  44. depends_on: [deps-backend]
  45. volumes:
  46. - name: deps
  47. path: /go
  48. - name: lint-backend-windows
  49. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  50. commands:
  51. - make golangci-lint-windows vet
  52. environment:
  53. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  54. GOSUMDB: sum.golang.org
  55. TAGS: bindata sqlite sqlite_unlock_notify
  56. GOOS: windows
  57. GOARCH: amd64
  58. depends_on: [deps-backend]
  59. volumes:
  60. - name: deps
  61. path: /go
  62. - name: lint-backend-gogit
  63. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  64. commands:
  65. - make lint-backend
  66. environment:
  67. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  68. GOSUMDB: sum.golang.org
  69. TAGS: bindata gogit sqlite sqlite_unlock_notify
  70. depends_on: [deps-backend]
  71. volumes:
  72. - name: deps
  73. path: /go
  74. - name: checks-frontend
  75. image: node:18
  76. commands:
  77. - make checks-frontend
  78. depends_on: [deps-frontend]
  79. - name: checks-backend
  80. image: golang:1.19
  81. commands:
  82. - make --always-make checks-backend # ensure the 'go-licenses' make target runs
  83. depends_on: [deps-backend]
  84. volumes:
  85. - name: deps
  86. path: /go
  87. - name: test-frontend
  88. image: node:18
  89. commands:
  90. - make test-frontend
  91. depends_on: [lint-frontend]
  92. - name: build-frontend
  93. image: node:18
  94. commands:
  95. - make frontend
  96. depends_on: [deps-frontend]
  97. - name: build-backend-no-gcc
  98. image: golang:1.18 # this step is kept as the lowest version of golang that we support
  99. pull: always
  100. environment:
  101. GO111MODULE: on
  102. GOPROXY: https://goproxy.io
  103. commands:
  104. - go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  105. depends_on: [deps-backend, checks-backend]
  106. volumes:
  107. - name: deps
  108. path: /go
  109. - name: build-backend-arm64
  110. image: golang:1.19
  111. environment:
  112. GO111MODULE: on
  113. GOPROXY: https://goproxy.io
  114. GOOS: linux
  115. GOARCH: arm64
  116. TAGS: bindata gogit
  117. commands:
  118. - make backend # test cross compile
  119. - rm ./gitea # clean
  120. depends_on: [deps-backend, checks-backend]
  121. volumes:
  122. - name: deps
  123. path: /go
  124. - name: build-backend-windows
  125. image: golang:1.19
  126. environment:
  127. GO111MODULE: on
  128. GOPROXY: https://goproxy.io
  129. GOOS: windows
  130. GOARCH: amd64
  131. TAGS: bindata gogit
  132. commands:
  133. - go build -o gitea_windows
  134. depends_on: [deps-backend, checks-backend]
  135. volumes:
  136. - name: deps
  137. path: /go
  138. - name: build-backend-386
  139. image: golang:1.19
  140. environment:
  141. GO111MODULE: on
  142. GOPROXY: https://goproxy.io
  143. GOOS: linux
  144. GOARCH: 386
  145. commands:
  146. - go build -o gitea_linux_386 # test if compatible with 32 bit
  147. depends_on: [deps-backend, checks-backend]
  148. volumes:
  149. - name: deps
  150. path: /go
  151. ---
  152. kind: pipeline
  153. type: docker
  154. name: testing-amd64
  155. platform:
  156. os: linux
  157. arch: amd64
  158. depends_on:
  159. - compliance
  160. trigger:
  161. event:
  162. - push
  163. - tag
  164. - pull_request
  165. volumes:
  166. - name: deps
  167. temp: {}
  168. services:
  169. - name: mysql
  170. image: mysql:5.7
  171. pull: always
  172. environment:
  173. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  174. MYSQL_DATABASE: test
  175. - name: mysql8
  176. image: mysql:8
  177. pull: always
  178. environment:
  179. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  180. MYSQL_DATABASE: testgitea
  181. - name: mssql
  182. image: mcr.microsoft.com/mssql/server:latest
  183. pull: always
  184. environment:
  185. ACCEPT_EULA: Y
  186. MSSQL_PID: Standard
  187. SA_PASSWORD: MwantsaSecurePassword1
  188. - name: ldap
  189. image: gitea/test-openldap:latest
  190. pull: always
  191. - name: elasticsearch
  192. image: elasticsearch:7.5.0
  193. pull: always
  194. environment:
  195. discovery.type: single-node
  196. - name: minio
  197. image: minio/minio:RELEASE.2021-03-12T00-00-47Z
  198. pull: always
  199. commands:
  200. - minio server /data
  201. environment:
  202. MINIO_ACCESS_KEY: 123456
  203. MINIO_SECRET_KEY: 12345678
  204. steps:
  205. - name: fetch-tags
  206. image: docker:git
  207. pull: always
  208. commands:
  209. - git config --global --add safe.directory /drone/src
  210. - git fetch --tags --force
  211. when:
  212. event:
  213. exclude:
  214. - pull_request
  215. - name: deps-backend
  216. image: golang:1.19
  217. pull: always
  218. commands:
  219. - make deps-backend
  220. volumes:
  221. - name: deps
  222. path: /go
  223. - name: tag-pre-condition
  224. image: drone/git
  225. pull: always
  226. commands:
  227. - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
  228. - name: prepare-test-env
  229. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  230. pull: always
  231. commands:
  232. - ./build/test-env-prepare.sh
  233. - name: build
  234. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  235. user: gitea
  236. commands:
  237. - ./build/test-env-check.sh
  238. - make backend
  239. environment:
  240. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  241. GOSUMDB: sum.golang.org
  242. TAGS: bindata sqlite sqlite_unlock_notify
  243. depends_on: [deps-backend, prepare-test-env]
  244. volumes:
  245. - name: deps
  246. path: /go
  247. - name: unit-test
  248. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  249. user: gitea
  250. commands:
  251. - make unit-test-coverage test-check
  252. environment:
  253. GOPROXY: https://goproxy.io
  254. TAGS: bindata sqlite sqlite_unlock_notify
  255. RACE_ENABLED: true
  256. GITHUB_READ_TOKEN:
  257. from_secret: github_read_token
  258. depends_on: [deps-backend, prepare-test-env]
  259. volumes:
  260. - name: deps
  261. path: /go
  262. - name: unit-test-gogit
  263. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  264. user: gitea
  265. commands:
  266. - make unit-test-coverage test-check
  267. environment:
  268. GOPROXY: https://goproxy.io
  269. TAGS: bindata gogit sqlite sqlite_unlock_notify
  270. RACE_ENABLED: true
  271. GITHUB_READ_TOKEN:
  272. from_secret: github_read_token
  273. depends_on: [deps-backend, prepare-test-env]
  274. volumes:
  275. - name: deps
  276. path: /go
  277. - name: test-mysql
  278. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  279. user: gitea
  280. commands:
  281. - make test-mysql-migration integration-test-coverage
  282. environment:
  283. GOPROXY: https://goproxy.io
  284. TAGS: bindata
  285. RACE_ENABLED: true
  286. TEST_LDAP: 1
  287. USE_REPO_TEST_DIR: 1
  288. TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
  289. depends_on: [build]
  290. volumes:
  291. - name: deps
  292. path: /go
  293. - name: test-mysql8
  294. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  295. user: gitea
  296. commands:
  297. - timeout -s ABRT 50m make test-mysql8-migration test-mysql8
  298. environment:
  299. GOPROXY: https://goproxy.io
  300. TAGS: bindata
  301. RACE_ENABLED: true
  302. TEST_LDAP: 1
  303. USE_REPO_TEST_DIR: 1
  304. depends_on: [build]
  305. volumes:
  306. - name: deps
  307. path: /go
  308. - name: test-mssql
  309. image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
  310. user: gitea
  311. commands:
  312. - make test-mssql-migration test-mssql
  313. environment:
  314. GOPROXY: https://goproxy.io
  315. TAGS: bindata
  316. RACE_ENABLED: true
  317. TEST_LDAP: 1
  318. USE_REPO_TEST_DIR: 1
  319. depends_on: [build]
  320. volumes:
  321. - name: deps
  322. path: /go
  323. - name: generate-coverage
  324. image: golang:1.19
  325. commands:
  326. - make coverage
  327. environment:
  328. GOPROXY: https://goproxy.io
  329. TAGS: bindata
  330. depends_on: [unit-test, test-mysql]
  331. when:
  332. branch:
  333. - main
  334. event:
  335. - push
  336. - pull_request
  337. - name: coverage-codecov
  338. image: woodpeckerci/plugin-codecov:next-alpine
  339. pull: always
  340. settings:
  341. files:
  342. - coverage.all
  343. token:
  344. from_secret: codecov_token
  345. depends_on: [generate-coverage]
  346. when:
  347. branch:
  348. - main
  349. event:
  350. - push
  351. - pull_request
  352. ---
  353. kind: pipeline
  354. name: testing-arm64
  355. platform:
  356. os: linux
  357. arch: arm64
  358. depends_on:
  359. - compliance
  360. trigger:
  361. event:
  362. - push
  363. - tag
  364. - pull_request
  365. volumes:
  366. - name: deps
  367. temp: {}
  368. services:
  369. - name: pgsql
  370. pull: default
  371. image: postgres:10
  372. environment:
  373. POSTGRES_DB: test
  374. POSTGRES_PASSWORD: postgres
  375. - name: ldap
  376. pull: default
  377. image: gitea/test-openldap:latest
  378. steps:
  379. - name: fetch-tags
  380. image: docker:git
  381. pull: always
  382. commands:
  383. - git config --global --add safe.directory /drone/src
  384. - git fetch --tags --force
  385. when:
  386. event:
  387. exclude:
  388. - pull_request
  389. - name: deps-backend
  390. image: golang:1.19
  391. pull: always
  392. commands:
  393. - make deps-backend
  394. volumes:
  395. - name: deps
  396. path: /go
  397. - name: prepare-test-env
  398. image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
  399. pull: always
  400. commands:
  401. - ./build/test-env-prepare.sh
  402. - name: build
  403. image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
  404. user: gitea
  405. commands:
  406. - ./build/test-env-check.sh
  407. - make backend
  408. environment:
  409. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  410. GOSUMDB: sum.golang.org
  411. TAGS: bindata gogit sqlite sqlite_unlock_notify
  412. depends_on: [deps-backend, prepare-test-env]
  413. volumes:
  414. - name: deps
  415. path: /go
  416. - name: test-sqlite
  417. image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
  418. user: gitea
  419. commands:
  420. - timeout -s ABRT 50m make test-sqlite-migration test-sqlite
  421. environment:
  422. GOPROXY: https://goproxy.io
  423. TAGS: bindata gogit sqlite sqlite_unlock_notify
  424. RACE_ENABLED: true
  425. TEST_TAGS: gogit sqlite sqlite_unlock_notify
  426. USE_REPO_TEST_DIR: 1
  427. depends_on: [build]
  428. volumes:
  429. - name: deps
  430. path: /go
  431. - name: test-pgsql
  432. image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
  433. user: gitea
  434. commands:
  435. - timeout -s ABRT 50m make test-pgsql-migration test-pgsql
  436. environment:
  437. GOPROXY: https://goproxy.io
  438. TAGS: bindata gogit
  439. RACE_ENABLED: true
  440. TEST_TAGS: gogit
  441. TEST_LDAP: 1
  442. USE_REPO_TEST_DIR: 1
  443. depends_on: [build]
  444. volumes:
  445. - name: deps
  446. path: /go
  447. ---
  448. kind: pipeline
  449. type: docker
  450. name: testing-e2e
  451. platform:
  452. os: linux
  453. arch: amd64
  454. depends_on:
  455. - compliance
  456. trigger:
  457. event:
  458. - pull_request
  459. volumes:
  460. - name: deps
  461. temp: {}
  462. services:
  463. - name: pgsql
  464. pull: default
  465. image: postgres:10
  466. environment:
  467. POSTGRES_DB: testgitea-e2e
  468. POSTGRES_PASSWORD: postgres
  469. POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'
  470. steps:
  471. - name: deps-frontend
  472. image: node:18
  473. pull: always
  474. commands:
  475. - make deps-frontend
  476. - name: build-frontend
  477. image: node:18
  478. commands:
  479. - make frontend
  480. depends_on: [deps-frontend]
  481. - name: deps-backend
  482. image: golang:1.18
  483. pull: always
  484. commands:
  485. - make deps-backend
  486. volumes:
  487. - name: deps
  488. path: /go
  489. # TODO: We should probably build all dependencies into a test image
  490. - name: test-e2e
  491. image: mcr.microsoft.com/playwright:v1.28.0-focal
  492. commands:
  493. - curl -sLO https://go.dev/dl/go1.19.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
  494. - groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
  495. - apt-get -qq update && apt-get -qqy install build-essential
  496. - export TEST_PGSQL_SCHEMA=''
  497. - ./build/test-env-prepare.sh
  498. - su gitea bash -c "export PATH=$PATH:/usr/local/go/bin && timeout -s ABRT 40m make test-e2e-pgsql"
  499. environment:
  500. GOPROXY: https://goproxy.io
  501. GOSUMDB: sum.golang.org
  502. USE_REPO_TEST_DIR: 1
  503. TEST_PGSQL_DBNAME: 'testgitea-e2e'
  504. DEBIAN_FRONTEND: noninteractive
  505. depends_on: [build-frontend, deps-backend]
  506. volumes:
  507. - name: deps
  508. path: /go
  509. ---
  510. kind: pipeline
  511. name: update_translations
  512. platform:
  513. os: linux
  514. arch: arm64
  515. trigger:
  516. branch:
  517. - main
  518. event:
  519. - cron
  520. cron:
  521. - update_translations
  522. steps:
  523. - name: download
  524. image: jonasfranz/crowdin
  525. pull: always
  526. settings:
  527. download: true
  528. export_dir: options/locale/
  529. ignore_branch: true
  530. project_identifier: gitea
  531. environment:
  532. CROWDIN_KEY:
  533. from_secret: crowdin_key
  534. - name: update
  535. image: alpine:3.17
  536. pull: always
  537. commands:
  538. - ./build/update-locales.sh
  539. - name: push
  540. image: appleboy/drone-git-push
  541. pull: always
  542. settings:
  543. author_email: "teabot@gitea.io"
  544. author_name: GiteaBot
  545. branch: main
  546. commit: true
  547. commit_message: "[skip ci] Updated translations via Crowdin"
  548. remote: "git@github.com:go-gitea/gitea.git"
  549. environment:
  550. DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
  551. DRONE_COMMIT_AUTHOR: GiteaBot
  552. GIT_PUSH_SSH_KEY:
  553. from_secret: git_push_ssh_key
  554. - name: upload_translations
  555. image: jonasfranz/crowdin
  556. pull: always
  557. settings:
  558. files:
  559. locale_en-US.ini: options/locale/locale_en-US.ini
  560. ignore_branch: true
  561. project_identifier: gitea
  562. environment:
  563. CROWDIN_KEY:
  564. from_secret: crowdin_key
  565. ---
  566. kind: pipeline
  567. type: docker
  568. name: update_gitignore_and_licenses
  569. platform:
  570. os: linux
  571. arch: arm64
  572. trigger:
  573. branch:
  574. - main
  575. event:
  576. - cron
  577. cron:
  578. - update_gitignore_and_licenses
  579. steps:
  580. - name: download
  581. image: golang:1.19
  582. pull: always
  583. commands:
  584. - timeout -s ABRT 40m make generate-license generate-gitignore
  585. - name: push
  586. image: appleboy/drone-git-push
  587. pull: always
  588. settings:
  589. author_email: "teabot@gitea.io"
  590. author_name: "GiteaBot"
  591. branch: main
  592. commit: true
  593. commit_message: "[skip ci] Updated licenses and gitignores"
  594. remote: "git@github.com:go-gitea/gitea.git"
  595. environment:
  596. DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
  597. DRONE_COMMIT_AUTHOR: "GiteaBot"
  598. GIT_PUSH_SSH_KEY:
  599. from_secret: git_push_ssh_key
  600. ---
  601. kind: pipeline
  602. type: docker
  603. name: release-latest
  604. platform:
  605. os: linux
  606. arch: amd64
  607. workspace:
  608. base: /source
  609. path: /
  610. trigger:
  611. branch:
  612. - main
  613. - "release/*"
  614. event:
  615. - push
  616. depends_on:
  617. - testing-amd64
  618. - testing-arm64
  619. volumes:
  620. - name: deps
  621. temp: {}
  622. steps:
  623. - name: fetch-tags
  624. image: docker:git
  625. pull: always
  626. commands:
  627. - git config --global --add safe.directory /drone/src
  628. - git fetch --tags --force
  629. - name: deps-frontend
  630. image: node:18
  631. pull: always
  632. commands:
  633. - make deps-frontend
  634. - name: deps-backend
  635. image: golang:1.19
  636. pull: always
  637. commands:
  638. - make deps-backend
  639. volumes:
  640. - name: deps
  641. path: /go
  642. - name: static
  643. image: techknowlogick/xgo:go-1.19.x
  644. pull: always
  645. commands:
  646. # Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
  647. - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
  648. - export PATH=$PATH:$GOPATH/bin
  649. - make release
  650. environment:
  651. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  652. TAGS: bindata sqlite sqlite_unlock_notify
  653. DEBIAN_FRONTEND: noninteractive
  654. volumes:
  655. - name: deps
  656. path: /go
  657. - name: gpg-sign
  658. image: plugins/gpgsign:1
  659. pull: always
  660. settings:
  661. detach_sign: true
  662. excludes:
  663. - "dist/release/*.sha256"
  664. files:
  665. - "dist/release/*"
  666. environment:
  667. GPGSIGN_KEY:
  668. from_secret: gpgsign_key
  669. GPGSIGN_PASSPHRASE:
  670. from_secret: gpgsign_passphrase
  671. - name: release-branch
  672. image: woodpeckerci/plugin-s3:latest
  673. pull: always
  674. settings:
  675. acl: public-read
  676. bucket: gitea-artifacts
  677. endpoint: https://ams3.digitaloceanspaces.com
  678. path_style: true
  679. source: "dist/release/*"
  680. strip_prefix: dist/release/
  681. target: "/gitea/${DRONE_BRANCH##release/v}"
  682. environment:
  683. AWS_ACCESS_KEY_ID:
  684. from_secret: aws_access_key_id
  685. AWS_SECRET_ACCESS_KEY:
  686. from_secret: aws_secret_access_key
  687. when:
  688. branch:
  689. - "release/*"
  690. event:
  691. - push
  692. - name: release-main
  693. image: woodpeckerci/plugin-s3:latest
  694. settings:
  695. acl: public-read
  696. bucket: gitea-artifacts
  697. endpoint: https://ams3.digitaloceanspaces.com
  698. path_style: true
  699. source: "dist/release/*"
  700. strip_prefix: dist/release/
  701. target: /gitea/main
  702. environment:
  703. AWS_ACCESS_KEY_ID:
  704. from_secret: aws_access_key_id
  705. AWS_SECRET_ACCESS_KEY:
  706. from_secret: aws_secret_access_key
  707. when:
  708. branch:
  709. - main
  710. event:
  711. - push
  712. ---
  713. kind: pipeline
  714. name: release-version
  715. platform:
  716. os: linux
  717. arch: amd64
  718. workspace:
  719. base: /source
  720. path: /
  721. trigger:
  722. event:
  723. - tag
  724. depends_on:
  725. - testing-arm64
  726. - testing-amd64
  727. volumes:
  728. - name: deps
  729. temp: {}
  730. steps:
  731. - name: fetch-tags
  732. image: docker:git
  733. pull: always
  734. commands:
  735. - git config --global --add safe.directory /drone/src
  736. - git fetch --tags --force
  737. - name: deps-frontend
  738. image: node:18
  739. pull: always
  740. commands:
  741. - make deps-frontend
  742. - name: deps-backend
  743. image: golang:1.19
  744. pull: always
  745. commands:
  746. - make deps-backend
  747. volumes:
  748. - name: deps
  749. path: /go
  750. - name: static
  751. image: techknowlogick/xgo:go-1.19.x
  752. pull: always
  753. commands:
  754. # Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
  755. - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
  756. - export PATH=$PATH:$GOPATH/bin
  757. - make release
  758. environment:
  759. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  760. TAGS: bindata sqlite sqlite_unlock_notify
  761. DEBIAN_FRONTEND: noninteractive
  762. depends_on: [fetch-tags]
  763. volumes:
  764. - name: deps
  765. path: /go
  766. - name: gpg-sign
  767. image: plugins/gpgsign:1
  768. pull: always
  769. settings:
  770. detach_sign: true
  771. excludes:
  772. - "dist/release/*.sha256"
  773. files:
  774. - "dist/release/*"
  775. environment:
  776. GPGSIGN_KEY:
  777. from_secret: gpgsign_key
  778. GPGSIGN_PASSPHRASE:
  779. from_secret: gpgsign_passphrase
  780. depends_on: [static]
  781. - name: release-tag
  782. image: woodpeckerci/plugin-s3:latest
  783. pull: always
  784. settings:
  785. acl: public-read
  786. bucket: gitea-artifacts
  787. endpoint: https://ams3.digitaloceanspaces.com
  788. path_style: true
  789. source: "dist/release/*"
  790. strip_prefix: dist/release/
  791. target: "/gitea/${DRONE_TAG##v}"
  792. environment:
  793. AWS_ACCESS_KEY_ID:
  794. from_secret: aws_access_key_id
  795. AWS_SECRET_ACCESS_KEY:
  796. from_secret: aws_secret_access_key
  797. depends_on: [gpg-sign]
  798. - name: github
  799. image: plugins/github-release:latest
  800. pull: always
  801. settings:
  802. files:
  803. - "dist/release/*"
  804. file_exists: overwrite
  805. environment:
  806. GITHUB_TOKEN:
  807. from_secret: github_token
  808. depends_on: [gpg-sign]
  809. ---
  810. kind: pipeline
  811. type: docker
  812. name: docs
  813. platform:
  814. os: linux
  815. arch: arm64
  816. depends_on:
  817. - compliance
  818. trigger:
  819. event:
  820. - push
  821. - tag
  822. - pull_request
  823. steps:
  824. - name: build-docs
  825. image: plugins/hugo:latest
  826. pull: always
  827. commands:
  828. - apk add --no-cache make bash curl
  829. - cd docs
  830. - make trans-copy clean build
  831. - name: publish-docs
  832. image: techknowlogick/drone-netlify:latest
  833. pull: always
  834. settings:
  835. path: docs/public/
  836. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  837. environment:
  838. NETLIFY_TOKEN:
  839. from_secret: netlify_token
  840. when:
  841. branch:
  842. - main
  843. event:
  844. - push
  845. ---
  846. kind: pipeline
  847. type: docker
  848. name: docker-linux-amd64-release-version
  849. platform:
  850. os: linux
  851. arch: amd64
  852. depends_on:
  853. - testing-amd64
  854. - testing-arm64
  855. trigger:
  856. ref:
  857. - "refs/tags/**"
  858. event:
  859. exclude:
  860. - cron
  861. steps:
  862. - name: fetch-tags
  863. image: docker:git
  864. pull: always
  865. commands:
  866. - git config --global --add safe.directory /drone/src
  867. - git fetch --tags --force
  868. - name: publish
  869. image: techknowlogick/drone-docker:latest
  870. pull: always
  871. settings:
  872. auto_tag: true
  873. auto_tag_suffix: linux-amd64
  874. repo: gitea/gitea
  875. build_args:
  876. - GOPROXY=https://goproxy.io
  877. password:
  878. from_secret: docker_password
  879. username:
  880. from_secret: docker_username
  881. when:
  882. event:
  883. exclude:
  884. - pull_request
  885. - name: publish-rootless
  886. image: techknowlogick/drone-docker:latest
  887. settings:
  888. dockerfile: Dockerfile.rootless
  889. auto_tag: true
  890. auto_tag_suffix: linux-amd64-rootless
  891. repo: gitea/gitea
  892. build_args:
  893. - GOPROXY=https://goproxy.io
  894. password:
  895. from_secret: docker_password
  896. username:
  897. from_secret: docker_username
  898. when:
  899. event:
  900. exclude:
  901. - pull_request
  902. ---
  903. kind: pipeline
  904. type: docker
  905. name: docker-linux-amd64-release
  906. platform:
  907. os: linux
  908. arch: amd64
  909. depends_on:
  910. - testing-amd64
  911. - testing-arm64
  912. trigger:
  913. ref:
  914. - refs/heads/main
  915. event:
  916. exclude:
  917. - cron
  918. steps:
  919. - name: fetch-tags
  920. image: docker:git
  921. pull: always
  922. commands:
  923. - git config --global --add safe.directory /drone/src
  924. - git fetch --tags --force
  925. - name: publish
  926. image: techknowlogick/drone-docker:latest
  927. pull: always
  928. settings:
  929. auto_tag: false
  930. tags: dev-linux-amd64
  931. repo: gitea/gitea
  932. build_args:
  933. - GOPROXY=https://goproxy.io
  934. password:
  935. from_secret: docker_password
  936. username:
  937. from_secret: docker_username
  938. when:
  939. event:
  940. exclude:
  941. - pull_request
  942. - name: publish-rootless
  943. image: techknowlogick/drone-docker:latest
  944. settings:
  945. dockerfile: Dockerfile.rootless
  946. auto_tag: false
  947. tags: dev-linux-amd64-rootless
  948. repo: gitea/gitea
  949. build_args:
  950. - GOPROXY=https://goproxy.io
  951. password:
  952. from_secret: docker_password
  953. username:
  954. from_secret: docker_username
  955. when:
  956. event:
  957. exclude:
  958. - pull_request
  959. ---
  960. kind: pipeline
  961. name: docker-linux-amd64-release-branch
  962. platform:
  963. os: linux
  964. arch: amd64
  965. depends_on:
  966. - testing-amd64
  967. - testing-arm64
  968. trigger:
  969. ref:
  970. - "refs/heads/release/v*"
  971. event:
  972. exclude:
  973. - cron
  974. steps:
  975. - name: fetch-tags
  976. image: docker:git
  977. pull: always
  978. commands:
  979. - git config --global --add safe.directory /drone/src
  980. - git fetch --tags --force
  981. - name: publish
  982. image: techknowlogick/drone-docker:latest
  983. pull: always
  984. settings:
  985. auto_tag: false
  986. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
  987. repo: gitea/gitea
  988. build_args:
  989. - GOPROXY=https://goproxy.io
  990. password:
  991. from_secret: docker_password
  992. username:
  993. from_secret: docker_username
  994. when:
  995. event:
  996. exclude:
  997. - pull_request
  998. - name: publish-rootless
  999. image: techknowlogick/drone-docker:latest
  1000. settings:
  1001. dockerfile: Dockerfile.rootless
  1002. auto_tag: false
  1003. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
  1004. repo: gitea/gitea
  1005. build_args:
  1006. - GOPROXY=https://goproxy.io
  1007. password:
  1008. from_secret: docker_password
  1009. username:
  1010. from_secret: docker_username
  1011. when:
  1012. event:
  1013. exclude:
  1014. - pull_request
  1015. ---
  1016. kind: pipeline
  1017. type: docker
  1018. name: docker-linux-arm64-dry-run
  1019. platform:
  1020. os: linux
  1021. arch: arm64
  1022. depends_on:
  1023. - compliance
  1024. trigger:
  1025. ref:
  1026. - "refs/pull/**"
  1027. steps:
  1028. - name: dryrun
  1029. image: techknowlogick/drone-docker:latest
  1030. pull: always
  1031. settings:
  1032. dry_run: true
  1033. repo: gitea/gitea
  1034. tags: linux-arm64
  1035. build_args:
  1036. - GOPROXY=https://goproxy.io
  1037. environment:
  1038. PLUGIN_MIRROR:
  1039. from_secret: plugin_mirror
  1040. when:
  1041. event:
  1042. - pull_request
  1043. ---
  1044. kind: pipeline
  1045. type: docker
  1046. name: docker-linux-arm64-release-version
  1047. platform:
  1048. os: linux
  1049. arch: arm64
  1050. depends_on:
  1051. - testing-amd64
  1052. - testing-arm64
  1053. trigger:
  1054. ref:
  1055. - "refs/tags/**"
  1056. event:
  1057. exclude:
  1058. - cron
  1059. steps:
  1060. - name: fetch-tags
  1061. image: docker:git
  1062. pull: always
  1063. commands:
  1064. - git config --global --add safe.directory /drone/src
  1065. - git fetch --tags --force
  1066. - name: publish
  1067. image: techknowlogick/drone-docker:latest
  1068. pull: always
  1069. settings:
  1070. auto_tag: true
  1071. auto_tag_suffix: linux-arm64
  1072. repo: gitea/gitea
  1073. build_args:
  1074. - GOPROXY=https://goproxy.io
  1075. password:
  1076. from_secret: docker_password
  1077. username:
  1078. from_secret: docker_username
  1079. when:
  1080. event:
  1081. exclude:
  1082. - pull_request
  1083. - name: publish-rootless
  1084. image: techknowlogick/drone-docker:latest
  1085. settings:
  1086. dockerfile: Dockerfile.rootless
  1087. auto_tag: true
  1088. auto_tag_suffix: linux-arm64-rootless
  1089. repo: gitea/gitea
  1090. build_args:
  1091. - GOPROXY=https://goproxy.io
  1092. password:
  1093. from_secret: docker_password
  1094. username:
  1095. from_secret: docker_username
  1096. when:
  1097. event:
  1098. exclude:
  1099. - pull_request
  1100. ---
  1101. kind: pipeline
  1102. type: docker
  1103. name: docker-linux-arm64-release
  1104. platform:
  1105. os: linux
  1106. arch: arm64
  1107. depends_on:
  1108. - testing-amd64
  1109. - testing-arm64
  1110. trigger:
  1111. ref:
  1112. - refs/heads/main
  1113. event:
  1114. exclude:
  1115. - cron
  1116. steps:
  1117. - name: fetch-tags
  1118. image: docker:git
  1119. pull: always
  1120. commands:
  1121. - git config --global --add safe.directory /drone/src
  1122. - git fetch --tags --force
  1123. - name: publish
  1124. image: techknowlogick/drone-docker:latest
  1125. pull: always
  1126. settings:
  1127. auto_tag: false
  1128. tags: dev-linux-arm64
  1129. repo: gitea/gitea
  1130. build_args:
  1131. - GOPROXY=https://goproxy.io
  1132. password:
  1133. from_secret: docker_password
  1134. username:
  1135. from_secret: docker_username
  1136. when:
  1137. event:
  1138. exclude:
  1139. - pull_request
  1140. - name: publish-rootless
  1141. image: techknowlogick/drone-docker:latest
  1142. settings:
  1143. dockerfile: Dockerfile.rootless
  1144. auto_tag: false
  1145. tags: dev-linux-arm64-rootless
  1146. repo: gitea/gitea
  1147. build_args:
  1148. - GOPROXY=https://goproxy.io
  1149. password:
  1150. from_secret: docker_password
  1151. username:
  1152. from_secret: docker_username
  1153. when:
  1154. event:
  1155. exclude:
  1156. - pull_request
  1157. ---
  1158. kind: pipeline
  1159. name: docker-linux-arm64-release-branch
  1160. platform:
  1161. os: linux
  1162. arch: arm64
  1163. depends_on:
  1164. - testing-amd64
  1165. - testing-arm64
  1166. trigger:
  1167. ref:
  1168. - "refs/heads/release/v*"
  1169. event:
  1170. exclude:
  1171. - cron
  1172. steps:
  1173. - name: fetch-tags
  1174. image: docker:git
  1175. pull: always
  1176. commands:
  1177. - git config --global --add safe.directory /drone/src
  1178. - git fetch --tags --force
  1179. - name: publish
  1180. image: techknowlogick/drone-docker:latest
  1181. pull: always
  1182. settings:
  1183. auto_tag: false
  1184. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
  1185. repo: gitea/gitea
  1186. build_args:
  1187. - GOPROXY=https://goproxy.io
  1188. password:
  1189. from_secret: docker_password
  1190. username:
  1191. from_secret: docker_username
  1192. when:
  1193. event:
  1194. exclude:
  1195. - pull_request
  1196. - name: publish-rootless
  1197. image: techknowlogick/drone-docker:latest
  1198. settings:
  1199. dockerfile: Dockerfile.rootless
  1200. auto_tag: false
  1201. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
  1202. repo: gitea/gitea
  1203. build_args:
  1204. - GOPROXY=https://goproxy.io
  1205. password:
  1206. from_secret: docker_password
  1207. username:
  1208. from_secret: docker_username
  1209. when:
  1210. event:
  1211. exclude:
  1212. - pull_request
  1213. ---
  1214. kind: pipeline
  1215. type: docker
  1216. name: docker-manifest-version
  1217. platform:
  1218. os: linux
  1219. arch: amd64
  1220. steps:
  1221. - name: manifest-rootless
  1222. image: plugins/manifest
  1223. pull: always
  1224. settings:
  1225. auto_tag: true
  1226. ignore_missing: true
  1227. spec: docker/manifest.rootless.tmpl
  1228. password:
  1229. from_secret: docker_password
  1230. username:
  1231. from_secret: docker_username
  1232. - name: manifest
  1233. image: plugins/manifest
  1234. settings:
  1235. auto_tag: true
  1236. ignore_missing: true
  1237. spec: docker/manifest.tmpl
  1238. password:
  1239. from_secret: docker_password
  1240. username:
  1241. from_secret: docker_username
  1242. trigger:
  1243. ref:
  1244. - "refs/tags/**"
  1245. event:
  1246. exclude:
  1247. - cron
  1248. depends_on:
  1249. - docker-linux-amd64-release-version
  1250. - docker-linux-arm64-release-version
  1251. ---
  1252. kind: pipeline
  1253. type: docker
  1254. name: docker-manifest
  1255. platform:
  1256. os: linux
  1257. arch: amd64
  1258. steps:
  1259. - name: manifest-rootless
  1260. pull: always
  1261. image: plugins/manifest
  1262. pull: always
  1263. settings:
  1264. auto_tag: false
  1265. ignore_missing: true
  1266. spec: docker/manifest.rootless.tmpl
  1267. password:
  1268. from_secret: docker_password
  1269. username:
  1270. from_secret: docker_username
  1271. - name: manifest
  1272. image: plugins/manifest
  1273. settings:
  1274. auto_tag: false
  1275. ignore_missing: true
  1276. spec: docker/manifest.tmpl
  1277. password:
  1278. from_secret: docker_password
  1279. username:
  1280. from_secret: docker_username
  1281. trigger:
  1282. ref:
  1283. - refs/heads/main
  1284. - "refs/heads/release/v*"
  1285. event:
  1286. exclude:
  1287. - cron
  1288. depends_on:
  1289. - docker-linux-amd64-release
  1290. - docker-linux-arm64-release
  1291. - docker-linux-amd64-release-branch
  1292. - docker-linux-arm64-release-branch
  1293. ---
  1294. kind: pipeline
  1295. type: docker
  1296. name: notifications
  1297. platform:
  1298. os: linux
  1299. arch: arm64
  1300. clone:
  1301. disable: true
  1302. trigger:
  1303. branch:
  1304. - main
  1305. - "release/*"
  1306. event:
  1307. - push
  1308. - tag
  1309. status:
  1310. - success
  1311. - failure
  1312. depends_on:
  1313. - testing-amd64
  1314. - testing-arm64
  1315. - release-version
  1316. - release-latest
  1317. - docker-linux-amd64-release
  1318. - docker-linux-arm64-release
  1319. - docker-linux-amd64-release-version
  1320. - docker-linux-arm64-release-version
  1321. - docker-linux-amd64-release-branch
  1322. - docker-linux-arm64-release-branch
  1323. - docker-manifest
  1324. - docker-manifest-version
  1325. - docs
  1326. steps:
  1327. - name: discord
  1328. image: appleboy/drone-discord:1.2.4
  1329. pull: always
  1330. settings:
  1331. message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n"
  1332. webhook_id:
  1333. from_secret: discord_webhook_id
  1334. webhook_token:
  1335. from_secret: discord_webhook_token