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

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