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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  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. DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
  560. DRONE_COMMIT_AUTHOR: GiteaBot
  561. GIT_PUSH_SSH_KEY:
  562. from_secret: git_push_ssh_key
  563. - name: upload_translations
  564. image: jonasfranz/crowdin
  565. pull: always
  566. settings:
  567. files:
  568. locale_en-US.ini: options/locale/locale_en-US.ini
  569. ignore_branch: true
  570. project_identifier: gitea
  571. environment:
  572. CROWDIN_KEY:
  573. from_secret: crowdin_key
  574. ---
  575. kind: pipeline
  576. type: docker
  577. name: update_gitignore_and_licenses
  578. platform:
  579. os: linux
  580. arch: arm64
  581. trigger:
  582. branch:
  583. - main
  584. event:
  585. - cron
  586. cron:
  587. - update_gitignore_and_licenses
  588. steps:
  589. - name: download
  590. image: golang:1.19
  591. pull: always
  592. commands:
  593. - timeout -s ABRT 40m make generate-license generate-gitignore
  594. - name: push
  595. image: appleboy/drone-git-push
  596. pull: always
  597. settings:
  598. author_email: "teabot@gitea.io"
  599. author_name: "GiteaBot"
  600. branch: main
  601. commit: true
  602. commit_message: "[skip ci] Updated licenses and gitignores"
  603. remote: "git@github.com:go-gitea/gitea.git"
  604. environment:
  605. DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
  606. DRONE_COMMIT_AUTHOR: "GiteaBot"
  607. GIT_PUSH_SSH_KEY:
  608. from_secret: git_push_ssh_key
  609. ---
  610. kind: pipeline
  611. type: docker
  612. name: release-latest
  613. platform:
  614. os: linux
  615. arch: amd64
  616. workspace:
  617. base: /source
  618. path: /
  619. trigger:
  620. branch:
  621. - main
  622. - "release/*"
  623. event:
  624. - push
  625. depends_on:
  626. - testing-amd64
  627. - testing-arm64
  628. volumes:
  629. - name: deps
  630. temp: {}
  631. steps:
  632. - name: fetch-tags
  633. image: docker:git
  634. pull: always
  635. commands:
  636. - git config --global --add safe.directory /drone/src
  637. - git fetch --tags --force
  638. - name: deps-frontend
  639. image: node:18
  640. pull: always
  641. commands:
  642. - make deps-frontend
  643. - name: deps-backend
  644. image: golang:1.19
  645. pull: always
  646. commands:
  647. - make deps-backend
  648. volumes:
  649. - name: deps
  650. path: /go
  651. - name: static
  652. image: techknowlogick/xgo:go-1.19.x
  653. pull: always
  654. commands:
  655. # Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
  656. - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
  657. - export PATH=$PATH:$GOPATH/bin
  658. - make release
  659. environment:
  660. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  661. TAGS: bindata sqlite sqlite_unlock_notify
  662. DEBIAN_FRONTEND: noninteractive
  663. volumes:
  664. - name: deps
  665. path: /go
  666. - name: gpg-sign
  667. image: plugins/gpgsign:1
  668. pull: always
  669. settings:
  670. detach_sign: true
  671. excludes:
  672. - "dist/release/*.sha256"
  673. files:
  674. - "dist/release/*"
  675. environment:
  676. GPGSIGN_KEY:
  677. from_secret: gpgsign_key
  678. GPGSIGN_PASSPHRASE:
  679. from_secret: gpgsign_passphrase
  680. - name: release-branch
  681. image: woodpeckerci/plugin-s3:latest
  682. pull: always
  683. settings:
  684. acl: public-read
  685. bucket: gitea-artifacts
  686. endpoint: https://ams3.digitaloceanspaces.com
  687. path_style: true
  688. source: "dist/release/*"
  689. strip_prefix: dist/release/
  690. target: "/gitea/${DRONE_BRANCH##release/v}"
  691. environment:
  692. AWS_ACCESS_KEY_ID:
  693. from_secret: aws_access_key_id
  694. AWS_SECRET_ACCESS_KEY:
  695. from_secret: aws_secret_access_key
  696. when:
  697. branch:
  698. - "release/*"
  699. event:
  700. - push
  701. - name: release-main
  702. image: woodpeckerci/plugin-s3:latest
  703. settings:
  704. acl: public-read
  705. bucket: gitea-artifacts
  706. endpoint: https://ams3.digitaloceanspaces.com
  707. path_style: true
  708. source: "dist/release/*"
  709. strip_prefix: dist/release/
  710. target: /gitea/main
  711. environment:
  712. AWS_ACCESS_KEY_ID:
  713. from_secret: aws_access_key_id
  714. AWS_SECRET_ACCESS_KEY:
  715. from_secret: aws_secret_access_key
  716. when:
  717. branch:
  718. - main
  719. event:
  720. - push
  721. ---
  722. kind: pipeline
  723. name: release-version
  724. platform:
  725. os: linux
  726. arch: amd64
  727. workspace:
  728. base: /source
  729. path: /
  730. trigger:
  731. event:
  732. - tag
  733. depends_on:
  734. - testing-arm64
  735. - testing-amd64
  736. volumes:
  737. - name: deps
  738. temp: {}
  739. steps:
  740. - name: fetch-tags
  741. image: docker:git
  742. pull: always
  743. commands:
  744. - git config --global --add safe.directory /drone/src
  745. - git fetch --tags --force
  746. - name: deps-frontend
  747. image: node:18
  748. pull: always
  749. commands:
  750. - make deps-frontend
  751. - name: deps-backend
  752. image: golang:1.19
  753. pull: always
  754. commands:
  755. - make deps-backend
  756. volumes:
  757. - name: deps
  758. path: /go
  759. - name: static
  760. image: techknowlogick/xgo:go-1.19.x
  761. pull: always
  762. commands:
  763. # Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
  764. - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
  765. - export PATH=$PATH:$GOPATH/bin
  766. - make release
  767. environment:
  768. GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
  769. TAGS: bindata sqlite sqlite_unlock_notify
  770. DEBIAN_FRONTEND: noninteractive
  771. depends_on: [fetch-tags]
  772. volumes:
  773. - name: deps
  774. path: /go
  775. - name: gpg-sign
  776. image: plugins/gpgsign:1
  777. pull: always
  778. settings:
  779. detach_sign: true
  780. excludes:
  781. - "dist/release/*.sha256"
  782. files:
  783. - "dist/release/*"
  784. environment:
  785. GPGSIGN_KEY:
  786. from_secret: gpgsign_key
  787. GPGSIGN_PASSPHRASE:
  788. from_secret: gpgsign_passphrase
  789. depends_on: [static]
  790. - name: release-tag
  791. image: woodpeckerci/plugin-s3:latest
  792. pull: always
  793. settings:
  794. acl: public-read
  795. bucket: gitea-artifacts
  796. endpoint: https://ams3.digitaloceanspaces.com
  797. path_style: true
  798. source: "dist/release/*"
  799. strip_prefix: dist/release/
  800. target: "/gitea/${DRONE_TAG##v}"
  801. environment:
  802. AWS_ACCESS_KEY_ID:
  803. from_secret: aws_access_key_id
  804. AWS_SECRET_ACCESS_KEY:
  805. from_secret: aws_secret_access_key
  806. depends_on: [gpg-sign]
  807. - name: github
  808. image: plugins/github-release:latest
  809. pull: always
  810. settings:
  811. files:
  812. - "dist/release/*"
  813. file_exists: overwrite
  814. environment:
  815. GITHUB_TOKEN:
  816. from_secret: github_token
  817. depends_on: [gpg-sign]
  818. ---
  819. kind: pipeline
  820. type: docker
  821. name: docs
  822. platform:
  823. os: linux
  824. arch: arm64
  825. depends_on:
  826. - compliance
  827. trigger:
  828. event:
  829. - push
  830. - tag
  831. - pull_request
  832. steps:
  833. - name: build-docs
  834. image: plugins/hugo:latest
  835. pull: always
  836. commands:
  837. # https://github.com/drone-plugins/drone-hugo/issues/36
  838. - apk upgrade --no-cache libcurl && apk add --no-cache make bash curl
  839. - cd docs
  840. - make trans-copy clean build
  841. - name: publish-docs
  842. image: techknowlogick/drone-netlify:latest
  843. pull: always
  844. settings:
  845. path: docs/public/
  846. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  847. environment:
  848. NETLIFY_TOKEN:
  849. from_secret: netlify_token
  850. when:
  851. branch:
  852. - main
  853. event:
  854. - push
  855. ---
  856. kind: pipeline
  857. type: docker
  858. name: docker-linux-amd64-release-version
  859. platform:
  860. os: linux
  861. arch: amd64
  862. depends_on:
  863. - testing-amd64
  864. - testing-arm64
  865. trigger:
  866. ref:
  867. - "refs/tags/**"
  868. event:
  869. exclude:
  870. - cron
  871. steps:
  872. - name: fetch-tags
  873. image: docker:git
  874. pull: always
  875. commands:
  876. - git config --global --add safe.directory /drone/src
  877. - git fetch --tags --force
  878. - name: publish
  879. image: techknowlogick/drone-docker:latest
  880. pull: always
  881. settings:
  882. auto_tag: true
  883. auto_tag_suffix: linux-amd64
  884. repo: gitea/gitea
  885. build_args:
  886. - GOPROXY=https://goproxy.io
  887. password:
  888. from_secret: docker_password
  889. username:
  890. from_secret: docker_username
  891. when:
  892. event:
  893. exclude:
  894. - pull_request
  895. - name: publish-rootless
  896. image: techknowlogick/drone-docker:latest
  897. settings:
  898. dockerfile: Dockerfile.rootless
  899. auto_tag: true
  900. auto_tag_suffix: linux-amd64-rootless
  901. repo: gitea/gitea
  902. build_args:
  903. - GOPROXY=https://goproxy.io
  904. password:
  905. from_secret: docker_password
  906. username:
  907. from_secret: docker_username
  908. when:
  909. event:
  910. exclude:
  911. - pull_request
  912. ---
  913. kind: pipeline
  914. type: docker
  915. name: docker-linux-amd64-release
  916. platform:
  917. os: linux
  918. arch: amd64
  919. depends_on:
  920. - testing-amd64
  921. - testing-arm64
  922. trigger:
  923. ref:
  924. - refs/heads/main
  925. event:
  926. exclude:
  927. - cron
  928. steps:
  929. - name: fetch-tags
  930. image: docker:git
  931. pull: always
  932. commands:
  933. - git config --global --add safe.directory /drone/src
  934. - git fetch --tags --force
  935. - name: publish
  936. image: techknowlogick/drone-docker:latest
  937. pull: always
  938. settings:
  939. auto_tag: false
  940. tags: dev-linux-amd64
  941. repo: gitea/gitea
  942. build_args:
  943. - GOPROXY=https://goproxy.io
  944. password:
  945. from_secret: docker_password
  946. username:
  947. from_secret: docker_username
  948. when:
  949. event:
  950. exclude:
  951. - pull_request
  952. - name: publish-rootless
  953. image: techknowlogick/drone-docker:latest
  954. settings:
  955. dockerfile: Dockerfile.rootless
  956. auto_tag: false
  957. tags: dev-linux-amd64-rootless
  958. repo: gitea/gitea
  959. build_args:
  960. - GOPROXY=https://goproxy.io
  961. password:
  962. from_secret: docker_password
  963. username:
  964. from_secret: docker_username
  965. when:
  966. event:
  967. exclude:
  968. - pull_request
  969. ---
  970. kind: pipeline
  971. name: docker-linux-amd64-release-branch
  972. platform:
  973. os: linux
  974. arch: amd64
  975. depends_on:
  976. - testing-amd64
  977. - testing-arm64
  978. trigger:
  979. ref:
  980. - "refs/heads/release/v*"
  981. event:
  982. exclude:
  983. - cron
  984. steps:
  985. - name: fetch-tags
  986. image: docker:git
  987. pull: always
  988. commands:
  989. - git config --global --add safe.directory /drone/src
  990. - git fetch --tags --force
  991. - name: publish
  992. image: techknowlogick/drone-docker:latest
  993. pull: always
  994. settings:
  995. auto_tag: false
  996. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
  997. repo: gitea/gitea
  998. build_args:
  999. - GOPROXY=https://goproxy.io
  1000. password:
  1001. from_secret: docker_password
  1002. username:
  1003. from_secret: docker_username
  1004. when:
  1005. event:
  1006. exclude:
  1007. - pull_request
  1008. - name: publish-rootless
  1009. image: techknowlogick/drone-docker:latest
  1010. settings:
  1011. dockerfile: Dockerfile.rootless
  1012. auto_tag: false
  1013. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
  1014. repo: gitea/gitea
  1015. build_args:
  1016. - GOPROXY=https://goproxy.io
  1017. password:
  1018. from_secret: docker_password
  1019. username:
  1020. from_secret: docker_username
  1021. when:
  1022. event:
  1023. exclude:
  1024. - pull_request
  1025. ---
  1026. kind: pipeline
  1027. type: docker
  1028. name: docker-linux-arm64-dry-run
  1029. platform:
  1030. os: linux
  1031. arch: arm64
  1032. depends_on:
  1033. - compliance
  1034. trigger:
  1035. ref:
  1036. - "refs/pull/**"
  1037. steps:
  1038. - name: dryrun
  1039. image: techknowlogick/drone-docker:latest
  1040. pull: always
  1041. settings:
  1042. dry_run: true
  1043. repo: gitea/gitea
  1044. tags: linux-arm64
  1045. build_args:
  1046. - GOPROXY=https://goproxy.io
  1047. environment:
  1048. PLUGIN_MIRROR:
  1049. from_secret: plugin_mirror
  1050. when:
  1051. event:
  1052. - pull_request
  1053. ---
  1054. kind: pipeline
  1055. type: docker
  1056. name: docker-linux-arm64-release-version
  1057. platform:
  1058. os: linux
  1059. arch: arm64
  1060. depends_on:
  1061. - testing-amd64
  1062. - testing-arm64
  1063. trigger:
  1064. ref:
  1065. - "refs/tags/**"
  1066. event:
  1067. exclude:
  1068. - cron
  1069. steps:
  1070. - name: fetch-tags
  1071. image: docker:git
  1072. pull: always
  1073. commands:
  1074. - git config --global --add safe.directory /drone/src
  1075. - git fetch --tags --force
  1076. - name: publish
  1077. image: techknowlogick/drone-docker:latest
  1078. pull: always
  1079. settings:
  1080. auto_tag: true
  1081. auto_tag_suffix: linux-arm64
  1082. repo: gitea/gitea
  1083. build_args:
  1084. - GOPROXY=https://goproxy.io
  1085. password:
  1086. from_secret: docker_password
  1087. username:
  1088. from_secret: docker_username
  1089. when:
  1090. event:
  1091. exclude:
  1092. - pull_request
  1093. - name: publish-rootless
  1094. image: techknowlogick/drone-docker:latest
  1095. settings:
  1096. dockerfile: Dockerfile.rootless
  1097. auto_tag: true
  1098. auto_tag_suffix: linux-arm64-rootless
  1099. repo: gitea/gitea
  1100. build_args:
  1101. - GOPROXY=https://goproxy.io
  1102. password:
  1103. from_secret: docker_password
  1104. username:
  1105. from_secret: docker_username
  1106. when:
  1107. event:
  1108. exclude:
  1109. - pull_request
  1110. ---
  1111. kind: pipeline
  1112. type: docker
  1113. name: docker-linux-arm64-release
  1114. platform:
  1115. os: linux
  1116. arch: arm64
  1117. depends_on:
  1118. - testing-amd64
  1119. - testing-arm64
  1120. trigger:
  1121. ref:
  1122. - refs/heads/main
  1123. event:
  1124. exclude:
  1125. - cron
  1126. steps:
  1127. - name: fetch-tags
  1128. image: docker:git
  1129. pull: always
  1130. commands:
  1131. - git config --global --add safe.directory /drone/src
  1132. - git fetch --tags --force
  1133. - name: publish
  1134. image: techknowlogick/drone-docker:latest
  1135. pull: always
  1136. settings:
  1137. auto_tag: false
  1138. tags: dev-linux-arm64
  1139. repo: gitea/gitea
  1140. build_args:
  1141. - GOPROXY=https://goproxy.io
  1142. password:
  1143. from_secret: docker_password
  1144. username:
  1145. from_secret: docker_username
  1146. when:
  1147. event:
  1148. exclude:
  1149. - pull_request
  1150. - name: publish-rootless
  1151. image: techknowlogick/drone-docker:latest
  1152. settings:
  1153. dockerfile: Dockerfile.rootless
  1154. auto_tag: false
  1155. tags: dev-linux-arm64-rootless
  1156. repo: gitea/gitea
  1157. build_args:
  1158. - GOPROXY=https://goproxy.io
  1159. password:
  1160. from_secret: docker_password
  1161. username:
  1162. from_secret: docker_username
  1163. when:
  1164. event:
  1165. exclude:
  1166. - pull_request
  1167. ---
  1168. kind: pipeline
  1169. name: docker-linux-arm64-release-branch
  1170. platform:
  1171. os: linux
  1172. arch: arm64
  1173. depends_on:
  1174. - testing-amd64
  1175. - testing-arm64
  1176. trigger:
  1177. ref:
  1178. - "refs/heads/release/v*"
  1179. event:
  1180. exclude:
  1181. - cron
  1182. steps:
  1183. - name: fetch-tags
  1184. image: docker:git
  1185. pull: always
  1186. commands:
  1187. - git config --global --add safe.directory /drone/src
  1188. - git fetch --tags --force
  1189. - name: publish
  1190. image: techknowlogick/drone-docker:latest
  1191. pull: always
  1192. settings:
  1193. auto_tag: false
  1194. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
  1195. repo: gitea/gitea
  1196. build_args:
  1197. - GOPROXY=https://goproxy.io
  1198. password:
  1199. from_secret: docker_password
  1200. username:
  1201. from_secret: docker_username
  1202. when:
  1203. event:
  1204. exclude:
  1205. - pull_request
  1206. - name: publish-rootless
  1207. image: techknowlogick/drone-docker:latest
  1208. settings:
  1209. dockerfile: Dockerfile.rootless
  1210. auto_tag: false
  1211. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
  1212. repo: gitea/gitea
  1213. build_args:
  1214. - GOPROXY=https://goproxy.io
  1215. password:
  1216. from_secret: docker_password
  1217. username:
  1218. from_secret: docker_username
  1219. when:
  1220. event:
  1221. exclude:
  1222. - pull_request
  1223. ---
  1224. kind: pipeline
  1225. type: docker
  1226. name: docker-manifest-version
  1227. platform:
  1228. os: linux
  1229. arch: amd64
  1230. steps:
  1231. - name: manifest-rootless
  1232. image: plugins/manifest
  1233. pull: always
  1234. settings:
  1235. auto_tag: true
  1236. ignore_missing: true
  1237. spec: docker/manifest.rootless.tmpl
  1238. password:
  1239. from_secret: docker_password
  1240. username:
  1241. from_secret: docker_username
  1242. - name: manifest
  1243. image: plugins/manifest
  1244. settings:
  1245. auto_tag: true
  1246. ignore_missing: true
  1247. spec: docker/manifest.tmpl
  1248. password:
  1249. from_secret: docker_password
  1250. username:
  1251. from_secret: docker_username
  1252. trigger:
  1253. ref:
  1254. - "refs/tags/**"
  1255. event:
  1256. exclude:
  1257. - cron
  1258. depends_on:
  1259. - docker-linux-amd64-release-version
  1260. - docker-linux-arm64-release-version
  1261. ---
  1262. kind: pipeline
  1263. type: docker
  1264. name: docker-manifest
  1265. platform:
  1266. os: linux
  1267. arch: amd64
  1268. steps:
  1269. - name: manifest-rootless
  1270. pull: always
  1271. image: plugins/manifest
  1272. pull: always
  1273. settings:
  1274. auto_tag: false
  1275. ignore_missing: true
  1276. spec: docker/manifest.rootless.tmpl
  1277. password:
  1278. from_secret: docker_password
  1279. username:
  1280. from_secret: docker_username
  1281. - name: manifest
  1282. image: plugins/manifest
  1283. settings:
  1284. auto_tag: false
  1285. ignore_missing: true
  1286. spec: docker/manifest.tmpl
  1287. password:
  1288. from_secret: docker_password
  1289. username:
  1290. from_secret: docker_username
  1291. trigger:
  1292. ref:
  1293. - refs/heads/main
  1294. - "refs/heads/release/v*"
  1295. event:
  1296. exclude:
  1297. - cron
  1298. depends_on:
  1299. - docker-linux-amd64-release
  1300. - docker-linux-arm64-release
  1301. - docker-linux-amd64-release-branch
  1302. - docker-linux-arm64-release-branch
  1303. ---
  1304. kind: pipeline
  1305. type: docker
  1306. name: notifications
  1307. platform:
  1308. os: linux
  1309. arch: arm64
  1310. clone:
  1311. disable: true
  1312. trigger:
  1313. branch:
  1314. - main
  1315. - "release/*"
  1316. event:
  1317. - push
  1318. - tag
  1319. status:
  1320. - success
  1321. - failure
  1322. depends_on:
  1323. - testing-amd64
  1324. - testing-arm64
  1325. - release-version
  1326. - release-latest
  1327. - docker-linux-amd64-release
  1328. - docker-linux-arm64-release
  1329. - docker-linux-amd64-release-version
  1330. - docker-linux-arm64-release-version
  1331. - docker-linux-amd64-release-branch
  1332. - docker-linux-arm64-release-branch
  1333. - docker-manifest
  1334. - docker-manifest-version
  1335. - docs
  1336. steps:
  1337. - name: discord
  1338. image: appleboy/drone-discord:1.2.4
  1339. pull: always
  1340. settings:
  1341. 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"
  1342. webhook_id:
  1343. from_secret: discord_webhook_id
  1344. webhook_token:
  1345. from_secret: discord_webhook_token