aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Run `go generate` and `go vet` on all packages (#30529) (#30541)Giteabot2024-04-171-3/+2
| | | | | | | | | | | | | | Backport #30529 by @silverwind Fixes: https://github.com/go-gitea/gitea/issues/30512 I think this does mean those tools would run on a potential `vendor` directory, but I'm not sure we really support vendoring of dependencies anymore. `release` has a `vendor` prerequisite so likely the source tarballs contain vendor files? Co-authored-by: silverwind <me@silverwind.io>
* Upgrade fabric to 6.0.0-beta20 (#30121)silverwind2024-03-271-1/+1
| | | | Fixes https://github.com/go-gitea/gitea/issues/29326 because it includes https://github.com/fabricjs/fabric.js/pull/9707.
* Add svg linter and fix incorrect svgs (#30086)silverwind2024-03-261-1/+2
| | | | | | | | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/30082. Adds a new linter that searches for non-existant SVG images in templates. Output before the fix was: ``` $ make lint-templates SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl make: *** [Makefile:438: lint-templates] Error 1 ``` <img width="306" alt="Screenshot 2024-03-25 at 23 31 05" src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">
* remove PATH and GOPATH modification in Makefile (#29978)silverwind2024-03-211-3/+0
| | | | We don't need these modifications anymore since all tool dependencies run via `go run`.
* move some scripts from 'build' to 'tools' directory, misc refactors (#29844)silverwind2024-03-171-7/+9
| | | | | | | | | | | | | | - Move some scripts from `build` to new `tools` dir. Eventually i would like to move all but let's do it step-by-step. - Add dir to eslint and move the files into vars. - Update docs accordingly. - While updating docs I noticed we were incorrectly having `public/img` path still in a few places. Replace those with the current `public/assets/img`. --------- Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix document error about 'make trans-copy' (#29710)Daniel YC Lin2024-03-141-4/+0
| | | | | | | Change document to 'make docs' --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Fix `make generate-swagger` in go 1.22 (#29780)silverwind2024-03-141-1/+1
| | | | | Fixes: https://github.com/go-gitea/gitea/issues/29664. No release available for https://github.com/go-swagger/go-swagger/issues/3070 so let's depend on latest commit hash. Output is the same as before for me.
* Fix bug hidden on CI and make ci failed if tests failure (#29254)Lunny Xiao2024-03-071-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The tests on migration tests failed but CI reports successfully https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141 This PR will fix the bug on migration v283 and also the CI hidden behaviour. The reason is on the Makefile `GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will return the error exit code. But `for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \ GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \ done` will not work. This also fix #29602
* Run editorconfig-checker on `locale_en-US.ini` (#29608)silverwind2024-03-061-1/+2
| | | | | | | Will prevent trailing whitespace etc being introduced in this file. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Regenerate fomantic lockfile and build it with our browserslist (#29560)silverwind2024-03-041-0/+1
| | | | | | | | | | | | | 1. Make fomantic build use [our browserslist](https://github.com/go-gitea/gitea/blob/e3524c63d6d42865ea8288af89b372544d35474b/package.json#L99). I found no other way than to sed-replace into it's js, the normal browserlist config files do not work. The effect of this change is the removal of some uneeded CSS vendor prefixes. 2. Regenerate `web_src/fomantic/package-lock.json`, this might shut up some security scanners. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add tailwindcss (#29357)silverwind2024-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will get tailwindcss working on a basic level. It provides only the utility classes, e.g. no tailwind base which we don't need because we have our own CSS reset. Without the base, we also do not have their CSS variables so a small amount of features do not work and I removed the generated classes for them. ***Note for future developers: This currently uses a `tw-` prefix, so we use it like `tw-p-3`.*** <details> <summary>Currently added CSS, all false-positives</summary> ``` .\!visible{ visibility: visible !important } .visible{ visibility: visible } .invisible{ visibility: hidden } .collapse{ visibility: collapse } .static{ position: static } .\!fixed{ position: fixed !important } .absolute{ position: absolute } .relative{ position: relative } .sticky{ position: sticky } .left-10{ left: 2.5rem } .isolate{ isolation: isolate } .float-right{ float: right } .float-left{ float: left } .mr-2{ margin-right: 0.5rem } .mr-3{ margin-right: 0.75rem } .\!block{ display: block !important } .block{ display: block } .inline-block{ display: inline-block } .inline{ display: inline } .flex{ display: flex } .inline-flex{ display: inline-flex } .\!table{ display: table !important } .inline-table{ display: inline-table } .table-caption{ display: table-caption } .table-cell{ display: table-cell } .table-column{ display: table-column } .table-column-group{ display: table-column-group } .table-footer-group{ display: table-footer-group } .table-header-group{ display: table-header-group } .table-row-group{ display: table-row-group } .table-row{ display: table-row } .flow-root{ display: flow-root } .inline-grid{ display: inline-grid } .contents{ display: contents } .list-item{ display: list-item } .\!hidden{ display: none !important } .hidden{ display: none } .flex-shrink{ flex-shrink: 1 } .shrink{ flex-shrink: 1 } .flex-grow{ flex-grow: 1 } .grow{ flex-grow: 1 } .border-collapse{ border-collapse: collapse } .select-all{ user-select: all } .resize{ resize: both } .flex-wrap{ flex-wrap: wrap } .overflow-visible{ overflow: visible } .rounded{ border-radius: 0.25rem } .border{ border-width: 1px } .text-justify{ text-align: justify } .uppercase{ text-transform: uppercase } .lowercase{ text-transform: lowercase } .capitalize{ text-transform: capitalize } .italic{ font-style: italic } .text-red{ color: var(--color-red) } .text-shadow{ color: var(--color-shadow) } .underline{ text-decoration-line: underline } .overline{ text-decoration-line: overline } .line-through{ text-decoration-line: line-through } .outline{ outline-style: solid } .ease-in{ transition-timing-function: cubic-bezier(0.4, 0, 1, 1) } .ease-in-out{ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) } .ease-out{ transition-timing-function: cubic-bezier(0, 0, 0.2, 1) } ``` </details> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Upgrade to fabric 6 (#29334)silverwind2024-02-231-1/+1
| | | | | | Upgrade fabric to latest v6 beta. It works for our use case, even thought it does not fix the upstream issue https://github.com/fabricjs/fabric.js/issues/9679 that https://github.com/go-gitea/gitea/issues/29326 relates to.
* Don't install playwright twice (#29302)silverwind2024-02-221-2/+1
| | | | | | | | | | | | 1. `playwright/test` is already installed as part of `deps-frontend` on CI which runs before, so it's better to not install it again (on a potentially different version), and just use the version from package.json and add the `deps-frontend` dependency. 2. `PLAYWRIGHT_DIR` is a undefined variable, so I removed it ```bash $ git show c8ded77680db7344c8dc1ccee76bce0b4e02e103 | grep PLAYWRIGHT_DIR +playwright: $(PLAYWRIGHT_DIR) ```
* Refactor more code in templates (#29236)wxiaoguang2024-02-181-2/+2
| | | | | | | | Follow #29165. * Introduce JSONTemplate to help to render JSON templates * Introduce JSEscapeSafe for templates. Now only use `{{ ... | JSEscape}}` instead of `{{ ... | JSEscape | Safe}}` * Simplify "UserLocationMapURL" useage
* Disable parallel Make execution (#29186)silverwind2024-02-161-0/+5
| | | | | | | | Ref: https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html > If the .NOTPARALLEL special target with no prerequisites is specified anywhere then the entire instance of make will be run serially, regardless of the parallel setting
* bump to use go 1.22 (#29119)techknowlogick2024-02-141-2/+2
|
* add lint-spell-fix to lint-fix (#29111)silverwind2024-02-091-1/+1
| | | | Followup to https://github.com/go-gitea/gitea/pull/29106, fix this oversight.
* Rework spellchecking, add `lint-spell` (#29106)silverwind2024-02-091-7/+15
| | | | | | | | | | | - Use maintained fork https://github.com/golangci/misspell - Rename `mispell-check` to `lint-spell`, add `lint-spell-fix` - Run `lint-spell` in separate actions step - Lint more files, fix discovered issues - Remove inaccurate and outdated info in docs (we do not need GOPATH for tools anymore) Maybe later we can add more spellchecking tools, but I have not found any good ones yet.
* Update tool dependencies (#29030)silverwind2024-02-021-5/+5
|
* Add `--no-root` to `update-py` (#27937)silverwind2023-11-061-1/+1
| | | Missed this command in https://github.com/go-gitea/gitea/pull/27919.
* Install poetry dependencies with --no-root (#27919)silverwind2023-11-061-1/+1
| | | | | | | | Poetry 1.7.0 or higher will print a warning otherwise, see discussions: https://github.com/python-poetry/poetry/pull/8369 https://github.com/python-poetry/poetry/issues/1132 > --no-root Do not install the root package (the current project).
* Upgrade to golangci-lint@v1.55.0 (#27756)silverwind2023-10-241-1/+1
| | | https://github.com/golangci/golangci-lint/releases/tag/v1.55.0
* Remove network call on `make clean` (#27689)techknowlogick2023-10-191-1/+0
| | | | | fix #27653 credit to silverwind for finding issue
* Remove .exe suffix when cross-compiling on Windows (#27448)Sergey Zolotarev2023-10-061-4/+8
| | | | | | | | When compiling GItea for Linux on Windows, you get a `gitea.exe` file as output, but because it's a Linux executable, the `.exe` extension is unnecessary. This PR adds a check for `GOOS` environment variable in addition to `OS`.
* Require MySQL 8.0, PostgreSQL 12, MSSQL 2012 (#27337)silverwind2023-10-031-57/+7
| | | | | | | | | | | | | | | | | | | | | | | - MySQL 5.7 support and testing is dropped - MySQL tests now execute against 8.1, up from 5.7 and 8.0 - PostgreSQL 10 and 11 support ist dropped - PostgreSQL tests now execute against 16, up from 15 - MSSQL 2008 support is dropped - MSSQL tests now run against locked 2022 version Fixes: https://github.com/go-gitea/gitea/issues/25657 Ref: https://endoflife.date/mysql Ref: https://endoflife.date/postgresql Ref: https://endoflife.date/mssqlserver ## :warning: BREAKING :warning: Support for MySQL 5.7, PostgreSQL 10 and 11, and MSSQL 2008 is dropped. You are encouraged to upgrade to supported versions. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Update JS and Poetry dependencies and eslint (#27200)silverwind2023-09-221-0/+4
| | | | | | | - Update all JS and Poetry dependencies - Remove deprecated `eslint-plugin-custom-elements` and replace it with rules from `eslint-plugin-wc` - Add a convenience `make update` to update both js and py dependencies - Tested markdown toolbar, swagger and citation
* Add `yamllint` (#26965)silverwind2023-09-071-0/+5
| | | | | | | | | So that https://github.com/go-gitea/gitea/pull/26964 does not happen again. Merge this after that PR. Config is based on [node's](https://github.com/nodejs/node/blob/main/.yamllint.yaml). --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Update tool dependencies (#26607)silverwind2023-08-201-2/+2
| | | | | | - Updated all tool dependencies to latest versions - Add Makefile to `swagger` files because it specifies `go-swagger` version - Fix lint
* bump go to 1.21 (#26608)techknowlogick2023-08-211-1/+1
| | | Co-authored-by: Giteabot <teabot@gitea.io>
* Update govulncheck, fix typo (#26168)silverwind2023-07-261-4/+4
| | | | - Update govulncheck to latest version - Fix typo in variable name
* Docusaurus-ify (#26051)John Olheiser2023-07-261-13/+6
| | | | | | | | | | | | | | This PR cleans up the docs in a way to make them simpler to ingest by our [docs repo](https://gitea.com/gitea/gitea-docusaurus). 1. It includes all of the sed invocations our ingestion did, removing the need to do it at build time. 2. It replaces the shortcode variable replacement method with `@variable@` style, simply for easier sed invocations when required. 3. It removes unused files and moves the docs up a level as cleanup. --------- Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move public asset files to the proper directory (#25907)wxiaoguang2023-07-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move `public/*` to `public/assets/*` Some old PRs (like #15219) introduced inconsistent directory system. For example: why the local directory "public" is accessed by `http://site/assets`? How to serve the ".well-known" files properly in the public directory? For convention rules, the "public" directory is widely used for the website's root directory. It shouldn't be an exception for Gitea. So, this PR makes the things consistent: * `http://site/assets/foo` means `{CustomPath}/public/assets/foo`. * `{CustomPath}/public/.well-known` and `{CustomPath}/public/robots.txt` can be used in the future. This PR is also a prerequisite for a clear solution for: * #21942 * #25892 * discourse.gitea.io: [.well-known path serving custom files behind proxy?](https://discourse.gitea.io/t/well-known-path-serving-custom-files-behind-proxy/5445/1) This PR is breaking for users who have custom "public" files (CSS/JS). After getting approvals, I will update the documents. ---- ## ⚠️ BREAKING ⚠️ If you have files in your "custom/public/" folder, please move them to "custom/public/assets/". --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Update tool dependencies, lock govulncheck and actionlint (#25655)silverwind2023-07-091-5/+5
| | | | | | | | | | - Update all tool dependencies - Lock `govulncheck` and `actionlint` to their latest tags --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix `lint-swagger` action (#25593)silverwind2023-06-291-2/+2
| | | | | - Add detection for swagger changes and run `lint-swagger` on it - Remove `lint-swagger` from `lint-frontend` - Remove `lint-md` from `lint-frontend`
* Update JS dependencies and misc tweaks (#25540)silverwind2023-06-271-4/+6
| | | | | | | | | | | | - Update all JS dependencies - Enable `declaration-property-unit-disallowed-list` to forbid `em` on `line-height` - Rename dependency update targets to `update-js` and `update-py` and document them - Remove margin on Asciicast viewer - Tested Swagger, Katex, Asciicast <img width="1243" alt="Screenshot 2023-06-27 at 19 51 05" src="https://github.com/go-gitea/gitea/assets/115237/2d2722a0-2aa7-4f4c-b8bd-17e1f3637b78">
* Add `make poetry-update`, upgrade `djlint` (#25399)silverwind2023-06-261-1/+8
| | | | | | [updates](https://github.com/silverwind/updates) now supports poetry as well so we can use it for a new `make poetry-update` to update all poetry dependencies.
* Gitea version in Makefile (#25456)John Olheiser2023-06-231-1/+1
| | | | | | | | | | As title, this is how it was inferred before https://github.com/go-gitea/gitea/blob/e24f651c86a5168da8181f2c75f5f99b56561224/Makefile#L83-L84 We moved to actions, however `GITEA_VERSION` should still work to use `VERSION` Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Use Actions git context instead of dynamically created buildkit one (#25381)techknowlogick2023-06-201-4/+3
| | | | | | | | | | The [docker/build-push-action@v2 action](https://github.com/docker/build-push-action) by default ignores the checkout created using the actions/checkout@v2 action. When you pass a git build context to docker build, it wouldn't include the .git directory. By passing `context: .` to the build step then it'll use the Actions git context which includes the git fetch from the earlier step.
* fix a nit error output in Makefile (#25360)a10121127962023-06-181-1/+1
| | | | | | fix ``make: write error: stdout`` ref: https://stackoverflow.com/questions/70671525/write-error-stdout-when-calling-make-from-makefile
* use Actions environment variables in Makefile (#25319)techknowlogick2023-06-171-5/+5
|
* Build nightly binaries with Actions (#25308)techknowlogick2023-06-161-12/+0
| | | Co-authored-by: silverwind <me@silverwind.io>
* Add template linting via djlint (#25212)silverwind2023-06-141-1/+14
| | | | | | | | | | | | | | | | | | So I found this [linter](https://github.com/Riverside-Healthcare/djlint) which features a mode for go templates, so I gave it a try and it did find a number of valid issue, like unbalanced tags etc. It also has a number of bugs, I had to disable/workaround many issues. Given that this linter is written in python, this does add a dependency on `python` >= 3.8 and `poetry` to the development environment to be able to run this linter locally. - `e.g.` prefixes on placeholders are removed because the linter had a false-positive on `placeholder="e.g. cn=Search"` for the `attr=value` syntax and it's not ideal anyways to write `e.g.` into a placeholder because a placeholder is meant to hold a sample value. - In `templates/repo/settings/options.tmpl` I simplified the logic to not conditionally create opening tags without closing tags because this stuff confuses the linter (and possibly the reader as well).
* Remove the service worker (#25010)silverwind2023-05-311-1/+1
| | | | | | | | | | | | | It's been disabled by default since 1.17 (https://github.com/go-gitea/gitea/pull/18914), and it never really delivered any benefit except being another cache layer that has its own unsolved invalidation issues. HTTP cache works, we don't need two cache layers at the browser for assets. ## :warning: BREAKING You can remove the config `[ui].USE_SERVICE_WORKER` from your `app.ini` now.
* Use file filters action instead of Github's files filter (#24877)Lunny Xiao2023-05-251-0/+7
| | | | | | | | | | | | | | | Inspired by https://github.com/go-gitea/gitea/pull/24530#issuecomment-1558815301 This PR use a file filter action to do different CI jobs according changed files types. All types are defined in `.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`, `frontend` and `build`. Then if a PR only changed docs files, those CI jobs which passed the conditions will run, and other types are also like this. --------- Co-authored-by: silverwind <me@silverwind.io>
* Reduce verbosity of dev commands (#24917)silverwind2023-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | ### Before ``` $ make watch bash build/watch.sh make[1]: Entering directory '/Users/silverwind/git/gitea' make[1]: Entering directory '/Users/silverwind/git/gitea' GITEA_RUN_MODE=dev go run github.com/cosmtrek/air@v1.43.0 -c .air.toml rm -rf public/js public/css public/fonts public/img/webpack public/serviceworker.js NODE_ENV=development npx webpack --watch --progress ``` ### After ``` $ make watch GITEA_RUN_MODE=dev go run github.com/cosmtrek/air@v1.43.0 -c .air.toml NODE_ENV=development npx webpack --watch --progress ```
* Run stylelint on .vue files (#24865)silverwind2023-05-231-2/+2
| | | | | | | - Run stylelint on .vue files - Fix discovered issues - Suppress warning spam from `declaration-strict-value` rule Co-authored-by: Giteabot <teabot@gitea.io>
* GitHub Actions cleanups (#24620)silverwind2023-05-111-2/+2
| | | | | | | | | | - Remove actions name where command is descriptive enough - Use kebab-case instead of snake-case for step names - Use shorter job names because to make PR checks more readable - Remove duplicate `checks-backend` --------- Co-authored-by: Yarden Shoham <git@yardenshoham.com>
* Makefile: Use portable !, not GNUish -not, with find(1). (#24565)riastradh2023-05-071-1/+1
| | | | | fix https://github.com/go-gitea/gitea/issues/24564 Co-authored-by: Taylor R Campbell <campbell+gitea@mumble.net>
* Unify nightly naming across binaries and docker images (#24116)techknowlogick2023-04-241-0/+5
| | | | | | | | Proposal found here: https://github.com/go-gitea/gitea/issues/23654 TODO: make non-breaking (can we publish docker image using dev and nightly prefix? at same time). if anyone has advice please comment :) If this PR is merged, then I can add redirects to the downloads site.
* Replace whitespace inside template parens during make fmt (#24293)silverwind2023-04-241-2/+6
| | | | Remove space/tab after `(` and before `)` in templates. Only two violations it seems.