Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

.drone.yml 29KB

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