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 29KB

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