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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427
  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.17 # 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 40m 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 40m 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 40m 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. - apk add --no-cache make bash curl
  759. - cd docs
  760. - make trans-copy clean build
  761. - name: publish-docs
  762. image: techknowlogick/drone-netlify:latest
  763. pull: always
  764. settings:
  765. path: docs/public/
  766. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  767. environment:
  768. NETLIFY_TOKEN:
  769. from_secret: netlify_token
  770. when:
  771. branch:
  772. - main
  773. event:
  774. - push
  775. ---
  776. kind: pipeline
  777. type: docker
  778. name: docker-linux-amd64-release-version
  779. platform:
  780. os: linux
  781. arch: amd64
  782. depends_on:
  783. - testing-amd64
  784. - testing-arm64
  785. trigger:
  786. ref:
  787. - "refs/tags/**"
  788. event:
  789. exclude:
  790. - cron
  791. steps:
  792. - name: fetch-tags
  793. image: docker:git
  794. pull: always
  795. commands:
  796. - git config --global --add safe.directory /drone/src
  797. - git fetch --tags --force
  798. - name: publish
  799. image: techknowlogick/drone-docker:latest
  800. pull: always
  801. settings:
  802. auto_tag: true
  803. auto_tag_suffix: linux-amd64
  804. repo: gitea/gitea
  805. build_args:
  806. - GOPROXY=https://goproxy.io
  807. password:
  808. from_secret: docker_password
  809. username:
  810. from_secret: docker_username
  811. when:
  812. event:
  813. exclude:
  814. - pull_request
  815. - name: publish-rootless
  816. image: techknowlogick/drone-docker:latest
  817. settings:
  818. dockerfile: Dockerfile.rootless
  819. auto_tag: true
  820. auto_tag_suffix: linux-amd64-rootless
  821. repo: gitea/gitea
  822. build_args:
  823. - GOPROXY=https://goproxy.io
  824. password:
  825. from_secret: docker_password
  826. username:
  827. from_secret: docker_username
  828. when:
  829. event:
  830. exclude:
  831. - pull_request
  832. ---
  833. kind: pipeline
  834. type: docker
  835. name: docker-linux-amd64-release
  836. platform:
  837. os: linux
  838. arch: amd64
  839. depends_on:
  840. - testing-amd64
  841. - testing-arm64
  842. trigger:
  843. ref:
  844. - refs/heads/main
  845. event:
  846. exclude:
  847. - cron
  848. steps:
  849. - name: fetch-tags
  850. image: docker:git
  851. pull: always
  852. commands:
  853. - git config --global --add safe.directory /drone/src
  854. - git fetch --tags --force
  855. - name: publish
  856. image: techknowlogick/drone-docker:latest
  857. pull: always
  858. settings:
  859. auto_tag: false
  860. tags: dev-linux-amd64
  861. repo: gitea/gitea
  862. build_args:
  863. - GOPROXY=https://goproxy.io
  864. password:
  865. from_secret: docker_password
  866. username:
  867. from_secret: docker_username
  868. when:
  869. event:
  870. exclude:
  871. - pull_request
  872. - name: publish-rootless
  873. image: techknowlogick/drone-docker:latest
  874. settings:
  875. dockerfile: Dockerfile.rootless
  876. auto_tag: false
  877. tags: dev-linux-amd64-rootless
  878. repo: gitea/gitea
  879. build_args:
  880. - GOPROXY=https://goproxy.io
  881. password:
  882. from_secret: docker_password
  883. username:
  884. from_secret: docker_username
  885. when:
  886. event:
  887. exclude:
  888. - pull_request
  889. ---
  890. kind: pipeline
  891. name: docker-linux-amd64-release-branch
  892. platform:
  893. os: linux
  894. arch: amd64
  895. depends_on:
  896. - testing-amd64
  897. - testing-arm64
  898. trigger:
  899. ref:
  900. - "refs/heads/release/v*"
  901. event:
  902. exclude:
  903. - cron
  904. steps:
  905. - name: fetch-tags
  906. image: docker:git
  907. pull: always
  908. commands:
  909. - git config --global --add safe.directory /drone/src
  910. - git fetch --tags --force
  911. - name: publish
  912. image: techknowlogick/drone-docker:latest
  913. pull: always
  914. settings:
  915. auto_tag: false
  916. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
  917. repo: gitea/gitea
  918. build_args:
  919. - GOPROXY=https://goproxy.io
  920. password:
  921. from_secret: docker_password
  922. username:
  923. from_secret: docker_username
  924. when:
  925. event:
  926. exclude:
  927. - pull_request
  928. - name: publish-rootless
  929. image: techknowlogick/drone-docker:latest
  930. settings:
  931. dockerfile: Dockerfile.rootless
  932. auto_tag: false
  933. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
  934. repo: gitea/gitea
  935. build_args:
  936. - GOPROXY=https://goproxy.io
  937. password:
  938. from_secret: docker_password
  939. username:
  940. from_secret: docker_username
  941. when:
  942. event:
  943. exclude:
  944. - pull_request
  945. ---
  946. kind: pipeline
  947. type: docker
  948. name: docker-linux-arm64-dry-run
  949. platform:
  950. os: linux
  951. arch: arm64
  952. depends_on:
  953. - compliance
  954. trigger:
  955. ref:
  956. - "refs/pull/**"
  957. steps:
  958. - name: dryrun
  959. image: techknowlogick/drone-docker:latest
  960. pull: always
  961. settings:
  962. dry_run: true
  963. repo: gitea/gitea
  964. tags: linux-arm64
  965. build_args:
  966. - GOPROXY=https://goproxy.io
  967. environment:
  968. PLUGIN_MIRROR:
  969. from_secret: plugin_mirror
  970. when:
  971. event:
  972. - pull_request
  973. ---
  974. kind: pipeline
  975. type: docker
  976. name: docker-linux-arm64-release-version
  977. platform:
  978. os: linux
  979. arch: arm64
  980. depends_on:
  981. - testing-amd64
  982. - testing-arm64
  983. trigger:
  984. ref:
  985. - "refs/tags/**"
  986. event:
  987. exclude:
  988. - cron
  989. steps:
  990. - name: fetch-tags
  991. image: docker:git
  992. pull: always
  993. commands:
  994. - git config --global --add safe.directory /drone/src
  995. - git fetch --tags --force
  996. - name: publish
  997. image: techknowlogick/drone-docker:latest
  998. pull: always
  999. settings:
  1000. auto_tag: true
  1001. auto_tag_suffix: linux-arm64
  1002. repo: gitea/gitea
  1003. build_args:
  1004. - GOPROXY=https://goproxy.io
  1005. password:
  1006. from_secret: docker_password
  1007. username:
  1008. from_secret: docker_username
  1009. when:
  1010. event:
  1011. exclude:
  1012. - pull_request
  1013. - name: publish-rootless
  1014. image: techknowlogick/drone-docker:latest
  1015. settings:
  1016. dockerfile: Dockerfile.rootless
  1017. auto_tag: true
  1018. auto_tag_suffix: linux-arm64-rootless
  1019. repo: gitea/gitea
  1020. build_args:
  1021. - GOPROXY=https://goproxy.io
  1022. password:
  1023. from_secret: docker_password
  1024. username:
  1025. from_secret: docker_username
  1026. when:
  1027. event:
  1028. exclude:
  1029. - pull_request
  1030. ---
  1031. kind: pipeline
  1032. type: docker
  1033. name: docker-linux-arm64-release
  1034. platform:
  1035. os: linux
  1036. arch: arm64
  1037. depends_on:
  1038. - testing-amd64
  1039. - testing-arm64
  1040. trigger:
  1041. ref:
  1042. - refs/heads/main
  1043. event:
  1044. exclude:
  1045. - cron
  1046. steps:
  1047. - name: fetch-tags
  1048. image: docker:git
  1049. pull: always
  1050. commands:
  1051. - git config --global --add safe.directory /drone/src
  1052. - git fetch --tags --force
  1053. - name: publish
  1054. image: techknowlogick/drone-docker:latest
  1055. pull: always
  1056. settings:
  1057. auto_tag: false
  1058. tags: dev-linux-arm64
  1059. repo: gitea/gitea
  1060. build_args:
  1061. - GOPROXY=https://goproxy.io
  1062. password:
  1063. from_secret: docker_password
  1064. username:
  1065. from_secret: docker_username
  1066. when:
  1067. event:
  1068. exclude:
  1069. - pull_request
  1070. - name: publish-rootless
  1071. image: techknowlogick/drone-docker:latest
  1072. settings:
  1073. dockerfile: Dockerfile.rootless
  1074. auto_tag: false
  1075. tags: dev-linux-arm64-rootless
  1076. repo: gitea/gitea
  1077. build_args:
  1078. - GOPROXY=https://goproxy.io
  1079. password:
  1080. from_secret: docker_password
  1081. username:
  1082. from_secret: docker_username
  1083. when:
  1084. event:
  1085. exclude:
  1086. - pull_request
  1087. ---
  1088. kind: pipeline
  1089. name: docker-linux-arm64-release-branch
  1090. platform:
  1091. os: linux
  1092. arch: arm64
  1093. depends_on:
  1094. - testing-amd64
  1095. - testing-arm64
  1096. trigger:
  1097. ref:
  1098. - "refs/heads/release/v*"
  1099. event:
  1100. exclude:
  1101. - cron
  1102. steps:
  1103. - name: fetch-tags
  1104. image: docker:git
  1105. pull: always
  1106. commands:
  1107. - git config --global --add safe.directory /drone/src
  1108. - git fetch --tags --force
  1109. - name: publish
  1110. image: techknowlogick/drone-docker:latest
  1111. pull: always
  1112. settings:
  1113. auto_tag: false
  1114. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
  1115. repo: gitea/gitea
  1116. build_args:
  1117. - GOPROXY=https://goproxy.io
  1118. password:
  1119. from_secret: docker_password
  1120. username:
  1121. from_secret: docker_username
  1122. when:
  1123. event:
  1124. exclude:
  1125. - pull_request
  1126. - name: publish-rootless
  1127. image: techknowlogick/drone-docker:latest
  1128. settings:
  1129. dockerfile: Dockerfile.rootless
  1130. auto_tag: false
  1131. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
  1132. repo: gitea/gitea
  1133. build_args:
  1134. - GOPROXY=https://goproxy.io
  1135. password:
  1136. from_secret: docker_password
  1137. username:
  1138. from_secret: docker_username
  1139. when:
  1140. event:
  1141. exclude:
  1142. - pull_request
  1143. ---
  1144. kind: pipeline
  1145. type: docker
  1146. name: docker-manifest-version
  1147. platform:
  1148. os: linux
  1149. arch: amd64
  1150. steps:
  1151. - name: manifest-rootless
  1152. image: plugins/manifest
  1153. pull: always
  1154. settings:
  1155. auto_tag: true
  1156. ignore_missing: true
  1157. spec: docker/manifest.rootless.tmpl
  1158. password:
  1159. from_secret: docker_password
  1160. username:
  1161. from_secret: docker_username
  1162. - name: manifest
  1163. image: plugins/manifest
  1164. settings:
  1165. auto_tag: true
  1166. ignore_missing: true
  1167. spec: docker/manifest.tmpl
  1168. password:
  1169. from_secret: docker_password
  1170. username:
  1171. from_secret: docker_username
  1172. trigger:
  1173. ref:
  1174. - "refs/tags/**"
  1175. event:
  1176. exclude:
  1177. - cron
  1178. depends_on:
  1179. - docker-linux-amd64-release-version
  1180. - docker-linux-arm64-release-version
  1181. ---
  1182. kind: pipeline
  1183. type: docker
  1184. name: docker-manifest
  1185. platform:
  1186. os: linux
  1187. arch: amd64
  1188. steps:
  1189. - name: manifest-rootless
  1190. pull: always
  1191. image: plugins/manifest
  1192. pull: always
  1193. settings:
  1194. auto_tag: false
  1195. ignore_missing: true
  1196. spec: docker/manifest.rootless.tmpl
  1197. password:
  1198. from_secret: docker_password
  1199. username:
  1200. from_secret: docker_username
  1201. - name: manifest
  1202. image: plugins/manifest
  1203. settings:
  1204. auto_tag: false
  1205. ignore_missing: true
  1206. spec: docker/manifest.tmpl
  1207. password:
  1208. from_secret: docker_password
  1209. username:
  1210. from_secret: docker_username
  1211. trigger:
  1212. ref:
  1213. - refs/heads/main
  1214. - "refs/heads/release/v*"
  1215. event:
  1216. exclude:
  1217. - cron
  1218. depends_on:
  1219. - docker-linux-amd64-release
  1220. - docker-linux-arm64-release
  1221. - docker-linux-amd64-release-branch
  1222. - docker-linux-arm64-release-branch
  1223. ---
  1224. kind: pipeline
  1225. type: docker
  1226. name: notifications
  1227. platform:
  1228. os: linux
  1229. arch: arm64
  1230. clone:
  1231. disable: true
  1232. trigger:
  1233. branch:
  1234. - main
  1235. - "release/*"
  1236. event:
  1237. - push
  1238. - tag
  1239. status:
  1240. - success
  1241. - failure
  1242. depends_on:
  1243. - testing-amd64
  1244. - testing-arm64
  1245. - release-version
  1246. - release-latest
  1247. - docker-linux-amd64-release
  1248. - docker-linux-arm64-release
  1249. - docker-linux-amd64-release-version
  1250. - docker-linux-arm64-release-version
  1251. - docker-linux-amd64-release-branch
  1252. - docker-linux-arm64-release-branch
  1253. - docker-manifest
  1254. - docker-manifest-version
  1255. - docs
  1256. steps:
  1257. - name: discord
  1258. image: appleboy/drone-discord:1.2.4
  1259. pull: always
  1260. settings:
  1261. 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"
  1262. webhook_id:
  1263. from_secret: discord_webhook_id
  1264. webhook_token:
  1265. from_secret: discord_webhook_token