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

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