You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 31KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517
  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. - apk add --no-cache make bash curl
  838. - cd docs
  839. - make trans-copy clean build
  840. - name: publish-docs
  841. image: techknowlogick/drone-netlify:latest
  842. pull: always
  843. settings:
  844. path: docs/public/
  845. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  846. environment:
  847. NETLIFY_TOKEN:
  848. from_secret: netlify_token
  849. when:
  850. branch:
  851. - main
  852. event:
  853. - push
  854. ---
  855. kind: pipeline
  856. type: docker
  857. name: docker-linux-amd64-release-version
  858. platform:
  859. os: linux
  860. arch: amd64
  861. depends_on:
  862. - testing-amd64
  863. - testing-arm64
  864. trigger:
  865. ref:
  866. - "refs/tags/**"
  867. event:
  868. exclude:
  869. - cron
  870. steps:
  871. - name: fetch-tags
  872. image: docker:git
  873. pull: always
  874. commands:
  875. - git config --global --add safe.directory /drone/src
  876. - git fetch --tags --force
  877. - name: publish
  878. image: techknowlogick/drone-docker:latest
  879. pull: always
  880. settings:
  881. auto_tag: true
  882. auto_tag_suffix: linux-amd64
  883. repo: gitea/gitea
  884. build_args:
  885. - GOPROXY=https://goproxy.io
  886. password:
  887. from_secret: docker_password
  888. username:
  889. from_secret: docker_username
  890. when:
  891. event:
  892. exclude:
  893. - pull_request
  894. - name: publish-rootless
  895. image: techknowlogick/drone-docker:latest
  896. settings:
  897. dockerfile: Dockerfile.rootless
  898. auto_tag: true
  899. auto_tag_suffix: linux-amd64-rootless
  900. repo: gitea/gitea
  901. build_args:
  902. - GOPROXY=https://goproxy.io
  903. password:
  904. from_secret: docker_password
  905. username:
  906. from_secret: docker_username
  907. when:
  908. event:
  909. exclude:
  910. - pull_request
  911. ---
  912. kind: pipeline
  913. type: docker
  914. name: docker-linux-amd64-release
  915. platform:
  916. os: linux
  917. arch: amd64
  918. depends_on:
  919. - testing-amd64
  920. - testing-arm64
  921. trigger:
  922. ref:
  923. - refs/heads/main
  924. event:
  925. exclude:
  926. - cron
  927. steps:
  928. - name: fetch-tags
  929. image: docker:git
  930. pull: always
  931. commands:
  932. - git config --global --add safe.directory /drone/src
  933. - git fetch --tags --force
  934. - name: publish
  935. image: techknowlogick/drone-docker:latest
  936. pull: always
  937. settings:
  938. auto_tag: false
  939. tags: dev-linux-amd64
  940. repo: gitea/gitea
  941. build_args:
  942. - GOPROXY=https://goproxy.io
  943. password:
  944. from_secret: docker_password
  945. username:
  946. from_secret: docker_username
  947. when:
  948. event:
  949. exclude:
  950. - pull_request
  951. - name: publish-rootless
  952. image: techknowlogick/drone-docker:latest
  953. settings:
  954. dockerfile: Dockerfile.rootless
  955. auto_tag: false
  956. tags: dev-linux-amd64-rootless
  957. repo: gitea/gitea
  958. build_args:
  959. - GOPROXY=https://goproxy.io
  960. password:
  961. from_secret: docker_password
  962. username:
  963. from_secret: docker_username
  964. when:
  965. event:
  966. exclude:
  967. - pull_request
  968. ---
  969. kind: pipeline
  970. name: docker-linux-amd64-release-branch
  971. platform:
  972. os: linux
  973. arch: amd64
  974. depends_on:
  975. - testing-amd64
  976. - testing-arm64
  977. trigger:
  978. ref:
  979. - "refs/heads/release/v*"
  980. event:
  981. exclude:
  982. - cron
  983. steps:
  984. - name: fetch-tags
  985. image: docker:git
  986. pull: always
  987. commands:
  988. - git config --global --add safe.directory /drone/src
  989. - git fetch --tags --force
  990. - name: publish
  991. image: techknowlogick/drone-docker:latest
  992. pull: always
  993. settings:
  994. auto_tag: false
  995. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
  996. repo: gitea/gitea
  997. build_args:
  998. - GOPROXY=https://goproxy.io
  999. password:
  1000. from_secret: docker_password
  1001. username:
  1002. from_secret: docker_username
  1003. when:
  1004. event:
  1005. exclude:
  1006. - pull_request
  1007. - name: publish-rootless
  1008. image: techknowlogick/drone-docker:latest
  1009. settings:
  1010. dockerfile: Dockerfile.rootless
  1011. auto_tag: false
  1012. tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
  1013. repo: gitea/gitea
  1014. build_args:
  1015. - GOPROXY=https://goproxy.io
  1016. password:
  1017. from_secret: docker_password
  1018. username:
  1019. from_secret: docker_username
  1020. when:
  1021. event:
  1022. exclude:
  1023. - pull_request
  1024. ---
  1025. kind: pipeline
  1026. type: docker
  1027. name: docker-linux-arm64-dry-run
  1028. platform:
  1029. os: linux
  1030. arch: arm64
  1031. depends_on:
  1032. - compliance
  1033. trigger:
  1034. ref:
  1035. - "refs/pull/**"
  1036. steps:
  1037. - name: dryrun
  1038. image: techknowlogick/drone-docker:latest
  1039. pull: always
  1040. settings:
  1041. dry_run: true
  1042. repo: gitea/gitea
  1043. tags: linux-arm64
  1044. build_args:
  1045. - GOPROXY=https://goproxy.io
  1046. environment:
  1047. PLUGIN_MIRROR:
  1048. from_secret: plugin_mirror
  1049. when:
  1050. event:
  1051. - pull_request
  1052. ---
  1053. kind: pipeline
  1054. type: docker
  1055. name: docker-linux-arm64-release-version
  1056. platform:
  1057. os: linux
  1058. arch: arm64
  1059. depends_on:
  1060. - testing-amd64
  1061. - testing-arm64
  1062. trigger:
  1063. ref:
  1064. - "refs/tags/**"
  1065. event:
  1066. exclude:
  1067. - cron
  1068. steps:
  1069. - name: fetch-tags
  1070. image: docker:git
  1071. pull: always
  1072. commands:
  1073. - git config --global --add safe.directory /drone/src
  1074. - git fetch --tags --force
  1075. - name: publish
  1076. image: techknowlogick/drone-docker:latest
  1077. pull: always
  1078. settings:
  1079. auto_tag: true
  1080. auto_tag_suffix: linux-arm64
  1081. repo: gitea/gitea
  1082. build_args:
  1083. - GOPROXY=https://goproxy.io
  1084. password:
  1085. from_secret: docker_password
  1086. username:
  1087. from_secret: docker_username
  1088. when:
  1089. event:
  1090. exclude:
  1091. - pull_request
  1092. - name: publish-rootless
  1093. image: techknowlogick/drone-docker:latest
  1094. settings:
  1095. dockerfile: Dockerfile.rootless
  1096. auto_tag: true
  1097. auto_tag_suffix: linux-arm64-rootless
  1098. repo: gitea/gitea
  1099. build_args:
  1100. - GOPROXY=https://goproxy.io
  1101. password:
  1102. from_secret: docker_password
  1103. username:
  1104. from_secret: docker_username
  1105. when:
  1106. event:
  1107. exclude:
  1108. - pull_request
  1109. ---
  1110. kind: pipeline
  1111. type: docker
  1112. name: docker-linux-arm64-release
  1113. platform:
  1114. os: linux
  1115. arch: arm64
  1116. depends_on:
  1117. - testing-amd64
  1118. - testing-arm64
  1119. trigger:
  1120. ref:
  1121. - refs/heads/main
  1122. event:
  1123. exclude:
  1124. - cron
  1125. steps:
  1126. - name: fetch-tags
  1127. image: docker:git
  1128. pull: always
  1129. commands:
  1130. - git config --global --add safe.directory /drone/src
  1131. - git fetch --tags --force
  1132. - name: publish
  1133. image: techknowlogick/drone-docker:latest
  1134. pull: always
  1135. settings:
  1136. auto_tag: false
  1137. tags: dev-linux-arm64
  1138. repo: gitea/gitea
  1139. build_args:
  1140. - GOPROXY=https://goproxy.io
  1141. password:
  1142. from_secret: docker_password
  1143. username:
  1144. from_secret: docker_username
  1145. when:
  1146. event:
  1147. exclude:
  1148. - pull_request
  1149. - name: publish-rootless
  1150. image: techknowlogick/drone-docker:latest
  1151. settings:
  1152. dockerfile: Dockerfile.rootless
  1153. auto_tag: false
  1154. tags: dev-linux-arm64-rootless
  1155. repo: gitea/gitea
  1156. build_args:
  1157. - GOPROXY=https://goproxy.io
  1158. password:
  1159. from_secret: docker_password
  1160. username:
  1161. from_secret: docker_username
  1162. when:
  1163. event:
  1164. exclude:
  1165. - pull_request
  1166. ---
  1167. kind: pipeline
  1168. name: docker-linux-arm64-release-branch
  1169. platform:
  1170. os: linux
  1171. arch: arm64
  1172. depends_on:
  1173. - testing-amd64
  1174. - testing-arm64
  1175. trigger:
  1176. ref:
  1177. - "refs/heads/release/v*"
  1178. event:
  1179. exclude:
  1180. - cron
  1181. steps:
  1182. - name: fetch-tags
  1183. image: docker:git
  1184. pull: always
  1185. commands:
  1186. - git config --global --add safe.directory /drone/src
  1187. - git fetch --tags --force
  1188. - name: publish
  1189. image: techknowlogick/drone-docker:latest
  1190. pull: always
  1191. settings:
  1192. auto_tag: false
  1193. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
  1194. repo: gitea/gitea
  1195. build_args:
  1196. - GOPROXY=https://goproxy.io
  1197. password:
  1198. from_secret: docker_password
  1199. username:
  1200. from_secret: docker_username
  1201. when:
  1202. event:
  1203. exclude:
  1204. - pull_request
  1205. - name: publish-rootless
  1206. image: techknowlogick/drone-docker:latest
  1207. settings:
  1208. dockerfile: Dockerfile.rootless
  1209. auto_tag: false
  1210. tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
  1211. repo: gitea/gitea
  1212. build_args:
  1213. - GOPROXY=https://goproxy.io
  1214. password:
  1215. from_secret: docker_password
  1216. username:
  1217. from_secret: docker_username
  1218. when:
  1219. event:
  1220. exclude:
  1221. - pull_request
  1222. ---
  1223. kind: pipeline
  1224. type: docker
  1225. name: docker-manifest-version
  1226. platform:
  1227. os: linux
  1228. arch: amd64
  1229. steps:
  1230. - name: manifest-rootless
  1231. image: plugins/manifest
  1232. pull: always
  1233. settings:
  1234. auto_tag: true
  1235. ignore_missing: true
  1236. spec: docker/manifest.rootless.tmpl
  1237. password:
  1238. from_secret: docker_password
  1239. username:
  1240. from_secret: docker_username
  1241. - name: manifest
  1242. image: plugins/manifest
  1243. settings:
  1244. auto_tag: true
  1245. ignore_missing: true
  1246. spec: docker/manifest.tmpl
  1247. password:
  1248. from_secret: docker_password
  1249. username:
  1250. from_secret: docker_username
  1251. trigger:
  1252. ref:
  1253. - "refs/tags/**"
  1254. event:
  1255. exclude:
  1256. - cron
  1257. depends_on:
  1258. - docker-linux-amd64-release-version
  1259. - docker-linux-arm64-release-version
  1260. ---
  1261. kind: pipeline
  1262. type: docker
  1263. name: docker-manifest
  1264. platform:
  1265. os: linux
  1266. arch: amd64
  1267. steps:
  1268. - name: manifest-rootless
  1269. pull: always
  1270. image: plugins/manifest
  1271. pull: always
  1272. settings:
  1273. auto_tag: false
  1274. ignore_missing: true
  1275. spec: docker/manifest.rootless.tmpl
  1276. password:
  1277. from_secret: docker_password
  1278. username:
  1279. from_secret: docker_username
  1280. - name: manifest
  1281. image: plugins/manifest
  1282. settings:
  1283. auto_tag: false
  1284. ignore_missing: true
  1285. spec: docker/manifest.tmpl
  1286. password:
  1287. from_secret: docker_password
  1288. username:
  1289. from_secret: docker_username
  1290. trigger:
  1291. ref:
  1292. - refs/heads/main
  1293. - "refs/heads/release/v*"
  1294. event:
  1295. exclude:
  1296. - cron
  1297. depends_on:
  1298. - docker-linux-amd64-release
  1299. - docker-linux-arm64-release
  1300. - docker-linux-amd64-release-branch
  1301. - docker-linux-arm64-release-branch
  1302. ---
  1303. kind: pipeline
  1304. type: docker
  1305. name: notifications
  1306. platform:
  1307. os: linux
  1308. arch: arm64
  1309. clone:
  1310. disable: true
  1311. trigger:
  1312. branch:
  1313. - main
  1314. - "release/*"
  1315. event:
  1316. - push
  1317. - tag
  1318. status:
  1319. - success
  1320. - failure
  1321. depends_on:
  1322. - testing-amd64
  1323. - testing-arm64
  1324. - release-version
  1325. - release-latest
  1326. - docker-linux-amd64-release
  1327. - docker-linux-arm64-release
  1328. - docker-linux-amd64-release-version
  1329. - docker-linux-arm64-release-version
  1330. - docker-linux-amd64-release-branch
  1331. - docker-linux-arm64-release-branch
  1332. - docker-manifest
  1333. - docker-manifest-version
  1334. - docs
  1335. steps:
  1336. - name: discord
  1337. image: appleboy/drone-discord:1.2.4
  1338. pull: always
  1339. settings:
  1340. 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"
  1341. webhook_id:
  1342. from_secret: discord_webhook_id
  1343. webhook_token:
  1344. from_secret: discord_webhook_token