Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 155fb93b9b | |||
| 3a8c792303 | |||
| 807c64800c | |||
| 6ddb2dcd57 | |||
| 729ab80065 | |||
| a5ea9b4f30 | |||
| 8f08ccdb9f | |||
| 10d73d38e0 | |||
| fbb424c61d | |||
| e8bac94d1f | |||
| 99c6556ff3 |
@@ -1,26 +0,0 @@
|
|||||||
root = "."
|
|
||||||
tmp_dir = ".air"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs
|
|
||||||
cmd = "make --no-print-directory backend"
|
|
||||||
entrypoint = ["./gitea"]
|
|
||||||
delay = 2000
|
|
||||||
include_ext = ["go", "tmpl"]
|
|
||||||
include_file = ["main.go"]
|
|
||||||
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
|
|
||||||
exclude_dir = [
|
|
||||||
"models/fixtures",
|
|
||||||
"models/migrations/fixtures",
|
|
||||||
"modules/avatar/identicon/testdata",
|
|
||||||
"modules/avatar/testdata",
|
|
||||||
"modules/git/tests",
|
|
||||||
"modules/migration/file_format_testdata",
|
|
||||||
"routers/private/tests",
|
|
||||||
"services/gitdiff/testdata",
|
|
||||||
]
|
|
||||||
exclude_regex = ["_test.go$", "_gen.go$"]
|
|
||||||
stop_on_error = true
|
|
||||||
|
|
||||||
[log]
|
|
||||||
main_only = true
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
# The full repository name
|
|
||||||
repo: go-gitea/gitea
|
|
||||||
|
|
||||||
# Service type (gitea or github)
|
|
||||||
service: github
|
|
||||||
|
|
||||||
# Base URL for Gitea instance if using gitea service type (optional)
|
|
||||||
# Default: https://gitea.com
|
|
||||||
base-url:
|
|
||||||
|
|
||||||
# Changelog groups and which labeled PRs to add to each group
|
|
||||||
groups:
|
|
||||||
-
|
|
||||||
name: BREAKING
|
|
||||||
labels:
|
|
||||||
- pr/breaking
|
|
||||||
-
|
|
||||||
name: SECURITY
|
|
||||||
labels:
|
|
||||||
- topic/security
|
|
||||||
-
|
|
||||||
name: FEATURES
|
|
||||||
labels:
|
|
||||||
- type/feature
|
|
||||||
-
|
|
||||||
name: ENHANCEMENTS
|
|
||||||
labels:
|
|
||||||
- type/enhancement
|
|
||||||
-
|
|
||||||
name: PERFORMANCE
|
|
||||||
labels:
|
|
||||||
- performance/memory
|
|
||||||
- performance/speed
|
|
||||||
- performance/bigrepo
|
|
||||||
- performance/cpu
|
|
||||||
-
|
|
||||||
name: BUGFIXES
|
|
||||||
labels:
|
|
||||||
- type/bug
|
|
||||||
|
|
||||||
-
|
|
||||||
name: TESTING
|
|
||||||
labels:
|
|
||||||
- type/testing
|
|
||||||
-
|
|
||||||
name: BUILD
|
|
||||||
labels:
|
|
||||||
- topic/build
|
|
||||||
- topic/code-linting
|
|
||||||
-
|
|
||||||
name: DOCS
|
|
||||||
labels:
|
|
||||||
- type/docs
|
|
||||||
-
|
|
||||||
name: MISC
|
|
||||||
default: true
|
|
||||||
|
|
||||||
# regex indicating which labels to skip for the changelog
|
|
||||||
skip-labels: skip-changelog|backport\/.+
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Gitea DevContainer",
|
|
||||||
"image": "mcr.microsoft.com/devcontainers/go:1.26-trixie",
|
|
||||||
"containerEnv": {
|
|
||||||
// override "local" from packaged version
|
|
||||||
"GOTOOLCHAIN": "auto"
|
|
||||||
},
|
|
||||||
"features": {
|
|
||||||
// installs nodejs into container
|
|
||||||
"ghcr.io/devcontainers/features/node:1": {
|
|
||||||
"version": "latest"
|
|
||||||
},
|
|
||||||
"ghcr.io/devcontainers/features/git-lfs:1.2.5": {},
|
|
||||||
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
|
|
||||||
"ghcr.io/devcontainers/features/python:1": {
|
|
||||||
"version": "3.14"
|
|
||||||
},
|
|
||||||
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
|
|
||||||
},
|
|
||||||
"customizations": {
|
|
||||||
"vscode": {
|
|
||||||
"settings": {},
|
|
||||||
"extensions": [
|
|
||||||
"editorconfig.editorconfig",
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"golang.go",
|
|
||||||
"stylelint.vscode-stylelint",
|
|
||||||
"DavidAnson.vscode-markdownlint",
|
|
||||||
"Vue.volar",
|
|
||||||
"ms-azuretools.vscode-docker",
|
|
||||||
"vitest.explorer",
|
|
||||||
"cweijan.vscode-database-client2",
|
|
||||||
"GitHub.vscode-pull-request-github",
|
|
||||||
"Azurite.azurite"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"portsAttributes": {
|
|
||||||
"3000": {
|
|
||||||
"label": "Gitea Web",
|
|
||||||
"onAutoForward": "notify"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"postCreateCommand": "make deps"
|
|
||||||
}
|
|
||||||
+5
-90
@@ -1,90 +1,5 @@
|
|||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
*
|
||||||
*.o
|
!gitea
|
||||||
*.a
|
!docker
|
||||||
*.so
|
!public
|
||||||
|
!templates
|
||||||
# Folders
|
|
||||||
_obj
|
|
||||||
_test
|
|
||||||
|
|
||||||
# IntelliJ
|
|
||||||
.idea
|
|
||||||
# Goland's output filename can not be set manually
|
|
||||||
/go_build_*
|
|
||||||
|
|
||||||
# MS VSCode
|
|
||||||
.vscode
|
|
||||||
__debug_bin*
|
|
||||||
|
|
||||||
# Architecture specific extensions/prefixes
|
|
||||||
*.[568vq]
|
|
||||||
[568vq].out
|
|
||||||
|
|
||||||
*.cgo1.go
|
|
||||||
*.cgo2.c
|
|
||||||
_cgo_defun.c
|
|
||||||
_cgo_gotypes.go
|
|
||||||
_cgo_export.*
|
|
||||||
|
|
||||||
_testmain.go
|
|
||||||
|
|
||||||
*.exe
|
|
||||||
*.test
|
|
||||||
*.prof
|
|
||||||
|
|
||||||
*coverage.out
|
|
||||||
coverage.all
|
|
||||||
cpu.out
|
|
||||||
|
|
||||||
*.db
|
|
||||||
*.log
|
|
||||||
|
|
||||||
/gitea
|
|
||||||
/debug
|
|
||||||
|
|
||||||
/bin
|
|
||||||
/dist
|
|
||||||
/custom/*
|
|
||||||
!/custom/conf
|
|
||||||
/custom/conf/*
|
|
||||||
!/custom/conf/app.example.ini
|
|
||||||
/data
|
|
||||||
/indexers
|
|
||||||
/log
|
|
||||||
/tests/integration/gitea-integration-*
|
|
||||||
/tests/*.ini
|
|
||||||
/node_modules
|
|
||||||
/yarn.lock
|
|
||||||
/yarn-error.log
|
|
||||||
/npm-debug.log*
|
|
||||||
/pnpm-debug.log*
|
|
||||||
/public/assets/js
|
|
||||||
/public/assets/css
|
|
||||||
/public/assets/fonts
|
|
||||||
/public/assets/img/avatar
|
|
||||||
/vendor
|
|
||||||
/VERSION
|
|
||||||
/.air
|
|
||||||
/.go-licenses
|
|
||||||
/Dockerfile
|
|
||||||
/Dockerfile.rootless
|
|
||||||
/.venv
|
|
||||||
|
|
||||||
# Files and folders that were previously generated
|
|
||||||
/public/assets/img/webpack
|
|
||||||
|
|
||||||
# Snapcraft
|
|
||||||
snap/.snapcraft/
|
|
||||||
parts/
|
|
||||||
stage/
|
|
||||||
prime/
|
|
||||||
*.snap
|
|
||||||
*.snap-build
|
|
||||||
*_source.tar.bz2
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Make evidence files
|
|
||||||
/.make_evidence
|
|
||||||
|
|
||||||
# Manpage
|
|
||||||
/man
|
|
||||||
|
|||||||
+150
@@ -0,0 +1,150 @@
|
|||||||
|
workspace:
|
||||||
|
base: /srv/app
|
||||||
|
path: src/code.gitea.io/gitea
|
||||||
|
|
||||||
|
pipeline:
|
||||||
|
clone:
|
||||||
|
image: plugins/git
|
||||||
|
tags: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
image: webhippie/golang:edge
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite bindata
|
||||||
|
GOPATH: /srv/app
|
||||||
|
commands:
|
||||||
|
- apk -U add openssh-client
|
||||||
|
- make clean
|
||||||
|
- make generate
|
||||||
|
- make vet
|
||||||
|
- make lint
|
||||||
|
- make test
|
||||||
|
- make build
|
||||||
|
when:
|
||||||
|
event: [ push, tag, pull_request ]
|
||||||
|
|
||||||
|
test-mysql:
|
||||||
|
image: webhippie/golang:edge
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite bindata
|
||||||
|
GOPATH: /srv/app
|
||||||
|
commands:
|
||||||
|
- make test-mysql
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
|
||||||
|
test-pgsql:
|
||||||
|
image: webhippie/golang:edge
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite bindata
|
||||||
|
GOPATH: /srv/app
|
||||||
|
commands:
|
||||||
|
- make test-pgsql
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
|
||||||
|
updater:
|
||||||
|
image: karalabe/xgo-latest:latest
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
TAGS: sqlite bindata
|
||||||
|
GOPATH: /srv/app
|
||||||
|
commands:
|
||||||
|
- make release
|
||||||
|
when:
|
||||||
|
event: [ push, tag ]
|
||||||
|
branch: [ master, release/*, refs/tags/* ]
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
image: plugins/coverage
|
||||||
|
server: https://coverage.gitea.io
|
||||||
|
when:
|
||||||
|
event: [ push, tag, pull_request ]
|
||||||
|
|
||||||
|
docker:
|
||||||
|
image: plugins/docker
|
||||||
|
repo: gitea/gitea
|
||||||
|
tags: [ '${DRONE_TAG##v}' ]
|
||||||
|
when:
|
||||||
|
event: [ tag ]
|
||||||
|
branch: [ refs/tags/* ]
|
||||||
|
|
||||||
|
docker:
|
||||||
|
image: plugins/docker
|
||||||
|
repo: gitea/gitea
|
||||||
|
tags: [ '${DRONE_BRANCH##release/v}' ]
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
branch: [ release/* ]
|
||||||
|
|
||||||
|
docker:
|
||||||
|
image: plugins/docker
|
||||||
|
repo: gitea/gitea
|
||||||
|
tags: [ 'latest' ]
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
branch: [ master ]
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: plugins/s3
|
||||||
|
path_style: true
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
source: dist/release/*
|
||||||
|
target: /gitea/${DRONE_TAG##v}
|
||||||
|
when:
|
||||||
|
event: [ tag ]
|
||||||
|
branch: [ refs/tags/* ]
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: plugins/s3
|
||||||
|
path_style: true
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
source: dist/release/*
|
||||||
|
target: /gitea/${DRONE_BRANCH##release/v}
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
branch: [ release/* ]
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: plugins/s3
|
||||||
|
path_style: true
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
source: dist/release/*
|
||||||
|
target: /gitea/master
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
branch: [ master ]
|
||||||
|
|
||||||
|
github:
|
||||||
|
image: plugins/github-release
|
||||||
|
files:
|
||||||
|
- dist/release/*
|
||||||
|
when:
|
||||||
|
event: [ tag ]
|
||||||
|
branch: [ refs/tags/* ]
|
||||||
|
|
||||||
|
gitter:
|
||||||
|
image: plugins/gitter
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=test
|
||||||
|
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
|
|
||||||
|
pgsql:
|
||||||
|
image: postgres:9.5
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=test
|
||||||
|
when:
|
||||||
|
event: [ push ]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9zcnYvYXBwCiAgcGF0aDogc3JjL2NvZGUuZ2l0ZWEuaW8vZ2l0ZWEKCnBpcGVsaW5lOgogIGNsb25lOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0CiAgICB0YWdzOiB0cnVlCgogIHRlc3Q6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgQ0dPX0VOQUJMRUQ6IDEKICAgICAgVEFHUzogc3FsaXRlIGJpbmRhdGEKICAgICAgR09QQVRIOiAvc3J2L2FwcAogICAgY29tbWFuZHM6CiAgICAgIC0gYXBrIC1VIGFkZCBvcGVuc3NoLWNsaWVudAogICAgICAtIG1ha2UgY2xlYW4KICAgICAgLSBtYWtlIGdlbmVyYXRlCiAgICAgIC0gbWFrZSB2ZXQKICAgICAgLSBtYWtlIGxpbnQKICAgICAgLSBtYWtlIHRlc3QKICAgICAgLSBtYWtlIGJ1aWxkCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCgogIHRlc3QtbXlzcWw6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgQ0dPX0VOQUJMRUQ6IDEKICAgICAgVEFHUzogc3FsaXRlIGJpbmRhdGEKICAgICAgR09QQVRIOiAvc3J2L2FwcAogICAgY29tbWFuZHM6CiAgICAgIC0gbWFrZSB0ZXN0LW15c3FsCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KCiAgdGVzdC1wZ3NxbDoKICAgIGltYWdlOiB3ZWJoaXBwaWUvZ29sYW5nOmVkZ2UKICAgIHB1bGw6IHRydWUKICAgIGVudmlyb25tZW50OgogICAgICBDR09fRU5BQkxFRDogMQogICAgICBUQUdTOiBzcWxpdGUgYmluZGF0YQogICAgICBHT1BBVEg6IC9zcnYvYXBwCiAgICBjb21tYW5kczoKICAgICAgLSBtYWtlIHRlc3QtcGdzcWwKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQoKICB1cGRhdGVyOgogICAgaW1hZ2U6IGthcmFsYWJlL3hnby1sYXRlc3Q6bGF0ZXN0CiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgQ0dPX0VOQUJMRUQ6IDEKICAgICAgVEFHUzogc3FsaXRlIGJpbmRhdGEKICAgICAgR09QQVRIOiAvc3J2L2FwcAogICAgY29tbWFuZHM6CiAgICAgIC0gbWFrZSByZWxlYXNlCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcgXQogICAgICBicmFuY2g6IFsgbWFzdGVyLCByZWxlYXNlLyosIHJlZnMvdGFncy8qIF0KCiAgY292ZXJhZ2U6CiAgICBpbWFnZTogcGx1Z2lucy9jb3ZlcmFnZQogICAgc2VydmVyOiBodHRwczovL2NvdmVyYWdlLmdpdGVhLmlvCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCgogIGRvY2tlcjoKICAgIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogICAgcmVwbzogZ2l0ZWEvZ2l0ZWEKICAgIHRhZ3M6IFsgJyR7RFJPTkVfVEFHIyN2fScgXQogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBnaXRlYS9naXRlYQogICAgdGFnczogWyAnJHtEUk9ORV9CUkFOQ0gjI3JlbGVhc2Uvdn0nIF0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQogICAgICBicmFuY2g6IFsgcmVsZWFzZS8qIF0KCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBnaXRlYS9naXRlYQogICAgdGFnczogWyAnbGF0ZXN0JyBdCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIHJlbGVhc2U6CiAgICBpbWFnZTogcGx1Z2lucy9zMwogICAgcGF0aF9zdHlsZTogdHJ1ZQogICAgc3RyaXBfcHJlZml4OiBkaXN0L3JlbGVhc2UvCiAgICBzb3VyY2U6IGRpc3QvcmVsZWFzZS8qCiAgICB0YXJnZXQ6IC9naXRlYS8ke0RST05FX1RBRyMjdn0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHRhZyBdCiAgICAgIGJyYW5jaDogWyByZWZzL3RhZ3MvKiBdCgogIHJlbGVhc2U6CiAgICBpbWFnZTogcGx1Z2lucy9zMwogICAgcGF0aF9zdHlsZTogdHJ1ZQogICAgc3RyaXBfcHJlZml4OiBkaXN0L3JlbGVhc2UvCiAgICBzb3VyY2U6IGRpc3QvcmVsZWFzZS8qCiAgICB0YXJnZXQ6IC9naXRlYS8ke0RST05FX0JSQU5DSCMjcmVsZWFzZS92fQogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCBdCiAgICAgIGJyYW5jaDogWyByZWxlYXNlLyogXQoKICByZWxlYXNlOgogICAgaW1hZ2U6IHBsdWdpbnMvczMKICAgIHBhdGhfc3R5bGU6IHRydWUKICAgIHN0cmlwX3ByZWZpeDogZGlzdC9yZWxlYXNlLwogICAgc291cmNlOiBkaXN0L3JlbGVhc2UvKgogICAgdGFyZ2V0OiAvZ2l0ZWEvbWFzdGVyCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIGdpdGh1YjoKICAgIGltYWdlOiBwbHVnaW5zL2dpdGh1Yi1yZWxlYXNlCiAgICBmaWxlczoKICAgICAgLSBkaXN0L3JlbGVhc2UvKgogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KCiAgZ2l0dGVyOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0dGVyCgpzZXJ2aWNlczoKICBteXNxbDoKICAgIGltYWdlOiBteXNxbDo1LjcKICAgIGVudmlyb25tZW50OgogICAgICAtIE1ZU1FMX0RBVEFCQVNFPXRlc3QKICAgICAgLSBNWVNRTF9BTExPV19FTVBUWV9QQVNTV09SRD15ZXMKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQoKICBwZ3NxbDoKICAgIGltYWdlOiBwb3N0Z3Jlczo5LjUKICAgIGVudmlyb25tZW50OgogICAgICAtIFBPU1RHUkVTX0RCPXRlc3QKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQo.NGE3UiNBappXiPimJXv1DzgjT3k2hofGPsCPhw7KsSM
|
||||||
+13
-19
@@ -1,36 +1,30 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
tab_width = 2
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.{go,tmpl,html}]
|
[*.go]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
indent_size = 8
|
||||||
|
|
||||||
[go.*]
|
[*.{tmpl,html}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[templates/custom/*.tmpl]
|
[*.{less,yml}]
|
||||||
insert_final_newline = false
|
|
||||||
|
|
||||||
[templates/swagger/*_json.tmpl]
|
|
||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = false
|
indent_size = 4
|
||||||
|
|
||||||
[templates/user/auth/oidc_wellknown.tmpl]
|
[*.js]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
[templates/shared/actions/runner_badge_*.tmpl]
|
|
||||||
# editconfig lint requires these XML-like files to have charset defined, but the files don't have.
|
|
||||||
charset = unset
|
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[*.svg]
|
[*.md]
|
||||||
insert_final_newline = false
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
* text=auto eol=lf
|
|
||||||
*.tmpl linguist-language=Handlebars
|
|
||||||
*.pb.go linguist-generated
|
|
||||||
/assets/*.json linguist-generated
|
|
||||||
/public/assets/img/svg/*.svg linguist-generated
|
|
||||||
/templates/swagger/v1_json.tmpl linguist-generated
|
|
||||||
/options/fileicon/** linguist-generated
|
|
||||||
/vendor/** -text -eol linguist-vendored
|
|
||||||
/web_src/js/vendor/** -text -eol linguist-vendored
|
|
||||||
Dockerfile.* linguist-language=Dockerfile
|
|
||||||
Makefile.* linguist-language=Makefile
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
open_collective: gitea
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
name: Bug Report
|
|
||||||
description: Found something you weren't expecting? Report it here!
|
|
||||||
labels: ["type/bug"]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
1. Please speak English, this is the language all maintainers can speak and write.
|
|
||||||
2. Please ask questions or configuration/deploy problems on our Discord
|
|
||||||
server (https://discord.gg/gitea) or forum (https://forum.gitea.com).
|
|
||||||
3. Make sure you are using the latest release and
|
|
||||||
take a moment to check that your issue hasn't been reported before.
|
|
||||||
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
|
|
||||||
5. It's really important to provide pertinent details and logs (https://docs.gitea.com/help/support),
|
|
||||||
incomplete details will be handled as an invalid report.
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: |
|
|
||||||
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
|
|
||||||
If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services.
|
|
||||||
- type: input
|
|
||||||
id: gitea-ver
|
|
||||||
attributes:
|
|
||||||
label: Gitea Version
|
|
||||||
description: Gitea version (or commit reference) of your instance
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: can-reproduce
|
|
||||||
attributes:
|
|
||||||
label: Can you reproduce the bug on the Gitea demo site?
|
|
||||||
description: |
|
|
||||||
If so, please provide a URL in the Description field
|
|
||||||
URL of Gitea demo: https://demo.gitea.com
|
|
||||||
options:
|
|
||||||
- "Yes"
|
|
||||||
- "No"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
It's really important to provide pertinent logs
|
|
||||||
Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help
|
|
||||||
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini
|
|
||||||
- type: input
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: Log Gist
|
|
||||||
description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden
|
|
||||||
- type: textarea
|
|
||||||
id: screenshots
|
|
||||||
attributes:
|
|
||||||
label: Screenshots
|
|
||||||
description: If this issue involves the Web Interface, please provide one or more screenshots
|
|
||||||
- type: input
|
|
||||||
id: git-ver
|
|
||||||
attributes:
|
|
||||||
label: Git Version
|
|
||||||
description: The version of git running on the server
|
|
||||||
- type: input
|
|
||||||
id: os-ver
|
|
||||||
attributes:
|
|
||||||
label: Operating System
|
|
||||||
description: The operating system you are using to run Gitea
|
|
||||||
- type: textarea
|
|
||||||
id: run-info
|
|
||||||
attributes:
|
|
||||||
label: How are you running Gitea?
|
|
||||||
description: |
|
|
||||||
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://demo.gitea.com or are using some other package
|
|
||||||
Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc.
|
|
||||||
If you are using a package or systemd tell us what distribution you are using
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: database
|
|
||||||
attributes:
|
|
||||||
label: Database
|
|
||||||
description: What database system are you running?
|
|
||||||
options:
|
|
||||||
- PostgreSQL
|
|
||||||
- MySQL/MariaDB
|
|
||||||
- MSSQL
|
|
||||||
- SQLite
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Security Concern
|
|
||||||
url: https://tinyurl.com/security-gitea
|
|
||||||
about: For security concerns, please send a mail to security@gitea.io instead of opening a public issue.
|
|
||||||
- name: Discord Server
|
|
||||||
url: https://discord.gg/Gitea
|
|
||||||
about: Please ask questions and discuss configuration or deployment problems here.
|
|
||||||
- name: Discourse Forum
|
|
||||||
url: https://forum.gitea.com
|
|
||||||
about: Questions and configuration or deployment problems can also be discussed on our forum.
|
|
||||||
- name: Frequently Asked Questions
|
|
||||||
url: https://docs.gitea.com/help/faq
|
|
||||||
about: Please check if your question isn't mentioned here.
|
|
||||||
- name: Crowdin Translations
|
|
||||||
url: https://translate.gitea.com
|
|
||||||
about: Translations are managed here.
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: Feature Request
|
|
||||||
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
|
|
||||||
labels: ["type/proposal"]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
1. Please speak English, this is the language all maintainers can speak and write.
|
|
||||||
2. Please ask questions or configuration/deploy problems on our Discord
|
|
||||||
server (https://discord.gg/gitea) or forum (https://forum.gitea.com).
|
|
||||||
3. Please take a moment to check that your feature hasn't already been suggested.
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Feature Description
|
|
||||||
placeholder: |
|
|
||||||
I think it would be great if Gitea had...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: screenshots
|
|
||||||
attributes:
|
|
||||||
label: Screenshots
|
|
||||||
description: If you can, provide screenshots of an implementation on another site e.g. GitHub
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
name: Web Interface Bug Report
|
|
||||||
description: Something doesn't look quite as it should? Report it here!
|
|
||||||
labels: ["type/bug", "topic/ui"]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
1. Please speak English, this is the language all maintainers can speak and write.
|
|
||||||
2. Please ask questions or configuration/deploy problems on our Discord
|
|
||||||
server (https://discord.gg/gitea) or forum (https://forum.gitea.com).
|
|
||||||
3. Please take a moment to check that your issue doesn't already exist.
|
|
||||||
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
|
|
||||||
5. Please give all relevant information below for bug reports, because
|
|
||||||
incomplete details will be handled as an invalid report.
|
|
||||||
6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript
|
|
||||||
error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us
|
|
||||||
DEBUG level logs. (See https://docs.gitea.com/administration/logging-config#collecting-logs-for-help)
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: |
|
|
||||||
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
|
|
||||||
If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services.
|
|
||||||
- type: textarea
|
|
||||||
id: screenshots
|
|
||||||
attributes:
|
|
||||||
label: Screenshots
|
|
||||||
description: Please provide at least 1 screenshot showing the issue.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: gitea-ver
|
|
||||||
attributes:
|
|
||||||
label: Gitea Version
|
|
||||||
description: Gitea version (or commit reference) your instance is running
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: can-reproduce
|
|
||||||
attributes:
|
|
||||||
label: Can you reproduce the bug on the Gitea demo site?
|
|
||||||
description: |
|
|
||||||
If so, please provide a URL in the Description field
|
|
||||||
URL of Gitea demo: https://demo.gitea.com
|
|
||||||
options:
|
|
||||||
- "Yes"
|
|
||||||
- "No"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: os-ver
|
|
||||||
attributes:
|
|
||||||
label: Operating System
|
|
||||||
description: The operating system you are using to access Gitea
|
|
||||||
- type: input
|
|
||||||
id: browser-ver
|
|
||||||
attributes:
|
|
||||||
label: Browser Version
|
|
||||||
description: The browser and version that you are using to access Gitea
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
self-hosted-runner:
|
|
||||||
labels:
|
|
||||||
- actuated-4cpu-8gb
|
|
||||||
- actuated-4cpu-16gb
|
|
||||||
- nscloud
|
|
||||||
- namespace-profile-gitea-release-docker
|
|
||||||
- namespace-profile-gitea-release-binary
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
name: docker-dryrun
|
|
||||||
description: Composite action that performs the container build steps for a single platform.
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
platform:
|
|
||||||
description: "The target platform: linux/amd64, linux/arm64, linux/riscv64."
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
||||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
||||||
- name: Build regular image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: ${{ inputs.platform }}
|
|
||||||
push: false
|
|
||||||
file: Dockerfile
|
|
||||||
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful
|
|
||||||
- name: Build rootless image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: ${{ inputs.platform }}
|
|
||||||
push: false
|
|
||||||
file: Dockerfile.rootless
|
|
||||||
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
name: go-caches
|
|
||||||
description: Restore and save go module, build, and golangci-lint caches
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
cache-name:
|
|
||||||
description: Short identifier used in the per-caller build cache key
|
|
||||||
required: true
|
|
||||||
build-cache:
|
|
||||||
description: Whether to include ~/.cache/go-build
|
|
||||||
default: "true"
|
|
||||||
build-cache-rotate:
|
|
||||||
description: Whether to rotate the build cache key per run so Go's test result cache can accumulate across runs
|
|
||||||
default: "false"
|
|
||||||
lint-cache:
|
|
||||||
description: Whether to include ~/.cache/golangci-lint
|
|
||||||
default: "false"
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: gomod-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.sum') }}
|
|
||||||
restore-keys: gomod-${{ runner.os }}-${{ runner.arch }}
|
|
||||||
- if: ${{ inputs.build-cache == 'true' && inputs.build-cache-rotate == 'true' }}
|
|
||||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: gobuild-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cache-name }}-${{ hashFiles('go.sum') }}-${{ github.run_id }}
|
|
||||||
restore-keys: |
|
|
||||||
gobuild-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cache-name }}-${{ hashFiles('go.sum') }}
|
|
||||||
gobuild-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cache-name }}
|
|
||||||
gobuild-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.sum') }}
|
|
||||||
gobuild-${{ runner.os }}-${{ runner.arch }}
|
|
||||||
- if: ${{ inputs.build-cache == 'true' && inputs.build-cache-rotate != 'true' }}
|
|
||||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: gobuild-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.sum') }}
|
|
||||||
restore-keys: gobuild-${{ runner.os }}-${{ runner.arch }}
|
|
||||||
- if: ${{ inputs.lint-cache == 'true' }}
|
|
||||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
||||||
with:
|
|
||||||
path: ~/.cache/golangci-lint
|
|
||||||
key: golangci-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cache-name }}-${{ hashFiles('go.sum', '.golangci.yml') }}
|
|
||||||
restore-keys: golangci-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cache-name }}
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
1. Please speak English, this is the language everybody of us can speak and write.
|
||||||
|
2. Please ask questions or config/deploy problems on our Gitter channel: https://gitter.im/go-gitea/gitea
|
||||||
|
3. Please take a moment to search that an issue doesn't already exist.
|
||||||
|
4. Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.
|
||||||
|
|
||||||
|
**You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.**
|
||||||
|
|
||||||
|
- Gitea version (or commit ref):
|
||||||
|
- Git version:
|
||||||
|
- Operating system:
|
||||||
|
- Database (use `[x]`):
|
||||||
|
- [ ] PostgreSQL
|
||||||
|
- [ ] MySQL
|
||||||
|
- [ ] SQLite
|
||||||
|
- Can you reproduce the bug at https://try.gitea.io:
|
||||||
|
- [ ] Yes (provide example URL)
|
||||||
|
- [ ] No
|
||||||
|
- [ ] Not relevant
|
||||||
|
- Log gist:
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
...
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
docs-update-needed:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- "custom/conf/app.example.ini"
|
|
||||||
|
|
||||||
topic/code-linting:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- ".golangci.yml"
|
|
||||||
- ".markdownlint.yaml"
|
|
||||||
- ".spectral.yaml"
|
|
||||||
- ".yamllint.yaml"
|
|
||||||
- "eslint*.config.*"
|
|
||||||
- "stylelint.config.*"
|
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
<!-- start tips -->
|
|
||||||
Please check the following:
|
Please check the following:
|
||||||
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
|
|
||||||
2. Use a Conventional Commits PR title, for example `fix(repo): handle empty branch names`.
|
1. Make sure you are targeting the `master` branch, pull requests on release branches are only allowed for bug fixes.
|
||||||
3. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
|
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md
|
||||||
4. For documentations contribution, please go to https://gitea.com/gitea/docs
|
3. Describe what your pull request does and which issue you're targeting (if any)
|
||||||
5. Describe what your pull request does and which issue you're targeting (if any).
|
|
||||||
6. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
|
**You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.**
|
||||||
7. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
|
|
||||||
8. Delete all these tips before posting.
|
|
||||||
<!-- end tips -->
|
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
# Populates the go module, build, and golangci-lint caches under the default
|
|
||||||
# branch's cache scope so that PR runs have a warm fallback to restore from.
|
|
||||||
#
|
|
||||||
# GitHub Actions caches are scoped per ref: a PR run can only write to its own
|
|
||||||
# branch's scope, but can read from the base branch's scope as a fallback.
|
|
||||||
# PRs therefore cannot seed main's scope themselves. Running the same cache
|
|
||||||
# steps on push-to-main is the only opportunity to populate that fallback
|
|
||||||
# scope so fresh PR branches start with a useful cache on first run.
|
|
||||||
|
|
||||||
# A PR job's exact key lives in its own PR-scope (empty on first run, filled
|
|
||||||
# by later runs of the same PR); on miss, actions/cache's restore-keys fall
|
|
||||||
# back to prefix matches against entries this seeder saves in main's scope.
|
|
||||||
|
|
||||||
name: cache-seeder
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- "go.sum"
|
|
||||||
- ".golangci.yml"
|
|
||||||
- ".github/actions/go-cache/action.yml"
|
|
||||||
- ".github/workflows/cache-seeder.yml"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: cache-seeder
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gobuild:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: seed
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: TAGS="bindata" make backend
|
|
||||||
- run: TAGS="bindata gogit" GOEXPERIMENT="" make backend
|
|
||||||
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- { job: lint-backend, tags: "bindata", target: "lint-backend" }
|
|
||||||
- { job: lint-go-windows, tags: "bindata", target: "lint-go-windows" }
|
|
||||||
- { job: lint-go-gogit, tags: "bindata gogit", target: "lint-go" }
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: ${{ matrix.job }}
|
|
||||||
lint-cache: "true"
|
|
||||||
- run: make deps-backend deps-tools
|
|
||||||
- run: make ${{ matrix.target }}
|
|
||||||
env:
|
|
||||||
TAGS: ${{ matrix.tags }}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
name: cron-licenses
|
|
||||||
|
|
||||||
on:
|
|
||||||
# schedule:
|
|
||||||
# - cron: "7 0 * * 1" # every Monday at 00:07 UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cron-licenses:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'go-gitea/gitea'
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- run: make generate-gitignore
|
|
||||||
timeout-minutes: 40
|
|
||||||
- name: push translations to repo
|
|
||||||
uses: appleboy/git-push-action@3b2c8661652360dbf1afe1b319a49dbb739c39f1 # v1.2.0
|
|
||||||
with:
|
|
||||||
author_email: "teabot@gitea.io"
|
|
||||||
author_name: GiteaBot
|
|
||||||
branch: main
|
|
||||||
commit: true
|
|
||||||
commit_message: "[skip ci] Updated licenses and gitignores"
|
|
||||||
remote: "git@github.com:go-gitea/gitea.git"
|
|
||||||
ssh_key: ${{ secrets.DEPLOY_KEY }}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
name: cron-renovate
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "23 * * * *" # hourly at :23
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: cron-renovate
|
|
||||||
|
|
||||||
env:
|
|
||||||
RENOVATE_VERSION: 43.141.5 # renovate: datasource=docker depName=ghcr.io/renovatebot/renovate
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cron-renovate:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'go-gitea/gitea' # prevent running on forks
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: renovatebot/github-action@f66d8679fcfcfa051abde6e7a623007173bf5164 # v46.1.12
|
|
||||||
with:
|
|
||||||
renovate-version: ${{ env.RENOVATE_VERSION }}
|
|
||||||
configurationFile: renovate.json5
|
|
||||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
|
||||||
env:
|
|
||||||
RENOVATE_BINARY_SOURCE: install # auto-install go/node toolchains needed by post-upgrade tasks.
|
|
||||||
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^make (tidy|svg nolyfill)$"]'
|
|
||||||
RENOVATE_REPOSITORIES: '["go-gitea/gitea"]'
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
name: cron-translations
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "7 0 * * *" # every day at 00:07 UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
crowdin-pull:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'go-gitea/gitea'
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: crowdin/github-action@8868a33591d21088edfc398968173a3b98d51706 # v2.16.2
|
|
||||||
with:
|
|
||||||
upload_sources: true
|
|
||||||
upload_translations: false
|
|
||||||
download_sources: false
|
|
||||||
download_translations: true
|
|
||||||
push_translations: false
|
|
||||||
push_sources: false
|
|
||||||
create_pull_request: false
|
|
||||||
config: crowdin.yml
|
|
||||||
env:
|
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
||||||
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
|
|
||||||
- name: update locales
|
|
||||||
run: ./build/update-locales.sh
|
|
||||||
- name: push translations to repo
|
|
||||||
uses: appleboy/git-push-action@3b2c8661652360dbf1afe1b319a49dbb739c39f1 # v1.2.0
|
|
||||||
with:
|
|
||||||
author_email: "teabot@gitea.io"
|
|
||||||
author_name: GiteaBot
|
|
||||||
branch: main
|
|
||||||
commit: true
|
|
||||||
commit_message: "[skip ci] Updated translations via Crowdin"
|
|
||||||
remote: "git@github.com:go-gitea/gitea.git"
|
|
||||||
ssh_key: ${{ secrets.DEPLOY_KEY }}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
name: files-changed
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
outputs:
|
|
||||||
backend:
|
|
||||||
value: ${{ jobs.detect.outputs.backend }}
|
|
||||||
frontend:
|
|
||||||
value: ${{ jobs.detect.outputs.frontend }}
|
|
||||||
docs:
|
|
||||||
value: ${{ jobs.detect.outputs.docs }}
|
|
||||||
actions:
|
|
||||||
value: ${{ jobs.detect.outputs.actions }}
|
|
||||||
templates:
|
|
||||||
value: ${{ jobs.detect.outputs.templates }}
|
|
||||||
docker:
|
|
||||||
value: ${{ jobs.detect.outputs.docker }}
|
|
||||||
dockerfile:
|
|
||||||
value: ${{ jobs.detect.outputs.dockerfile }}
|
|
||||||
swagger:
|
|
||||||
value: ${{ jobs.detect.outputs.swagger }}
|
|
||||||
yaml:
|
|
||||||
value: ${{ jobs.detect.outputs.yaml }}
|
|
||||||
json:
|
|
||||||
value: ${{ jobs.detect.outputs.json }}
|
|
||||||
e2e:
|
|
||||||
value: ${{ jobs.detect.outputs.e2e }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
detect:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 3
|
|
||||||
outputs:
|
|
||||||
backend: ${{ steps.changes.outputs.backend }}
|
|
||||||
frontend: ${{ steps.changes.outputs.frontend }}
|
|
||||||
docs: ${{ steps.changes.outputs.docs }}
|
|
||||||
actions: ${{ steps.changes.outputs.actions }}
|
|
||||||
templates: ${{ steps.changes.outputs.templates }}
|
|
||||||
docker: ${{ steps.changes.outputs.docker }}
|
|
||||||
dockerfile: ${{ steps.changes.outputs.dockerfile }}
|
|
||||||
swagger: ${{ steps.changes.outputs.swagger }}
|
|
||||||
yaml: ${{ steps.changes.outputs.yaml }}
|
|
||||||
json: ${{ steps.changes.outputs.json }}
|
|
||||||
e2e: ${{ steps.changes.outputs.e2e }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
|
|
||||||
id: changes
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
backend:
|
|
||||||
- "**/*.go"
|
|
||||||
- "templates/**/*.tmpl"
|
|
||||||
- "assets/emoji.json"
|
|
||||||
- "go.mod"
|
|
||||||
- "go.sum"
|
|
||||||
- "Makefile"
|
|
||||||
- ".golangci.yml"
|
|
||||||
- ".editorconfig"
|
|
||||||
- "options/locale/locale_en-US.json"
|
|
||||||
|
|
||||||
frontend:
|
|
||||||
- "*.js"
|
|
||||||
- "*.ts"
|
|
||||||
- "web_src/**"
|
|
||||||
- "tools/*.js"
|
|
||||||
- "tools/*.ts"
|
|
||||||
- "assets/emoji.json"
|
|
||||||
- "package.json"
|
|
||||||
- "pnpm-lock.yaml"
|
|
||||||
- "Makefile"
|
|
||||||
- ".eslintrc.cjs"
|
|
||||||
- ".npmrc"
|
|
||||||
|
|
||||||
docs:
|
|
||||||
- "**/*.md"
|
|
||||||
- ".markdownlint.yaml"
|
|
||||||
- "package.json"
|
|
||||||
- "pnpm-lock.yaml"
|
|
||||||
|
|
||||||
actions:
|
|
||||||
- ".github/workflows/*"
|
|
||||||
- "Makefile"
|
|
||||||
|
|
||||||
templates:
|
|
||||||
- "tools/lint-templates-*.js"
|
|
||||||
- "templates/**/*.tmpl"
|
|
||||||
- "pyproject.toml"
|
|
||||||
- "uv.lock"
|
|
||||||
|
|
||||||
docker:
|
|
||||||
- ".github/workflows/pull-docker-dryrun.yml"
|
|
||||||
- "Dockerfile"
|
|
||||||
- "Dockerfile.rootless"
|
|
||||||
- "docker/**"
|
|
||||||
- "Makefile"
|
|
||||||
|
|
||||||
dockerfile:
|
|
||||||
- "Dockerfile"
|
|
||||||
- "Dockerfile.rootless"
|
|
||||||
|
|
||||||
swagger:
|
|
||||||
- "templates/swagger/v1_json.tmpl"
|
|
||||||
- "templates/swagger/v1_input.json"
|
|
||||||
- "Makefile"
|
|
||||||
- "package.json"
|
|
||||||
- "pnpm-lock.yaml"
|
|
||||||
- ".spectral.yaml"
|
|
||||||
|
|
||||||
yaml:
|
|
||||||
- "**/*.yml"
|
|
||||||
- "**/*.yaml"
|
|
||||||
- ".yamllint.yaml"
|
|
||||||
- "pyproject.toml"
|
|
||||||
|
|
||||||
json:
|
|
||||||
- "**/*.json"
|
|
||||||
|
|
||||||
e2e:
|
|
||||||
- "tests/e2e/**"
|
|
||||||
- "tools/test-e2e.sh"
|
|
||||||
- "playwright.config.ts"
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
name: compliance
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
files-changed:
|
|
||||||
uses: ./.github/workflows/files-changed.yml
|
|
||||||
|
|
||||||
lint-backend:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: lint-backend
|
|
||||||
lint-cache: "true"
|
|
||||||
- run: make deps-backend deps-tools
|
|
||||||
- run: make lint-backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
|
|
||||||
lint-on-demand:
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
|
|
||||||
- run: make lint-spell
|
|
||||||
|
|
||||||
- if: needs.files-changed.outputs.templates == 'true' || needs.files-changed.outputs.yaml == 'true'
|
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
||||||
- if: needs.files-changed.outputs.templates == 'true' || needs.files-changed.outputs.yaml == 'true'
|
|
||||||
run: uv python install 3.14 && make deps-py lint-templates lint-yaml
|
|
||||||
|
|
||||||
- if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.swagger == 'true' || needs.files-changed.outputs.json == 'true'
|
|
||||||
run: make deps-frontend lint-md lint-swagger lint-json
|
|
||||||
|
|
||||||
- if: needs.files-changed.outputs.actions == 'true'
|
|
||||||
run: make lint-actions
|
|
||||||
|
|
||||||
lint-go-windows:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: lint-go-windows
|
|
||||||
lint-cache: "true"
|
|
||||||
- run: make deps-backend deps-tools
|
|
||||||
- run: make lint-go-windows
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
GOOS: windows
|
|
||||||
GOARCH: amd64
|
|
||||||
|
|
||||||
lint-go-gogit:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: lint-go-gogit
|
|
||||||
lint-cache: "true"
|
|
||||||
- run: make deps-backend deps-tools
|
|
||||||
- run: make lint-go
|
|
||||||
env:
|
|
||||||
TAGS: bindata gogit
|
|
||||||
|
|
||||||
checks-backend:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: checks-backend
|
|
||||||
build-cache: "false"
|
|
||||||
- run: make deps-backend deps-tools
|
|
||||||
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
|
|
||||||
|
|
||||||
frontend:
|
|
||||||
if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
- run: make deps-frontend
|
|
||||||
- run: make lint-frontend
|
|
||||||
- run: make checks-frontend
|
|
||||||
- run: make test-frontend
|
|
||||||
- run: make frontend
|
|
||||||
|
|
||||||
backend:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: compliance-backend
|
|
||||||
- run: make deps-backend generate-go
|
|
||||||
# no frontend build here as backend should be able to build, even without any frontend files
|
|
||||||
# CGO is not used when cross-compile, so these steps also test if the code is compatible with CGO disabled
|
|
||||||
- name: build-backend-arm64
|
|
||||||
run: go build -o gitea_linux_arm64
|
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: arm64
|
|
||||||
TAGS: bindata gogit
|
|
||||||
- name: build-backend-windows
|
|
||||||
run: go build -o gitea_windows
|
|
||||||
env:
|
|
||||||
GOOS: windows
|
|
||||||
GOARCH: amd64
|
|
||||||
TAGS: bindata gogit
|
|
||||||
- name: build-backend-386
|
|
||||||
run: go build -o gitea_linux_386
|
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: 386
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
name: db-tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
files-changed:
|
|
||||||
uses: ./.github/workflows/files-changed.yml
|
|
||||||
|
|
||||||
test-pgsql:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
pgsql:
|
|
||||||
image: postgres:14
|
|
||||||
env:
|
|
||||||
POSTGRES_DB: test
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
ldap:
|
|
||||||
image: gitea/test-openldap:latest
|
|
||||||
ports:
|
|
||||||
- "389:389"
|
|
||||||
- "636:636"
|
|
||||||
minio:
|
|
||||||
# as github actions doesn't support "entrypoint", we need to use a non-official image
|
|
||||||
# that has a custom entrypoint set to "minio server /data"
|
|
||||||
image: bitnamilegacy/minio:2023.12.23
|
|
||||||
env:
|
|
||||||
MINIO_ROOT_USER: 123456
|
|
||||||
MINIO_ROOT_PASSWORD: 12345678
|
|
||||||
ports:
|
|
||||||
- "9000:9000"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: pgsql
|
|
||||||
- name: Add hosts to /etc/hosts
|
|
||||||
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: run migration tests
|
|
||||||
run: GITEA_TEST_DATABASE=pgsql make test-migration
|
|
||||||
- name: run tests
|
|
||||||
run: GITEA_TEST_DATABASE=pgsql make test-integration
|
|
||||||
timeout-minutes: 50
|
|
||||||
env:
|
|
||||||
# pgsql is chosen to be the unlucky one to run with the slow "race detector", it is about 60% slower.
|
|
||||||
GOTEST_FLAGS: -race -timeout=40m
|
|
||||||
TAGS: bindata gogit
|
|
||||||
TEST_LDAP: 1
|
|
||||||
|
|
||||||
test-sqlite:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: sqlite
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata gogit
|
|
||||||
GOEXPERIMENT:
|
|
||||||
- name: run migration tests
|
|
||||||
run: GITEA_TEST_DATABASE=sqlite make test-migration
|
|
||||||
env:
|
|
||||||
TAGS: bindata gogit
|
|
||||||
- name: run tests
|
|
||||||
run: GITEA_TEST_DATABASE=sqlite make test-integration
|
|
||||||
timeout-minutes: 50
|
|
||||||
env:
|
|
||||||
# sqlite driver can contain large amount of Golang code, so don't use race detector for it, otherwise, extremely slow
|
|
||||||
GOTEST_FLAGS: -timeout=40m
|
|
||||||
TAGS: bindata gogit
|
|
||||||
GOEXPERIMENT:
|
|
||||||
|
|
||||||
test-unit:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
elasticsearch:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.14
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
xpack.security.enabled: false
|
|
||||||
ports:
|
|
||||||
- "9200:9200"
|
|
||||||
meilisearch:
|
|
||||||
image: getmeili/meilisearch:v1
|
|
||||||
env:
|
|
||||||
MEILI_ENV: development # disable auth
|
|
||||||
ports:
|
|
||||||
- "7700:7700"
|
|
||||||
redis:
|
|
||||||
image: redis
|
|
||||||
options: >- # wait until redis has started
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 5s
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 10
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
minio:
|
|
||||||
image: bitnamilegacy/minio:2021.12.29
|
|
||||||
env:
|
|
||||||
MINIO_ACCESS_KEY: 123456
|
|
||||||
MINIO_SECRET_KEY: 12345678
|
|
||||||
ports:
|
|
||||||
- "9000:9000"
|
|
||||||
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
|
|
||||||
image: mcr.microsoft.com/azure-storage/azurite:latest
|
|
||||||
ports:
|
|
||||||
- 10000:10000
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: unit
|
|
||||||
build-cache-rotate: "true"
|
|
||||||
- name: Add hosts to /etc/hosts
|
|
||||||
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 minio devstoreaccount1.azurite.local mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: unit-tests
|
|
||||||
run: make test-backend test-check
|
|
||||||
env:
|
|
||||||
GOTEST_FLAGS: -race -timeout=20m
|
|
||||||
TAGS: bindata
|
|
||||||
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
|
|
||||||
- name: unit-tests-gogit
|
|
||||||
run: make test-backend test-check
|
|
||||||
env:
|
|
||||||
GOTEST_FLAGS: -race -timeout=20m
|
|
||||||
TAGS: bindata gogit
|
|
||||||
GOEXPERIMENT:
|
|
||||||
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
|
|
||||||
|
|
||||||
test-mysql:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
mysql:
|
|
||||||
# the bitnami mysql image has more options than the official one, it's easier to customize
|
|
||||||
image: bitnamilegacy/mysql:8.4
|
|
||||||
env:
|
|
||||||
ALLOW_EMPTY_PASSWORD: true
|
|
||||||
MYSQL_DATABASE: testgitea
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
options: >-
|
|
||||||
--mount type=tmpfs,destination=/bitnami/mysql/data
|
|
||||||
elasticsearch:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.14
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
xpack.security.enabled: false
|
|
||||||
ports:
|
|
||||||
- "9200:9200"
|
|
||||||
smtpimap:
|
|
||||||
image: tabascoterrier/docker-imap-devel:latest
|
|
||||||
ports:
|
|
||||||
- "25:25"
|
|
||||||
- "143:143"
|
|
||||||
- "587:587"
|
|
||||||
- "993:993"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: mysql
|
|
||||||
- name: Add hosts to /etc/hosts
|
|
||||||
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: run migration tests
|
|
||||||
run: GITEA_TEST_DATABASE=mysql make test-migration
|
|
||||||
- name: run tests
|
|
||||||
run: GITEA_TEST_DATABASE=mysql make test-integration
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
|
|
||||||
|
|
||||||
test-mssql:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
mssql:
|
|
||||||
image: mcr.microsoft.com/mssql/server:2019-latest
|
|
||||||
env:
|
|
||||||
ACCEPT_EULA: Y
|
|
||||||
MSSQL_PID: Standard
|
|
||||||
SA_PASSWORD: MwantsaSecurePassword1
|
|
||||||
ports:
|
|
||||||
- "1433:1433"
|
|
||||||
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
|
|
||||||
image: mcr.microsoft.com/azure-storage/azurite:latest
|
|
||||||
ports:
|
|
||||||
- 10000:10000
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: mssql
|
|
||||||
- name: Add hosts to /etc/hosts
|
|
||||||
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql devstoreaccount1.azurite.local" | sudo tee -a /etc/hosts'
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: GITEA_TEST_DATABASE=mssql make test-migration
|
|
||||||
- name: run tests
|
|
||||||
run: GITEA_TEST_DATABASE=mssql make test-integration
|
|
||||||
timeout-minutes: 50
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
name: docker-dryrun
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
files-changed:
|
|
||||||
uses: ./.github/workflows/files-changed.yml
|
|
||||||
|
|
||||||
# QEMU-based build is slow (40-50 minutes), so run arm64 and riscv64 when dockerfile changes.
|
|
||||||
# Run amd64 when any docker-related files change, which is fast (4 minutes).
|
|
||||||
container-amd64:
|
|
||||||
if: needs.files-changed.outputs.docker == 'true'
|
|
||||||
needs: [files-changed]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: ./.github/actions/docker-dryrun
|
|
||||||
with:
|
|
||||||
platform: linux/amd64
|
|
||||||
|
|
||||||
container-arm64:
|
|
||||||
if: needs.files-changed.outputs.dockerfile == 'true'
|
|
||||||
needs: [files-changed]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: ./.github/actions/docker-dryrun
|
|
||||||
with:
|
|
||||||
platform: linux/arm64
|
|
||||||
|
|
||||||
container-riscv64:
|
|
||||||
if: needs.files-changed.outputs.dockerfile == 'true'
|
|
||||||
needs: [files-changed]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: ./.github/actions/docker-dryrun
|
|
||||||
with:
|
|
||||||
platform: linux/riscv64
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
name: e2e-tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
files-changed:
|
|
||||||
uses: ./.github/workflows/files-changed.yml
|
|
||||||
|
|
||||||
test-e2e:
|
|
||||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.e2e == 'true'
|
|
||||||
needs: files-changed
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
cache: false
|
|
||||||
- uses: ./.github/actions/go-cache
|
|
||||||
with:
|
|
||||||
cache-name: e2e
|
|
||||||
build-cache: "false"
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
- run: make deps-frontend
|
|
||||||
- run: make frontend
|
|
||||||
- run: make deps-backend
|
|
||||||
- run: make backend
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- run: make playwright
|
|
||||||
- run: make test-e2e
|
|
||||||
timeout-minutes: 10
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
FORCE_COLOR: 1
|
|
||||||
GITEA_TEST_E2E_DEBUG: 1
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
name: labeler
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
labeler:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
|
|
||||||
with:
|
|
||||||
sync-labels: true
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
name: pr-title
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- edited
|
|
||||||
- reopened
|
|
||||||
- synchronize
|
|
||||||
- ready_for_review
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint-pr-title:
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- run: make lint-pr-title
|
|
||||||
env:
|
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
name: release-nightly
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, release/v*]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
nightly-binary:
|
|
||||||
runs-on: namespace-profile-gitea-release-binary
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
- run: make deps-frontend deps-backend
|
|
||||||
# xgo build
|
|
||||||
- run: make release
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: import gpg key
|
|
||||||
id: import_gpg
|
|
||||||
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
|
||||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
|
||||||
- name: sign binaries
|
|
||||||
run: |
|
|
||||||
for f in dist/release/*; do
|
|
||||||
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
|
|
||||||
done
|
|
||||||
# clean branch name to get the folder name in S3
|
|
||||||
- name: Get cleaned branch name
|
|
||||||
id: clean_name
|
|
||||||
run: |
|
|
||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
|
||||||
echo "Cleaned name is ${REF_NAME}"
|
|
||||||
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: configure aws
|
|
||||||
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
|
|
||||||
with:
|
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
- name: upload binaries to s3
|
|
||||||
run: |
|
|
||||||
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
|
||||||
|
|
||||||
nightly-container:
|
|
||||||
runs-on: namespace-profile-gitea-release-docker
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write # to publish to ghcr.io
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
||||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
||||||
- name: Get cleaned branch name
|
|
||||||
id: clean_name
|
|
||||||
run: |
|
|
||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
|
||||||
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
tags: |
|
|
||||||
type=raw,value=${{ steps.clean_name.outputs.branch }}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta_rootless
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
# each tag below will have the suffix of -rootless
|
|
||||||
flavor: |
|
|
||||||
suffix=-rootless
|
|
||||||
tags: |
|
|
||||||
type=raw,value=${{ steps.clean_name.outputs.branch }}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Login to GHCR using PAT
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: build regular docker image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
|
||||||
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful
|
|
||||||
cache-to: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful,mode=max
|
|
||||||
- name: build rootless docker image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
file: Dockerfile.rootless
|
|
||||||
tags: ${{ steps.meta_rootless.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta_rootless.outputs.annotations }}
|
|
||||||
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless
|
|
||||||
cache-to: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless,mode=max
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
name: release-tag-rc
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v1*-rc*"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
binary:
|
|
||||||
runs-on: namespace-profile-gitea-release-binary
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
- run: make deps-frontend deps-backend
|
|
||||||
# xgo build
|
|
||||||
- run: make release
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: import gpg key
|
|
||||||
id: import_gpg
|
|
||||||
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
|
||||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
|
||||||
- name: sign binaries
|
|
||||||
run: |
|
|
||||||
for f in dist/release/*; do
|
|
||||||
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
|
|
||||||
done
|
|
||||||
# clean branch name to get the folder name in S3
|
|
||||||
- name: Get cleaned branch name
|
|
||||||
id: clean_name
|
|
||||||
run: |
|
|
||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
|
|
||||||
echo "Cleaned name is ${REF_NAME}"
|
|
||||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: configure aws
|
|
||||||
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
|
|
||||||
with:
|
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
- name: upload binaries to s3
|
|
||||||
run: |
|
|
||||||
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
|
||||||
- name: Install GH CLI
|
|
||||||
uses: dev-hanz-ops/install-gh-cli-action@af38ce09b1ec248aeb08eea2b16bbecea9e059f8 # v0.2.1
|
|
||||||
with:
|
|
||||||
gh-cli-version: 2.39.1
|
|
||||||
- name: create github release
|
|
||||||
run: |
|
|
||||||
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
|
|
||||||
container:
|
|
||||||
runs-on: namespace-profile-gitea-release-docker
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write # to publish to ghcr.io
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
||||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
# 1.2.3-rc0
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta_rootless
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
# each tag below will have the suffix of -rootless
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
suffix=-rootless
|
|
||||||
# 1.2.3-rc0
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Login to GHCR using PAT
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: build regular container image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
|
||||||
- name: build rootless container image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
file: Dockerfile.rootless
|
|
||||||
tags: ${{ steps.meta_rootless.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta_rootless.outputs.annotations }}
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
name: release-tag-version
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v1.*"
|
|
||||||
- "!v1*-rc*"
|
|
||||||
- "!v1*-dev"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
binary:
|
|
||||||
runs-on: namespace-profile-gitea-release-binary
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write # to publish to ghcr.io
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
|
||||||
- run: make deps-frontend deps-backend
|
|
||||||
# xgo build
|
|
||||||
- run: make release
|
|
||||||
env:
|
|
||||||
TAGS: bindata
|
|
||||||
- name: import gpg key
|
|
||||||
id: import_gpg
|
|
||||||
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
|
||||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
|
||||||
- name: sign binaries
|
|
||||||
run: |
|
|
||||||
for f in dist/release/*; do
|
|
||||||
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
|
|
||||||
done
|
|
||||||
# clean branch name to get the folder name in S3
|
|
||||||
- name: Get cleaned branch name
|
|
||||||
id: clean_name
|
|
||||||
run: |
|
|
||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
|
|
||||||
echo "Cleaned name is ${REF_NAME}"
|
|
||||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: configure aws
|
|
||||||
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
|
|
||||||
with:
|
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
- name: upload binaries to s3
|
|
||||||
run: |
|
|
||||||
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
|
||||||
- name: Install GH CLI
|
|
||||||
uses: dev-hanz-ops/install-gh-cli-action@af38ce09b1ec248aeb08eea2b16bbecea9e059f8 # v0.2.1
|
|
||||||
with:
|
|
||||||
gh-cli-version: 2.39.1
|
|
||||||
- name: create github release
|
|
||||||
run: |
|
|
||||||
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-from-tag dist/release/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
|
|
||||||
container:
|
|
||||||
runs-on: namespace-profile-gitea-release-docker
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write # to publish to ghcr.io
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
||||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
||||||
- run: git fetch --unshallow --quiet --tags --force
|
|
||||||
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
||||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
# this will generate tags in the following format:
|
|
||||||
# latest
|
|
||||||
# 1
|
|
||||||
# 1.2
|
|
||||||
# 1.2.3
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
||||||
id: meta_rootless
|
|
||||||
with:
|
|
||||||
images: |-
|
|
||||||
gitea/gitea
|
|
||||||
ghcr.io/go-gitea/gitea
|
|
||||||
# each tag below will have the suffix of -rootless
|
|
||||||
flavor: |
|
|
||||||
suffix=-rootless,onlatest=true
|
|
||||||
# this will generate tags in the following format (with -rootless suffix added):
|
|
||||||
# latest
|
|
||||||
# 1
|
|
||||||
# 1.2
|
|
||||||
# 1.2.3
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
annotations: |
|
|
||||||
org.opencontainers.image.authors="maintainers@gitea.io"
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Login to GHCR using PAT
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: build regular container image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
|
||||||
- name: build rootless container image
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
|
||||||
push: true
|
|
||||||
file: Dockerfile.rootless
|
|
||||||
tags: ${{ steps.meta_rootless.outputs.tags }}
|
|
||||||
annotations: ${{ steps.meta_rootless.outputs.annotations }}
|
|
||||||
+9
-86
@@ -9,24 +9,10 @@ _test
|
|||||||
|
|
||||||
# IntelliJ
|
# IntelliJ
|
||||||
.idea
|
.idea
|
||||||
.run
|
|
||||||
|
|
||||||
# IntelliJ Gateway
|
# Architecture specific extensions/prefixes
|
||||||
.uuid
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
# Goland's output filename can not be set manually
|
|
||||||
/go_build_*
|
|
||||||
/gitea_*
|
|
||||||
|
|
||||||
# MS VSCode
|
|
||||||
.vscode
|
|
||||||
__debug_bin*
|
|
||||||
|
|
||||||
# Visual Studio
|
|
||||||
/.vs/
|
|
||||||
|
|
||||||
# mise version managment tool
|
|
||||||
mise.toml
|
|
||||||
|
|
||||||
*.cgo1.go
|
*.cgo1.go
|
||||||
*.cgo2.c
|
*.cgo2.c
|
||||||
@@ -39,84 +25,21 @@ _testmain.go
|
|||||||
*.exe
|
*.exe
|
||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
*coverage.out
|
coverage.out
|
||||||
coverage.all
|
|
||||||
cpu.out
|
|
||||||
|
|
||||||
/modules/migration/bindata.*
|
/modules/options/bindata.go
|
||||||
/modules/options/bindata.*
|
/modules/public/bindata.go
|
||||||
/modules/public/bindata.*
|
/modules/templates/bindata.go
|
||||||
/modules/templates/bindata.*
|
|
||||||
|
|
||||||
*.db
|
*.db
|
||||||
*.log
|
*.log
|
||||||
*.log.*.gz
|
|
||||||
|
|
||||||
/gitea
|
/gitea
|
||||||
/debug
|
|
||||||
|
|
||||||
/bin
|
/bin
|
||||||
/dist
|
/dist
|
||||||
/custom/*
|
/custom
|
||||||
!/custom/conf/app.example.ini
|
|
||||||
/data
|
/data
|
||||||
/indexers
|
|
||||||
/log
|
/log
|
||||||
/public/assets/img/avatar
|
/public/img/avatar
|
||||||
/tests/e2e-output
|
|
||||||
/tests/integration/gitea-integration-*
|
|
||||||
/tests/integration/indexers-*
|
|
||||||
/tests/*.ini
|
|
||||||
/tests/**/*.git/**/*.sample
|
|
||||||
/node_modules
|
|
||||||
/.venv
|
|
||||||
/yarn.lock
|
|
||||||
/yarn-error.log
|
|
||||||
/npm-debug.log*
|
|
||||||
/.pnpm-store
|
|
||||||
/public/assets/.vite
|
|
||||||
/public/assets/js
|
|
||||||
/public/assets/css
|
|
||||||
/public/assets/fonts
|
|
||||||
/public/assets/licenses.txt
|
|
||||||
/vendor
|
|
||||||
/VERSION
|
|
||||||
/.air
|
|
||||||
|
|
||||||
|
|
||||||
# Snapcraft
|
|
||||||
/gitea_a*.txt
|
|
||||||
snap/.snapcraft/
|
|
||||||
parts/
|
|
||||||
stage/
|
|
||||||
prime/
|
|
||||||
*.snap
|
|
||||||
*.snap-build
|
|
||||||
*_source.tar.bz2
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# nix-direnv generated files
|
|
||||||
.direnv/
|
|
||||||
|
|
||||||
# Make evidence files
|
|
||||||
/.make_evidence
|
|
||||||
|
|
||||||
# Manpage
|
|
||||||
/man
|
|
||||||
|
|
||||||
# Ignore AI/LLM instruction files
|
|
||||||
/.claude/
|
|
||||||
/.cursorrules
|
|
||||||
/.cursor/
|
|
||||||
/.goosehints
|
|
||||||
/.windsurfrules
|
|
||||||
/.github/copilot-instructions.md
|
|
||||||
/llms.txt
|
|
||||||
|
|
||||||
# Ignore worktrees when working on multiple branches
|
|
||||||
.worktrees/
|
|
||||||
|
|
||||||
# A Makefile for custom make targets
|
|
||||||
Makefile.local
|
|
||||||
|
|||||||
-196
@@ -1,196 +0,0 @@
|
|||||||
version: "2"
|
|
||||||
output:
|
|
||||||
sort-order:
|
|
||||||
- file
|
|
||||||
linters:
|
|
||||||
default: none
|
|
||||||
enable:
|
|
||||||
- bidichk
|
|
||||||
- bodyclose
|
|
||||||
- depguard
|
|
||||||
- dupl
|
|
||||||
- errcheck
|
|
||||||
- forbidigo
|
|
||||||
- gocheckcompilerdirectives
|
|
||||||
- gocritic
|
|
||||||
- goheader
|
|
||||||
- govet
|
|
||||||
- ineffassign
|
|
||||||
- mirror
|
|
||||||
- modernize
|
|
||||||
- nakedret
|
|
||||||
- nilnil
|
|
||||||
- nolintlint
|
|
||||||
- perfsprint
|
|
||||||
- revive
|
|
||||||
- staticcheck
|
|
||||||
- testifylint
|
|
||||||
- unconvert
|
|
||||||
- unparam
|
|
||||||
- unused
|
|
||||||
- usestdlibvars
|
|
||||||
- usetesting
|
|
||||||
- wastedassign
|
|
||||||
settings:
|
|
||||||
depguard:
|
|
||||||
rules:
|
|
||||||
main:
|
|
||||||
deny:
|
|
||||||
- pkg: encoding/json
|
|
||||||
desc: use gitea's modules/json instead of encoding/json
|
|
||||||
- pkg: github.com/unknwon/com
|
|
||||||
desc: use gitea's util and replacements
|
|
||||||
- pkg: io/ioutil
|
|
||||||
desc: use os or io instead
|
|
||||||
- pkg: golang.org/x/exp
|
|
||||||
desc: it's experimental and unreliable
|
|
||||||
- pkg: git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/git/internal
|
|
||||||
desc: do not use the internal package, use AddXxx function instead
|
|
||||||
- pkg: gopkg.in/ini.v1
|
|
||||||
desc: do not use the ini package, use gitea's config system instead
|
|
||||||
- pkg: gitea.com/go-chi/cache
|
|
||||||
desc: do not use the go-chi cache package, use gitea's cache system
|
|
||||||
- pkg: github.com/pkg/errors
|
|
||||||
desc: use builtin errors package instead
|
|
||||||
migrations:
|
|
||||||
files:
|
|
||||||
- '**/models/migrations/**/*.go'
|
|
||||||
deny:
|
|
||||||
- pkg: git.mokoconsulting.tech/MokoConsulting/MokoGitea/models$
|
|
||||||
desc: migrations must not depend on the models package
|
|
||||||
- pkg: git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/structs
|
|
||||||
desc: migrations must not depend on modules/structs (API structures change over time)
|
|
||||||
nolintlint:
|
|
||||||
allow-unused: false
|
|
||||||
require-explanation: true
|
|
||||||
require-specific: true
|
|
||||||
gocritic:
|
|
||||||
enabled-checks:
|
|
||||||
- equalFold
|
|
||||||
disabled-checks:
|
|
||||||
- ifElseChain
|
|
||||||
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
|
|
||||||
- deprecatedComment # conflicts with go-swagger comments
|
|
||||||
revive:
|
|
||||||
severity: error
|
|
||||||
rules:
|
|
||||||
- name: blank-imports
|
|
||||||
- name: constant-logical-expr
|
|
||||||
- name: context-as-argument
|
|
||||||
- name: context-keys-type
|
|
||||||
- name: dot-imports
|
|
||||||
- name: empty-lines
|
|
||||||
- name: error-return
|
|
||||||
- name: error-strings
|
|
||||||
- name: exported
|
|
||||||
- name: identical-branches
|
|
||||||
- name: if-return
|
|
||||||
- name: increment-decrement
|
|
||||||
- name: modifies-value-receiver
|
|
||||||
- name: package-comments
|
|
||||||
- name: redefines-builtin-id
|
|
||||||
- name: superfluous-else
|
|
||||||
- name: time-naming
|
|
||||||
- name: unexported-return
|
|
||||||
- name: var-declaration
|
|
||||||
- name: var-naming
|
|
||||||
arguments:
|
|
||||||
- [] # AllowList - do not remove as args for the rule are positional and won't work without lists first
|
|
||||||
- [] # DenyList
|
|
||||||
- - skip-package-name-checks: true # supress errors from underscore in migration packages
|
|
||||||
staticcheck:
|
|
||||||
checks:
|
|
||||||
- all
|
|
||||||
- -ST1003
|
|
||||||
- -ST1005
|
|
||||||
- -QF1001
|
|
||||||
- -QF1006
|
|
||||||
- -QF1008
|
|
||||||
testifylint:
|
|
||||||
disable:
|
|
||||||
- go-require
|
|
||||||
- require-error
|
|
||||||
usetesting:
|
|
||||||
os-temp-dir: true
|
|
||||||
perfsprint:
|
|
||||||
concat-loop: false
|
|
||||||
govet:
|
|
||||||
enable:
|
|
||||||
- nilness
|
|
||||||
- unusedwrite
|
|
||||||
goheader:
|
|
||||||
values:
|
|
||||||
regexp:
|
|
||||||
HEADER: '((Copyright [^\n]+|All rights reserved\.)\n)*Copyright \d{4} (The (Gogs|Gitea) Authors|Gitea Authors|Gitea)\.( All rights reserved\.)?(\n(Copyright [^\n]+|All rights reserved\.))*\nSPDX-License-Identifier: [\w.-]+'
|
|
||||||
template: '{{ HEADER }}'
|
|
||||||
exclusions:
|
|
||||||
generated: lax
|
|
||||||
presets:
|
|
||||||
- comments
|
|
||||||
- common-false-positives
|
|
||||||
- legacy
|
|
||||||
- std-error-handling
|
|
||||||
rules:
|
|
||||||
- linters:
|
|
||||||
- dupl
|
|
||||||
- errcheck
|
|
||||||
- staticcheck
|
|
||||||
- unparam
|
|
||||||
path: _test\.go
|
|
||||||
- linters:
|
|
||||||
- dupl
|
|
||||||
- errcheck
|
|
||||||
path: models/migrations/v
|
|
||||||
- linters:
|
|
||||||
- forbidigo
|
|
||||||
path: cmd
|
|
||||||
- linters:
|
|
||||||
- dupl
|
|
||||||
text: (?i)webhook
|
|
||||||
- linters:
|
|
||||||
- gocritic
|
|
||||||
text: (?i)`ID' should not be capitalized
|
|
||||||
- linters:
|
|
||||||
- unused
|
|
||||||
text: (?i)swagger
|
|
||||||
- linters:
|
|
||||||
- gocritic
|
|
||||||
text: '(?i)commentFormatting: put a space between `//` and comment text'
|
|
||||||
- linters:
|
|
||||||
- gocritic
|
|
||||||
text: '(?i)exitAfterDefer:'
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
- .venv
|
|
||||||
- public
|
|
||||||
- web_src
|
|
||||||
- third_party$
|
|
||||||
- builtin$
|
|
||||||
- examples$
|
|
||||||
issues:
|
|
||||||
max-issues-per-linter: 0
|
|
||||||
max-same-issues: 0
|
|
||||||
formatters:
|
|
||||||
enable:
|
|
||||||
- gci
|
|
||||||
- gofumpt
|
|
||||||
settings:
|
|
||||||
gci:
|
|
||||||
custom-order: true
|
|
||||||
sections:
|
|
||||||
- standard
|
|
||||||
- prefix(git.mokoconsulting.tech/MokoConsulting/MokoGitea)
|
|
||||||
- blank
|
|
||||||
- default
|
|
||||||
gofumpt:
|
|
||||||
extra-rules: true
|
|
||||||
exclusions:
|
|
||||||
generated: lax
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
- .venv
|
|
||||||
- public
|
|
||||||
- web_src
|
|
||||||
|
|
||||||
run:
|
|
||||||
timeout: 10m
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
*.min.css
|
|
||||||
*.min.js
|
|
||||||
/assets/*.json
|
|
||||||
/options/gitignore
|
|
||||||
/options/license
|
|
||||||
/public/assets
|
|
||||||
/vendor
|
|
||||||
node_modules
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Unknwon <u@gogs.io> <joe2010xtmf@163.com>
|
|
||||||
Unknwon <u@gogs.io> 无闻 <u@gogs.io>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
commands-show-output: false
|
|
||||||
fenced-code-language: false
|
|
||||||
first-line-h1: false
|
|
||||||
heading-increment: false
|
|
||||||
line-length: {code_blocks: false, tables: false, stern: true, line_length: -1}
|
|
||||||
no-alt-text: false
|
|
||||||
no-bare-urls: false
|
|
||||||
no-emphasis-as-heading: false
|
|
||||||
no-empty-links: false
|
|
||||||
no-hard-tabs: {code_blocks: false}
|
|
||||||
no-inline-html: false
|
|
||||||
no-space-in-code: false
|
|
||||||
no-space-in-emphasis: false
|
|
||||||
no-trailing-spaces: {br_spaces: 0}
|
|
||||||
single-h1: false
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"mcpServers": {
|
|
||||||
"ssh": {
|
|
||||||
"type": "stdio",
|
|
||||||
"command": "node",
|
|
||||||
"args": [
|
|
||||||
"A:/ssh-mcp/src/index.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"wiki": {
|
|
||||||
"type": "stdio",
|
|
||||||
"command": "node",
|
|
||||||
"args": [
|
|
||||||
"A:/wiki-mcp/dist/index.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"project": {
|
|
||||||
"type": "stdio",
|
|
||||||
"command": "node",
|
|
||||||
"args": [
|
|
||||||
"A:/project-mcp/dist/index.js"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
---
|
|
||||||
name: Architecture Decision Record (ADR)
|
|
||||||
about: Propose or document an architectural decision
|
|
||||||
title: '[ADR] '
|
|
||||||
labels: 'architecture, decision'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## ADR Number
|
|
||||||
ADR-XXXX
|
|
||||||
|
|
||||||
## Status
|
|
||||||
- [ ] Proposed
|
|
||||||
- [ ] Accepted
|
|
||||||
- [ ] Deprecated
|
|
||||||
- [ ] Superseded by ADR-XXXX
|
|
||||||
|
|
||||||
## Context
|
|
||||||
Describe the issue or problem that motivates this decision.
|
|
||||||
|
|
||||||
## Decision
|
|
||||||
State the architecture decision and provide rationale.
|
|
||||||
|
|
||||||
## Consequences
|
|
||||||
### Positive
|
|
||||||
- List positive consequences
|
|
||||||
|
|
||||||
### Negative
|
|
||||||
- List negative consequences or trade-offs
|
|
||||||
|
|
||||||
### Neutral
|
|
||||||
- List neutral aspects
|
|
||||||
|
|
||||||
## Alternatives Considered
|
|
||||||
### Alternative 1
|
|
||||||
- Description
|
|
||||||
- Pros
|
|
||||||
- Cons
|
|
||||||
- Why not chosen
|
|
||||||
|
|
||||||
### Alternative 2
|
|
||||||
- Description
|
|
||||||
- Pros
|
|
||||||
- Cons
|
|
||||||
- Why not chosen
|
|
||||||
|
|
||||||
## Implementation Plan
|
|
||||||
1. Step 1
|
|
||||||
2. Step 2
|
|
||||||
3. Step 3
|
|
||||||
|
|
||||||
## Stakeholders
|
|
||||||
- **Decision Makers**: @user1, @user2
|
|
||||||
- **Consulted**: @user3, @user4
|
|
||||||
- **Informed**: team-name
|
|
||||||
|
|
||||||
## Technical Details
|
|
||||||
### Architecture Diagram
|
|
||||||
```
|
|
||||||
[Add diagram or link]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- Dependency 1
|
|
||||||
- Dependency 2
|
|
||||||
|
|
||||||
### Impact Analysis
|
|
||||||
- **Performance**: [Impact description]
|
|
||||||
- **Security**: [Impact description]
|
|
||||||
- **Scalability**: [Impact description]
|
|
||||||
- **Maintainability**: [Impact description]
|
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
- [ ] Unit tests
|
|
||||||
- [ ] Integration tests
|
|
||||||
- [ ] Performance tests
|
|
||||||
- [ ] Security tests
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
- [ ] Architecture documentation updated
|
|
||||||
- [ ] API documentation updated
|
|
||||||
- [ ] Developer guide updated
|
|
||||||
- [ ] Runbook created
|
|
||||||
|
|
||||||
## Migration Path
|
|
||||||
Describe how to migrate from current state to new architecture.
|
|
||||||
|
|
||||||
## Rollback Plan
|
|
||||||
Describe how to rollback if issues occur.
|
|
||||||
|
|
||||||
## Timeline
|
|
||||||
- **Proposal Date**:
|
|
||||||
- **Decision Date**:
|
|
||||||
- **Implementation Start**:
|
|
||||||
- **Expected Completion**:
|
|
||||||
|
|
||||||
## References
|
|
||||||
- Related ADRs:
|
|
||||||
- External resources:
|
|
||||||
- RFCs:
|
|
||||||
|
|
||||||
## Review Checklist
|
|
||||||
- [ ] Aligns with enterprise architecture principles
|
|
||||||
- [ ] Security implications reviewed
|
|
||||||
- [ ] Performance implications reviewed
|
|
||||||
- [ ] Cost implications reviewed
|
|
||||||
- [ ] Compliance requirements met
|
|
||||||
- [ ] Team consensus achieved
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Report a bug or issue with the project
|
|
||||||
title: '[BUG] '
|
|
||||||
labels: 'bug'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Bug Description
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
## Steps to Reproduce
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '...'
|
|
||||||
3. Scroll down to '...'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
## Expected Behavior
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
## Actual Behavior
|
|
||||||
A clear and concise description of what actually happened.
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
## Environment
|
|
||||||
- **Project**: [e.g., MokoDoliTools, moko-cassiopeia]
|
|
||||||
- **Version**: [e.g., 1.2.3]
|
|
||||||
- **Platform**: [e.g., Dolibarr 18.0, Joomla 5.0]
|
|
||||||
- **PHP Version**: [e.g., 8.1]
|
|
||||||
- **Database**: [e.g., MySQL 8.0, PostgreSQL 14]
|
|
||||||
- **Browser** (if applicable): [e.g., Chrome 120, Firefox 121]
|
|
||||||
- **OS**: [e.g., Ubuntu 22.04, Windows 11]
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
Add any other context about the problem here.
|
|
||||||
|
|
||||||
## Possible Solution
|
|
||||||
If you have suggestions on how to fix the issue, please describe them here.
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
- [ ] I have searched for similar issues before creating this one
|
|
||||||
- [ ] I have provided all the requested information
|
|
||||||
- [ ] I have tested this on the latest stable version
|
|
||||||
- [ ] I have checked the documentation and couldn't find a solution
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
blank_issues_enabled: true
|
|
||||||
contact_links:
|
|
||||||
- name: 💼 Enterprise Support
|
|
||||||
url: https://mokoconsulting.tech/enterprise
|
|
||||||
about: Enterprise-level support and consultation services
|
|
||||||
- name: 💬 Ask a Question
|
|
||||||
url: https://mokoconsulting.tech/
|
|
||||||
about: Get help or ask questions through our website
|
|
||||||
- name: 📚 MokoStandards Documentation
|
|
||||||
url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
about: View our coding standards and best practices
|
|
||||||
- name: 🔒 Report a Security Vulnerability
|
|
||||||
url: https://git.mokoconsulting.tech/mokoconsulting-tech/.github-private/security/advisories/new
|
|
||||||
about: Report security vulnerabilities privately (for critical issues)
|
|
||||||
- name: 💡 Community Discussions
|
|
||||||
url: https://github.com/orgs/mokoconsulting-tech/discussions
|
|
||||||
about: Join community discussions and Q&A
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
---
|
|
||||||
name: Documentation Issue
|
|
||||||
about: Report an issue with documentation
|
|
||||||
title: '[DOCS] '
|
|
||||||
labels: 'documentation'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation Issue
|
|
||||||
|
|
||||||
**Location**:
|
|
||||||
<!-- Specify the file, page, or section with the issue -->
|
|
||||||
|
|
||||||
## Issue Type
|
|
||||||
<!-- Mark the relevant option with an "x" -->
|
|
||||||
- [ ] Typo or grammar error
|
|
||||||
- [ ] Outdated information
|
|
||||||
- [ ] Missing documentation
|
|
||||||
- [ ] Unclear explanation
|
|
||||||
- [ ] Broken links
|
|
||||||
- [ ] Missing examples
|
|
||||||
- [ ] Other (specify below)
|
|
||||||
|
|
||||||
## Description
|
|
||||||
<!-- Clearly describe the documentation issue -->
|
|
||||||
|
|
||||||
## Current Content
|
|
||||||
<!-- Quote or describe the current documentation (if applicable) -->
|
|
||||||
```
|
|
||||||
Current text here
|
|
||||||
```
|
|
||||||
|
|
||||||
## Suggested Improvement
|
|
||||||
<!-- Provide your suggestion for how to improve the documentation -->
|
|
||||||
```
|
|
||||||
Suggested text here
|
|
||||||
```
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
<!-- Add any other context, screenshots, or references -->
|
|
||||||
|
|
||||||
## Standards Alignment
|
|
||||||
- [ ] Follows MokoStandards documentation guidelines
|
|
||||||
- [ ] Uses en_US/en_GB localization
|
|
||||||
- [ ] Includes proper SPDX headers where applicable
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
- [ ] I have searched for similar documentation issues
|
|
||||||
- [ ] I have provided a clear description
|
|
||||||
- [ ] I have suggested an improvement (if applicable)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature Request
|
|
||||||
about: Suggest a new feature or enhancement
|
|
||||||
title: '[FEATURE] '
|
|
||||||
labels: 'enhancement'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Feature Description
|
|
||||||
A clear and concise description of the feature you'd like to see.
|
|
||||||
|
|
||||||
## Problem or Use Case
|
|
||||||
Describe the problem this feature would solve or the use case it addresses.
|
|
||||||
Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
## Alternative Solutions
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
## Benefits
|
|
||||||
Describe how this feature would benefit users:
|
|
||||||
- Who would use this feature?
|
|
||||||
- What problems does it solve?
|
|
||||||
- What value does it add?
|
|
||||||
|
|
||||||
## Implementation Details (Optional)
|
|
||||||
If you have ideas about how this could be implemented, share them here:
|
|
||||||
- Technical approach
|
|
||||||
- Files/components that might need changes
|
|
||||||
- Any concerns or challenges you foresee
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
Add any other context, mockups, or screenshots about the feature request here.
|
|
||||||
|
|
||||||
## Relevant Standards
|
|
||||||
Does this relate to any standards in [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards)?
|
|
||||||
- [ ] Accessibility (WCAG 2.1 AA)
|
|
||||||
- [ ] Localization (en_US/en_GB)
|
|
||||||
- [ ] Security best practices
|
|
||||||
- [ ] Code quality standards
|
|
||||||
- [ ] Other: [specify]
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
- [ ] I have searched for similar feature requests before creating this one
|
|
||||||
- [ ] I have clearly described the use case and benefits
|
|
||||||
- [ ] I have considered alternative solutions
|
|
||||||
- [ ] This feature aligns with the project's goals and scope
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Ask a question about usage, features, or best practices
|
|
||||||
title: '[QUESTION] '
|
|
||||||
labels: ['question']
|
|
||||||
assignees: ['jmiller']
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Question
|
|
||||||
|
|
||||||
**Your question:**
|
|
||||||
|
|
||||||
|
|
||||||
## Context
|
|
||||||
|
|
||||||
**What are you trying to accomplish?**
|
|
||||||
|
|
||||||
|
|
||||||
**What have you already tried?**
|
|
||||||
|
|
||||||
|
|
||||||
**Category**:
|
|
||||||
- [ ] Script usage
|
|
||||||
- [ ] Configuration
|
|
||||||
- [ ] Workflow setup
|
|
||||||
- [ ] Documentation interpretation
|
|
||||||
- [ ] Best practices
|
|
||||||
- [ ] Integration
|
|
||||||
- [ ] Other: __________
|
|
||||||
|
|
||||||
## Environment (if relevant)
|
|
||||||
|
|
||||||
**Your setup**:
|
|
||||||
- Operating System:
|
|
||||||
- Version:
|
|
||||||
|
|
||||||
## What You've Researched
|
|
||||||
|
|
||||||
**Documentation reviewed**:
|
|
||||||
- [ ] README.md
|
|
||||||
- [ ] Project documentation
|
|
||||||
- [ ] Other (specify): __________
|
|
||||||
|
|
||||||
**Similar issues/questions found**:
|
|
||||||
- #
|
|
||||||
- #
|
|
||||||
|
|
||||||
## Expected Outcome
|
|
||||||
|
|
||||||
**What result are you hoping for?**
|
|
||||||
|
|
||||||
|
|
||||||
## Code/Configuration Samples
|
|
||||||
|
|
||||||
**Relevant code or configuration** (if applicable):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Your code here
|
|
||||||
```
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
|
|
||||||
**Any other relevant information:**
|
|
||||||
|
|
||||||
|
|
||||||
**Screenshots** (if helpful):
|
|
||||||
|
|
||||||
|
|
||||||
## Urgency
|
|
||||||
|
|
||||||
- [ ] Urgent (blocking work)
|
|
||||||
- [ ] Normal (can work on other things meanwhile)
|
|
||||||
- [ ] Low priority (just curious)
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
|
|
||||||
- [ ] I have searched existing issues and discussions
|
|
||||||
- [ ] I have reviewed relevant documentation
|
|
||||||
- [ ] I have provided sufficient context
|
|
||||||
- [ ] I have included code/configuration samples if relevant
|
|
||||||
- [ ] This is a genuine question (not a bug report or feature request)
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
---
|
|
||||||
name: Request for Comments (RFC)
|
|
||||||
about: Propose a significant change for community discussion
|
|
||||||
title: '[RFC] '
|
|
||||||
labels: 'rfc, discussion'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## RFC Summary
|
|
||||||
One-paragraph summary of the proposal.
|
|
||||||
|
|
||||||
## Motivation
|
|
||||||
Why are we doing this? What use cases does it support? What is the expected outcome?
|
|
||||||
|
|
||||||
## Detailed Design
|
|
||||||
### Overview
|
|
||||||
Provide a detailed explanation of the proposed change.
|
|
||||||
|
|
||||||
### API Changes (if applicable)
|
|
||||||
```php
|
|
||||||
// Before
|
|
||||||
function oldApi($param1) { }
|
|
||||||
|
|
||||||
// After
|
|
||||||
function newApi($param1, $param2) { }
|
|
||||||
```
|
|
||||||
|
|
||||||
### User Experience Changes
|
|
||||||
Describe how users will interact with this change.
|
|
||||||
|
|
||||||
### Implementation Approach
|
|
||||||
High-level implementation strategy.
|
|
||||||
|
|
||||||
## Drawbacks
|
|
||||||
Why should we *not* do this?
|
|
||||||
|
|
||||||
## Alternatives
|
|
||||||
What other designs have been considered? What is the impact of not doing this?
|
|
||||||
|
|
||||||
### Alternative 1
|
|
||||||
- Description
|
|
||||||
- Trade-offs
|
|
||||||
|
|
||||||
### Alternative 2
|
|
||||||
- Description
|
|
||||||
- Trade-offs
|
|
||||||
|
|
||||||
## Adoption Strategy
|
|
||||||
How will existing users adopt this? Is this a breaking change?
|
|
||||||
|
|
||||||
### Migration Guide
|
|
||||||
```bash
|
|
||||||
# Steps to migrate
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deprecation Timeline
|
|
||||||
- **Announcement**:
|
|
||||||
- **Deprecation**:
|
|
||||||
- **Removal**:
|
|
||||||
|
|
||||||
## Unresolved Questions
|
|
||||||
- Question 1
|
|
||||||
- Question 2
|
|
||||||
|
|
||||||
## Future Possibilities
|
|
||||||
What future work does this enable?
|
|
||||||
|
|
||||||
## Impact Assessment
|
|
||||||
### Performance
|
|
||||||
Expected performance impact.
|
|
||||||
|
|
||||||
### Security
|
|
||||||
Security considerations and implications.
|
|
||||||
|
|
||||||
### Compatibility
|
|
||||||
- **Backward Compatible**: [Yes / No]
|
|
||||||
- **Breaking Changes**: [List]
|
|
||||||
|
|
||||||
### Maintenance
|
|
||||||
Long-term maintenance considerations.
|
|
||||||
|
|
||||||
## Community Input
|
|
||||||
### Stakeholders
|
|
||||||
- [ ] Core team
|
|
||||||
- [ ] Module developers
|
|
||||||
- [ ] End users
|
|
||||||
- [ ] Enterprise customers
|
|
||||||
|
|
||||||
### Feedback Period
|
|
||||||
**Duration**: [e.g., 2 weeks]
|
|
||||||
**Deadline**: [date]
|
|
||||||
|
|
||||||
## Implementation Timeline
|
|
||||||
### Phase 1: Design
|
|
||||||
- [ ] RFC discussion
|
|
||||||
- [ ] Design finalization
|
|
||||||
- [ ] Approval
|
|
||||||
|
|
||||||
### Phase 2: Implementation
|
|
||||||
- [ ] Core implementation
|
|
||||||
- [ ] Tests
|
|
||||||
- [ ] Documentation
|
|
||||||
|
|
||||||
### Phase 3: Release
|
|
||||||
- [ ] Beta release
|
|
||||||
- [ ] Feedback collection
|
|
||||||
- [ ] Stable release
|
|
||||||
|
|
||||||
## Success Metrics
|
|
||||||
How will we measure success?
|
|
||||||
- Metric 1
|
|
||||||
- Metric 2
|
|
||||||
|
|
||||||
## References
|
|
||||||
- Related RFCs:
|
|
||||||
- External documentation:
|
|
||||||
- Prior art:
|
|
||||||
|
|
||||||
## Open Questions for Community
|
|
||||||
1. Question 1?
|
|
||||||
2. Question 2?
|
|
||||||
|
|
||||||
---
|
|
||||||
**Note**: This RFC is open for community discussion. Please provide feedback in the comments below.
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
---
|
|
||||||
name: Security Vulnerability Report
|
|
||||||
about: Report a security vulnerability (use only for non-critical issues)
|
|
||||||
title: '[SECURITY] '
|
|
||||||
labels: 'security'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## ⚠️ IMPORTANT: Private Disclosure Required
|
|
||||||
|
|
||||||
**For critical security vulnerabilities, DO NOT use this template.**
|
|
||||||
Follow the process in [SECURITY.md](../SECURITY.md) for responsible disclosure.
|
|
||||||
|
|
||||||
Use this template only for:
|
|
||||||
- Security improvements
|
|
||||||
- Non-critical security suggestions
|
|
||||||
- Security documentation updates
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Security Issue
|
|
||||||
|
|
||||||
**Severity**:
|
|
||||||
<!-- Low, Medium, or informational only -->
|
|
||||||
|
|
||||||
## Description
|
|
||||||
<!-- Describe the security concern or improvement suggestion -->
|
|
||||||
|
|
||||||
## Affected Components
|
|
||||||
<!-- List the affected files, features, or components -->
|
|
||||||
|
|
||||||
## Suggested Mitigation
|
|
||||||
<!-- Describe how this could be addressed -->
|
|
||||||
|
|
||||||
## Standards Reference
|
|
||||||
Does this relate to security standards in [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards)?
|
|
||||||
- [ ] SPDX license identifiers
|
|
||||||
- [ ] Secret management
|
|
||||||
- [ ] Dependency security
|
|
||||||
- [ ] Access control
|
|
||||||
- [ ] Other: [specify]
|
|
||||||
|
|
||||||
## Additional Context
|
|
||||||
<!-- Add any other context about the security concern -->
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
- [ ] This is NOT a critical vulnerability requiring private disclosure
|
|
||||||
- [ ] I have reviewed the SECURITY.md policy
|
|
||||||
- [ ] I have provided sufficient detail for evaluation
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
name: ".mokogitea Test Template"
|
|
||||||
about: "Verify .mokogitea issue templates work"
|
|
||||||
labels: ["test"]
|
|
||||||
---
|
|
||||||
|
|
||||||
This template was loaded from `.mokogitea/ISSUE_TEMPLATE/`.
|
|
||||||
|
|
||||||
If you can see this, the `.mokogitea` dot-folder feature is working.
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
name: Version Bump
|
|
||||||
about: Request or track a version change
|
|
||||||
title: '[VERSION] '
|
|
||||||
labels: 'version, type: version'
|
|
||||||
assignees: 'jmiller'
|
|
||||||
---
|
|
||||||
|
|
||||||
## Version Change
|
|
||||||
|
|
||||||
**Current version**: <!-- e.g., 01.02.03 -->
|
|
||||||
**Requested version**: <!-- e.g., 01.03.00 -->
|
|
||||||
**Change type**: <!-- patch / minor / major -->
|
|
||||||
|
|
||||||
## Reason
|
|
||||||
|
|
||||||
<!-- Why is this version bump needed? -->
|
|
||||||
|
|
||||||
## Checklist
|
|
||||||
|
|
||||||
- [ ] README.md `VERSION:` field updated
|
|
||||||
- [ ] CHANGELOG.md entry added
|
|
||||||
- [ ] Module descriptor version updated (Dolibarr: `$this->version`, Joomla: `<version>`)
|
|
||||||
- [ ] All file headers will be auto-propagated by `sync-version-on-merge` workflow
|
|
||||||
@@ -1,251 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Automation
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /.gitea/workflows/branch-protection.yml
|
|
||||||
# BRIEF: Apply standardised branch protection rules to all governed repositories
|
|
||||||
#
|
|
||||||
# +========================================================================+
|
|
||||||
# | BRANCH PROTECTION SETUP |
|
|
||||||
# +========================================================================+
|
|
||||||
# | |
|
|
||||||
# | Applies protection rules for: main, dev, rc, beta, alpha |
|
|
||||||
# | |
|
|
||||||
# | main — Require PR, block rejected reviews, no force push |
|
|
||||||
# | dev — Allow push, no force push, no delete |
|
|
||||||
# | rc — Allow push, no force push, no delete |
|
|
||||||
# | beta — Allow push, no force push, no delete |
|
|
||||||
# | alpha — Allow push, no force push, no delete |
|
|
||||||
# | |
|
|
||||||
# | jmiller has override authority on all branches. |
|
|
||||||
# | |
|
|
||||||
# +========================================================================+
|
|
||||||
|
|
||||||
name: Branch Protection Setup
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * 1' # Weekly Monday 02:00 UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
dry_run:
|
|
||||||
description: 'Preview mode (no changes)'
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
repos:
|
|
||||||
description: 'Comma-separated repo names (empty = all governed repos)'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITEA_URL: https://git.mokoconsulting.tech
|
|
||||||
GITEA_ORG: MokoConsulting
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
protect:
|
|
||||||
name: Apply Branch Protection Rules
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Determine target repos
|
|
||||||
id: repos
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
|
||||||
run: |
|
|
||||||
API="${GITEA_URL}/api/v1"
|
|
||||||
|
|
||||||
# Platform/standards/infra repos to exclude
|
|
||||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private MokoStandards moko-platform MokoTesting"
|
|
||||||
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
|
|
||||||
|
|
||||||
if [ -n "${{ inputs.repos }}" ]; then
|
|
||||||
# User-specified repos
|
|
||||||
REPOS=$(echo "${{ inputs.repos }}" | tr ',' ' ')
|
|
||||||
else
|
|
||||||
# Fetch all org repos
|
|
||||||
PAGE=1
|
|
||||||
REPOS=""
|
|
||||||
while true; do
|
|
||||||
BATCH=$(curl -sS \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
"${API}/orgs/${GITEA_ORG}/repos?page=${PAGE}&limit=50" \
|
|
||||||
| jq -r '.[].name // empty')
|
|
||||||
[ -z "$BATCH" ] && break
|
|
||||||
REPOS="$REPOS $BATCH"
|
|
||||||
PAGE=$((PAGE + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
# Filter out excluded repos
|
|
||||||
FILTERED=""
|
|
||||||
for REPO in $REPOS; do
|
|
||||||
SKIP=false
|
|
||||||
for EX in $EXCLUDE; do
|
|
||||||
if [ "$REPO" = "$EX" ]; then
|
|
||||||
SKIP=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "$SKIP" = "false" ]; then
|
|
||||||
FILTERED="$FILTERED $REPO"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
REPOS="$FILTERED"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "repos=$REPOS" >> "$GITHUB_OUTPUT"
|
|
||||||
COUNT=$(echo "$REPOS" | wc -w)
|
|
||||||
echo "📋 Target repos (${COUNT}): $REPOS"
|
|
||||||
|
|
||||||
- name: Apply protection rules
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
|
||||||
DRY_RUN: ${{ inputs.dry_run || 'false' }}
|
|
||||||
run: |
|
|
||||||
API="${GITEA_URL}/api/v1"
|
|
||||||
REPOS="${{ steps.repos.outputs.repos }}"
|
|
||||||
|
|
||||||
SUCCESS=0
|
|
||||||
FAILED=0
|
|
||||||
SKIPPED=0
|
|
||||||
|
|
||||||
# ── Rule definitions ──────────────────────────────────────
|
|
||||||
# Only the CI bot (jmiller token) can push directly.
|
|
||||||
# All human contributors must use PRs.
|
|
||||||
# Force push disabled on all branches.
|
|
||||||
|
|
||||||
RULE_MAIN='{
|
|
||||||
"rule_name": "main",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"dismiss_stale_approvals": true,
|
|
||||||
"block_on_rejected_reviews": true,
|
|
||||||
"block_on_outdated_branch": false,
|
|
||||||
"priority": 1
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_DEV='{
|
|
||||||
"rule_name": "dev",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 2
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_RC='{
|
|
||||||
"rule_name": "rc",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 3
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_BETA='{
|
|
||||||
"rule_name": "beta",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 4
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_ALPHA='{
|
|
||||||
"rule_name": "alpha",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 5
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULES=("$RULE_MAIN" "$RULE_DEV" "$RULE_RC" "$RULE_BETA" "$RULE_ALPHA")
|
|
||||||
RULE_NAMES=("main" "dev" "rc" "beta" "alpha")
|
|
||||||
|
|
||||||
# ── Apply rules to each repo ──────────────────────────────
|
|
||||||
for REPO in $REPOS; do
|
|
||||||
echo ""
|
|
||||||
echo "═══ ${REPO} ═══"
|
|
||||||
|
|
||||||
for i in "${!RULES[@]}"; do
|
|
||||||
RULE="${RULES[$i]}"
|
|
||||||
NAME="${RULE_NAMES[$i]}"
|
|
||||||
|
|
||||||
if [ "$DRY_RUN" = "true" ]; then
|
|
||||||
echo " [DRY RUN] Would apply rule: ${NAME}"
|
|
||||||
SKIPPED=$((SKIPPED + 1))
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete existing rule if present (idempotent recreate)
|
|
||||||
ENCODED_NAME=$(echo "$NAME" | sed 's|/|%2F|g')
|
|
||||||
curl -sS -o /dev/null -w "" \
|
|
||||||
-X DELETE \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
"${API}/repos/${GITEA_ORG}/${REPO}/branch_protections/${ENCODED_NAME}" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Create rule
|
|
||||||
RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
|
||||||
-X POST \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$RULE" \
|
|
||||||
"${API}/repos/${GITEA_ORG}/${REPO}/branch_protections")
|
|
||||||
|
|
||||||
HTTP=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
|
||||||
|
|
||||||
if [ "$HTTP" = "201" ]; then
|
|
||||||
echo " ✅ ${NAME}"
|
|
||||||
SUCCESS=$((SUCCESS + 1))
|
|
||||||
else
|
|
||||||
echo " ❌ ${NAME} (HTTP ${HTTP}): $(echo "$BODY" | jq -r '.message // .' 2>/dev/null | head -1)"
|
|
||||||
FAILED=$((FAILED + 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# ── Summary ───────────────────────────────────────────────
|
|
||||||
echo ""
|
|
||||||
echo "════════════════════════════════════════"
|
|
||||||
echo " ✅ Success: ${SUCCESS}"
|
|
||||||
echo " ❌ Failed: ${FAILED}"
|
|
||||||
echo " ⏭️ Skipped: ${SKIPPED}"
|
|
||||||
echo "════════════════════════════════════════"
|
|
||||||
|
|
||||||
if [ "$FAILED" -gt 0 ]; then
|
|
||||||
echo "::warning::${FAILED} rule(s) failed to apply"
|
|
||||||
fi
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue -->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
1. Please speak English, this is the language all maintainers can speak and write.
|
|
||||||
2. Please ask questions or configuration/deploy problems on our Discord
|
|
||||||
server (https://discord.gg/gitea) or forum (https://forum.gitea.com).
|
|
||||||
3. Please take a moment to check that your issue doesn't already exist.
|
|
||||||
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
|
|
||||||
5. Please give all relevant information below for bug reports, because
|
|
||||||
incomplete details will be handled as an invalid report.
|
|
||||||
-->
|
|
||||||
|
|
||||||
- Gitea version (or commit ref):
|
|
||||||
- Git version:
|
|
||||||
- Operating system:
|
|
||||||
<!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package -->
|
|
||||||
<!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. --->
|
|
||||||
<!-- If you are using a package or systemd tell us what distribution you are using -->
|
|
||||||
- Database (use `[x]`):
|
|
||||||
- [ ] PostgreSQL
|
|
||||||
- [ ] MySQL
|
|
||||||
- [ ] MSSQL
|
|
||||||
- [ ] SQLite
|
|
||||||
- Can you reproduce the bug at https://demo.gitea.com:
|
|
||||||
- [ ] Yes (provide example URL)
|
|
||||||
- [ ] No
|
|
||||||
- Log gist:
|
|
||||||
<!-- It really is important to provide pertinent logs -->
|
|
||||||
<!-- Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help -->
|
|
||||||
<!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -->
|
|
||||||
|
|
||||||
## Description
|
|
||||||
<!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please
|
|
||||||
disable the proxy/CDN fully and connect to gitea directly to confirm
|
|
||||||
the issue still persists without those services. -->
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||
<!-- **If this issue involves the Web Interface, please include a screenshot** -->
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0" schema-version="1.0">
|
|
||||||
<identity>
|
|
||||||
<name>MokoGitea</name>
|
|
||||||
<org>MokoConsulting</org>
|
|
||||||
<description>Moko fork of Gitea — adding project board REST API endpoints and custom enhancements</description>
|
|
||||||
<version>05.07.00</version>
|
|
||||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
|
||||||
</identity>
|
|
||||||
<governance>
|
|
||||||
<platform>go</platform>
|
|
||||||
<standards-version>05.00.00</standards-version>
|
|
||||||
<standards-source>https://git.mokoconsulting.tech/MokoConsulting/moko-platform</standards-source>
|
|
||||||
</governance>
|
|
||||||
<build>
|
|
||||||
<language>Go</language>
|
|
||||||
<package-type>application</package-type>
|
|
||||||
<entry-point>./</entry-point>
|
|
||||||
</build>
|
|
||||||
</moko-platform>
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Release
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
|
||||||
# VERSION: 09.02.00
|
|
||||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
|
||||||
|
|
||||||
name: "Universal: Auto Version Bump"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
- rc
|
|
||||||
- 'feature/**'
|
|
||||||
- 'patch/**'
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
bump:
|
|
||||||
name: Version Bump
|
|
||||||
runs-on: release
|
|
||||||
if: >-
|
|
||||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
|
||||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
|
||||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
|
||||||
run: |
|
|
||||||
if ! command -v composer &> /dev/null; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
if [ -d "/opt/moko-platform/cli" ]; then
|
|
||||||
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
|
||||||
else
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \
|
|
||||||
/tmp/moko-platform-api
|
|
||||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
|
||||||
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Bump version
|
|
||||||
run: |
|
|
||||||
php ${MOKO_CLI}/version_auto_bump.php \
|
|
||||||
--path . --branch "${GITHUB_REF_NAME}" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
--repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
||||||
@@ -1,270 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Release
|
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
|
||||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
|
||||||
# VERSION: 05.00.00
|
|
||||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
|
||||||
#
|
|
||||||
# +========================================================================+
|
|
||||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
|
||||||
# +========================================================================+
|
|
||||||
# | |
|
|
||||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
|
||||||
# | |
|
|
||||||
# | Platform-specific: |
|
|
||||||
# | joomla: XML manifest, updates.xml, type-prefixed packages |
|
|
||||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
|
||||||
# | generic: README-only, no update stream |
|
|
||||||
# | |
|
|
||||||
# +========================================================================+
|
|
||||||
|
|
||||||
name: "Universal: Build & Release"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, closed]
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
action:
|
|
||||||
description: 'Action to perform'
|
|
||||||
required: false
|
|
||||||
type: choice
|
|
||||||
default: release
|
|
||||||
options:
|
|
||||||
- release
|
|
||||||
- promote-rc
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
|
||||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
|
||||||
promote-rc:
|
|
||||||
name: Promote to RC
|
|
||||||
runs-on: release
|
|
||||||
if: >-
|
|
||||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
|
||||||
env:
|
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
|
||||||
run: |
|
|
||||||
if ! command -v composer &> /dev/null; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
|
||||||
rm -rf /tmp/moko-platform-api
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
|
||||||
/tmp/moko-platform-api
|
|
||||||
cd /tmp/moko-platform-api
|
|
||||||
composer install --no-dev --no-interaction --quiet
|
|
||||||
|
|
||||||
- name: Rename branch to rc
|
|
||||||
run: |
|
|
||||||
php /tmp/moko-platform-api/cli/branch_rename.php \
|
|
||||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
|
||||||
--pr "${{ github.event.pull_request.number }}"
|
|
||||||
|
|
||||||
- name: Checkout rc and configure git
|
|
||||||
run: |
|
|
||||||
git fetch origin rc
|
|
||||||
git checkout rc
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
||||||
|
|
||||||
- name: Publish RC release
|
|
||||||
run: |
|
|
||||||
php /tmp/moko-platform-api/cli/release_publish.php \
|
|
||||||
--path . --stability rc --bump minor --branch rc \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Branch renamed to rc, minor bump, RC + lesser stream releases built, updates.xml synced" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
|
||||||
release:
|
|
||||||
name: Build & Release Pipeline
|
|
||||||
runs-on: release
|
|
||||||
if: >-
|
|
||||||
github.event.pull_request.merged == true ||
|
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Configure git for bot pushes
|
|
||||||
run: |
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
|
||||||
env:
|
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
|
||||||
run: |
|
|
||||||
# Ensure PHP + Composer are available
|
|
||||||
if ! command -v composer &> /dev/null; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
|
||||||
rm -rf /tmp/moko-platform-api
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
|
||||||
/tmp/moko-platform-api
|
|
||||||
cd /tmp/moko-platform-api
|
|
||||||
composer install --no-dev --no-interaction --quiet
|
|
||||||
|
|
||||||
|
|
||||||
- name: "Publish stable release"
|
|
||||||
run: |
|
|
||||||
php /tmp/moko-platform-api/cli/release_publish.php \
|
|
||||||
--path . --stability stable --bump minor --branch main \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
|
||||||
- name: "Step 9: Mirror release to GitHub"
|
|
||||||
if: >-
|
|
||||||
steps.version.outputs.skip != 'true' &&
|
|
||||||
secrets.GH_MIRROR_TOKEN != ''
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
|
||||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
php /tmp/moko-platform-api/cli/release_mirror.php \
|
|
||||||
--version "$VERSION" --tag "$RELEASE_TAG" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
||||||
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
|
|
||||||
--branch main 2>&1 || true
|
|
||||||
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
|
||||||
- name: "Step 10: Push main to GitHub mirror"
|
|
||||||
if: >-
|
|
||||||
steps.version.outputs.skip != 'true' &&
|
|
||||||
secrets.GH_MIRROR_TOKEN != ''
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
|
||||||
GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1)
|
|
||||||
GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2)
|
|
||||||
git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \
|
|
||||||
git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git"
|
|
||||||
git fetch origin main --depth=1
|
|
||||||
git push github origin/main:refs/heads/main --force 2>/dev/null \
|
|
||||||
&& echo "main branch pushed to GitHub mirror" \
|
|
||||||
|| echo "WARNING: GitHub mirror push failed"
|
|
||||||
|
|
||||||
- name: "Step 11: Delete rc branch and recreate dev from main"
|
|
||||||
if: steps.version.outputs.skip != 'true'
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
# Delete rc branch (ephemeral — created by promote-rc)
|
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
|
||||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
|
||||||
|
|
||||||
# Delete dev branch
|
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
|
||||||
|
|
||||||
# Recreate dev from main (now includes version bump + changelog promotion)
|
|
||||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/branches" \
|
|
||||||
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
|
||||||
|
|
||||||
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: "Step 12: Create version branch from main"
|
|
||||||
if: steps.version.outputs.skip != 'true'
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
|
||||||
BRANCH_NAME="version/${VERSION}"
|
|
||||||
MAIN_SHA=$(git rev-parse HEAD)
|
|
||||||
|
|
||||||
# Delete old version branch if it exists (same version re-release)
|
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}"
|
|
||||||
|
|
||||||
# Create version/XX.YY.ZZ from main
|
|
||||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed"
|
|
||||||
|
|
||||||
echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# -- Dolibarr post-release: Reset dev version -----------------------------
|
|
||||||
- name: "Post-release: Reset dev version"
|
|
||||||
if: steps.version.outputs.skip != 'true'
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
php /tmp/moko-platform-api/cli/version_reset_dev.php \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
|
||||||
--branch dev --path . 2>&1 || true
|
|
||||||
|
|
||||||
# -- Summary --------------------------------------------------------------
|
|
||||||
- name: Pipeline Summary
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
if [ "${{ steps.version.outputs.skip }}" = "true" ]; then
|
|
||||||
echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then
|
|
||||||
echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: MokoStandards.Universal
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
|
||||||
# VERSION: 01.00.00
|
|
||||||
# BRIEF: Delete feature branches after PR merge
|
|
||||||
|
|
||||||
name: "Branch Cleanup"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [closed]
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cleanup:
|
|
||||||
name: Delete merged branch
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: >-
|
|
||||||
github.event.pull_request.merged == true &&
|
|
||||||
github.event.pull_request.head.ref != 'dev' &&
|
|
||||||
github.event.pull_request.head.ref != 'main'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Delete source branch
|
|
||||||
run: |
|
|
||||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
|
||||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
|
||||||
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
|
||||||
|
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
|
||||||
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
"${API}/${ENCODED}" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ "$STATUS" = "204" ]; then
|
|
||||||
echo "Deleted branch: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [ "$STATUS" = "404" ]; then
|
|
||||||
echo "Branch already deleted: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "::warning::Failed to delete branch ${BRANCH} (HTTP ${STATUS})"
|
|
||||||
fi
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# BRIEF: Build MokoGitea Docker image, push to registry, and deploy
|
|
||||||
|
|
||||||
name: Deploy MokoGitea
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Version tag (e.g. v1.26.1-moko.05.01.00)'
|
|
||||||
required: true
|
|
||||||
default: 'latest'
|
|
||||||
environment:
|
|
||||||
description: 'Target environment'
|
|
||||||
required: true
|
|
||||||
default: 'dev'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- dev
|
|
||||||
- production
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: deploy-mokogitea
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: git.mokoconsulting.tech
|
|
||||||
IMAGE: mokoconsulting/mokogitea
|
|
||||||
DEPLOY_HOST: git.mokoconsulting.tech
|
|
||||||
DEPLOY_PORT: 2918
|
|
||||||
DEPLOY_USER: mokoconsulting
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout source (for version detection)
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Determine settings
|
|
||||||
id: config
|
|
||||||
run: |
|
|
||||||
# On push to main, auto-deploy to production with git-derived version.
|
|
||||||
# On workflow_dispatch, use the provided inputs.
|
|
||||||
if [ "${{ github.event_name }}" = "push" ]; then
|
|
||||||
VERSION=$(git describe --tags --always 2>/dev/null || echo "dev-$(git rev-parse --short HEAD)")
|
|
||||||
ENV="production"
|
|
||||||
else
|
|
||||||
VERSION="${{ github.event.inputs.version }}"
|
|
||||||
ENV="${{ github.event.inputs.environment }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ENV" = "production" ]; then
|
|
||||||
echo "compose_dir=/opt/gitea" >> $GITHUB_OUTPUT
|
|
||||||
echo "container=mokogitea" >> $GITHUB_OUTPUT
|
|
||||||
echo "source_dir=/opt/gitea/source" >> $GITHUB_OUTPUT
|
|
||||||
echo "branch=main" >> $GITHUB_OUTPUT
|
|
||||||
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
echo "instance_url=https://git.mokoconsulting.tech" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "compose_dir=/opt/gitea-dev" >> $GITHUB_OUTPUT
|
|
||||||
echo "container=mokogitea-dev" >> $GITHUB_OUTPUT
|
|
||||||
echo "source_dir=/opt/gitea-dev/source" >> $GITHUB_OUTPUT
|
|
||||||
echo "branch=dev" >> $GITHUB_OUTPUT
|
|
||||||
echo "tag=${VERSION}-dev" >> $GITHUB_OUTPUT
|
|
||||||
echo "instance_url=https://git.dev.mokoconsulting.tech" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Enable maintenance mode
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
INSTANCE_URL: ${{ steps.config.outputs.instance_url }}
|
|
||||||
run: |
|
|
||||||
echo "Enabling maintenance mode on ${INSTANCE_URL}..."
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
||||||
"${INSTANCE_URL}/-/admin/config" \
|
|
||||||
-d 'key=instance.maintenance_mode&value={"AdminWebAccessOnly":true}' \
|
|
||||||
|| echo "WARNING: Could not enable maintenance mode (instance may be down)"
|
|
||||||
|
|
||||||
- name: Build and deploy via SSH
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
||||||
TAG: ${{ steps.config.outputs.tag }}
|
|
||||||
BRANCH: ${{ steps.config.outputs.branch }}
|
|
||||||
SOURCE_DIR: ${{ steps.config.outputs.source_dir }}
|
|
||||||
COMPOSE_DIR: ${{ steps.config.outputs.compose_dir }}
|
|
||||||
CONTAINER: ${{ steps.config.outputs.container }}
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key
|
|
||||||
chmod 600 ~/.ssh/deploy_key
|
|
||||||
|
|
||||||
SSH_CMD="ssh -i ~/.ssh/deploy_key -p ${{ env.DEPLOY_PORT }} -o ConnectTimeout=30 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}"
|
|
||||||
|
|
||||||
$SSH_CMD "echo 'SSH connected'"
|
|
||||||
|
|
||||||
# Pre-deploy cleanup: free disk and memory for the build
|
|
||||||
$SSH_CMD "
|
|
||||||
echo 'Cleaning Docker build cache and unused images...'
|
|
||||||
docker builder prune -af 2>/dev/null || true
|
|
||||||
docker image prune -af 2>/dev/null || true
|
|
||||||
echo 'Clearing swap...'
|
|
||||||
sudo swapoff -a && sudo swapon -a 2>/dev/null || true
|
|
||||||
echo 'Cleanup complete'
|
|
||||||
free -m | head -3
|
|
||||||
"
|
|
||||||
|
|
||||||
# Pull latest source
|
|
||||||
$SSH_CMD "
|
|
||||||
set -e
|
|
||||||
if [ ! -d ${SOURCE_DIR}/.git ]; then
|
|
||||||
git clone -b ${BRANCH} https://git.mokoconsulting.tech/MokoConsulting/MokoGitea.git ${SOURCE_DIR}
|
|
||||||
fi
|
|
||||||
cd ${SOURCE_DIR}
|
|
||||||
git fetch origin ${BRANCH}
|
|
||||||
git reset --hard origin/${BRANCH}
|
|
||||||
"
|
|
||||||
|
|
||||||
# Build Docker image
|
|
||||||
$SSH_CMD "
|
|
||||||
set -e
|
|
||||||
cd ${SOURCE_DIR}
|
|
||||||
docker build --no-cache --build-arg GOFLAGS='-p 1' \
|
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:${TAG} \
|
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest \
|
|
||||||
-f Dockerfile .
|
|
||||||
"
|
|
||||||
|
|
||||||
# Push to container registry
|
|
||||||
$SSH_CMD "
|
|
||||||
set -e
|
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${TAG}
|
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
||||||
"
|
|
||||||
|
|
||||||
# Update compose and restart
|
|
||||||
$SSH_CMD "
|
|
||||||
set -e
|
|
||||||
cd ${COMPOSE_DIR}
|
|
||||||
sed -i 's|${{ env.IMAGE }}:[^ ]*|${{ env.IMAGE }}:${TAG}|' docker-compose.yml
|
|
||||||
docker compose up -d ${CONTAINER}
|
|
||||||
"
|
|
||||||
|
|
||||||
# Health check
|
|
||||||
$SSH_CMD "
|
|
||||||
for i in 1 2 3 4 5 6 7 8; do
|
|
||||||
sleep 15
|
|
||||||
if docker inspect --format='{{.State.Health.Status}}' ${CONTAINER} 2>/dev/null | grep -q healthy; then
|
|
||||||
echo 'Container healthy!'
|
|
||||||
docker inspect --format='Image: {{.Config.Image}}' ${CONTAINER}
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo \"Waiting... (attempt \$i/8)\"
|
|
||||||
done
|
|
||||||
echo 'Health check failed'
|
|
||||||
docker logs ${CONTAINER} --tail 20
|
|
||||||
exit 1
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Update updates.xml
|
|
||||||
if: success()
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
TAG: ${{ steps.config.outputs.tag }}
|
|
||||||
INSTANCE_URL: ${{ steps.config.outputs.instance_url }}
|
|
||||||
DEPLOY_ENV: ${{ github.event.inputs.environment || 'production' }}
|
|
||||||
run: |
|
|
||||||
# Only update updates.xml for production stable releases
|
|
||||||
if [ "$DEPLOY_ENV" != "production" ]; then
|
|
||||||
echo "Skipping updates.xml — dev deployments don't update stable channel"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract moko version from tag (e.g. v1.26.1-moko.05.01.01 -> 05.01.01)
|
|
||||||
MOKO_VER=$(echo "$TAG" | sed -n 's/.*-moko\.\(.*\)/\1/p')
|
|
||||||
if [ -z "$MOKO_VER" ]; then
|
|
||||||
echo "Could not extract moko version from tag: $TAG"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
RELEASE_URL="https://${REGISTRY}/MokoConsulting/MokoGitea/releases/tag/${TAG}"
|
|
||||||
DOCKER_IMG="${REGISTRY}/${IMAGE}:${TAG}"
|
|
||||||
|
|
||||||
python3 << PYEOF
|
|
||||||
import json, os, re, base64, urllib.request
|
|
||||||
|
|
||||||
token = os.environ["GITEA_TOKEN"]
|
|
||||||
registry = os.environ["REGISTRY"]
|
|
||||||
tag = os.environ["TAG"]
|
|
||||||
moko_ver = os.environ["MOKO_VER"]
|
|
||||||
release_url = os.environ["RELEASE_URL"]
|
|
||||||
docker_img = os.environ["DOCKER_IMG"]
|
|
||||||
api = f"https://{registry}/api/v1/repos/MokoConsulting/MokoGitea"
|
|
||||||
|
|
||||||
# Fetch current updates.xml
|
|
||||||
req = urllib.request.Request(f"{api}/contents/updates.xml?ref=main",
|
|
||||||
headers={"Authorization": f"token {token}"})
|
|
||||||
with urllib.request.urlopen(req) as resp:
|
|
||||||
data = json.loads(resp.read())
|
|
||||||
sha = data["sha"]
|
|
||||||
content = base64.b64decode(data["content"]).decode("utf-8")
|
|
||||||
|
|
||||||
# Update stable channel — match the <update> block containing <tag>stable</tag>
|
|
||||||
def replace_channel(xml, channel, ver, url, docker):
|
|
||||||
pattern = rf"(<update>\s*<name>MokoGitea</name>[\s\S]*?<tags><tag>{channel}</tag></tags>[\s\S]*?</update>)"
|
|
||||||
def replacer(m):
|
|
||||||
block = m.group(1)
|
|
||||||
block = re.sub(r"<version>[^<]*</version>", f"<version>{ver}</version>", block)
|
|
||||||
block = re.sub(r"(<infourl[^>]*>)[^<]*(</infourl>)", rf"\1{url}\2", block)
|
|
||||||
block = re.sub(r"(<downloadurl[^>]*>)[^<]*(</downloadurl>)", rf"\1{docker}\2", block)
|
|
||||||
return block
|
|
||||||
return re.sub(pattern, replacer, xml)
|
|
||||||
|
|
||||||
content = replace_channel(content, "stable", moko_ver, release_url, docker_img)
|
|
||||||
content = re.sub(r"VERSION: [^\n]*", f"VERSION: {moko_ver}", content)
|
|
||||||
|
|
||||||
# Push updated file
|
|
||||||
encoded = base64.b64encode(content.encode()).decode()
|
|
||||||
payload = json.dumps({
|
|
||||||
"message": f"chore(ci): update updates.xml to {moko_ver}",
|
|
||||||
"content": encoded,
|
|
||||||
"sha": sha,
|
|
||||||
"branch": "main",
|
|
||||||
}).encode()
|
|
||||||
req = urllib.request.Request(f"{api}/contents/updates.xml",
|
|
||||||
data=payload, method="PUT",
|
|
||||||
headers={"Authorization": f"token {token}", "Content-Type": "application/json"})
|
|
||||||
with urllib.request.urlopen(req) as resp:
|
|
||||||
print(f"updates.xml updated to {moko_ver}")
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
- name: Disable maintenance mode
|
|
||||||
if: always()
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
INSTANCE_URL: ${{ steps.config.outputs.instance_url }}
|
|
||||||
run: |
|
|
||||||
echo "Disabling maintenance mode on ${INSTANCE_URL}..."
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
||||||
"${INSTANCE_URL}/-/admin/config" \
|
|
||||||
-d 'key=instance.maintenance_mode&value={"AdminWebAccessOnly":false}' \
|
|
||||||
|| echo "WARNING: Could not disable maintenance mode"
|
|
||||||
|
|
||||||
- name: Verify
|
|
||||||
run: |
|
|
||||||
sleep 5
|
|
||||||
curl -sf https://${{ env.DEPLOY_HOST }}/api/healthz && echo " — API healthy"
|
|
||||||
|
|
||||||
- name: Notify on failure
|
|
||||||
if: failure()
|
|
||||||
run: echo "::error::Deploy failed for ${{ steps.config.outputs.tag }}"
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Automation
|
|
||||||
# VERSION: 05.07.00
|
|
||||||
# BRIEF: Auto-create feature branch when an issue is opened
|
|
||||||
|
|
||||||
name: "Universal: Issue Branch"
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
issues: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
create-branch:
|
|
||||||
name: Create feature branch
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Create branch and comment
|
|
||||||
run: |
|
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
|
||||||
ISSUE_NUM="${{ github.event.issue.number }}"
|
|
||||||
ISSUE_TITLE="${{ github.event.issue.title }}"
|
|
||||||
|
|
||||||
# Build slug from title: lowercase, replace non-alnum with dash, trim
|
|
||||||
SLUG=$(echo "${ISSUE_TITLE}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-40)
|
|
||||||
BRANCH="feature/${ISSUE_NUM}-${SLUG}"
|
|
||||||
|
|
||||||
# Check dev branch exists
|
|
||||||
DEV_EXISTS=$(curl -sf -o /dev/null -w '%{http_code}' \
|
|
||||||
-H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API}/branches/dev" 2>/dev/null || echo "000")
|
|
||||||
|
|
||||||
if [ "${DEV_EXISTS}" != "200" ]; then
|
|
||||||
echo "No dev branch -- skipping"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create branch from dev
|
|
||||||
HTTP=$(curl -sf -o /dev/null -w '%{http_code}' -X POST \
|
|
||||||
-H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/branches" \
|
|
||||||
-d "{\"new_branch_name\":\"${BRANCH}\",\"old_branch_name\":\"dev\"}" 2>/dev/null || echo "000")
|
|
||||||
|
|
||||||
if [ "${HTTP}" = "201" ]; then
|
|
||||||
echo "Created branch: ${BRANCH}"
|
|
||||||
|
|
||||||
# Comment on issue with branch link
|
|
||||||
REPO_URL="${GITEA_URL}/${{ github.repository }}"
|
|
||||||
BODY="Branch created: [\`${BRANCH}\`](${REPO_URL}/src/branch/${BRANCH})\n\n\`\`\`bash\ngit fetch origin\ngit checkout ${BRANCH}\n\`\`\`"
|
|
||||||
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/issues/${ISSUE_NUM}/comments" \
|
|
||||||
-d "{\"body\":\"${BODY}\"}" > /dev/null 2>&1
|
|
||||||
|
|
||||||
echo "Commented on issue #${ISSUE_NUM}"
|
|
||||||
else
|
|
||||||
echo "Failed to create branch (HTTP ${HTTP}) -- may already exist"
|
|
||||||
fi
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# Enforces branch merge policy:
|
|
||||||
# feature/* → dev only
|
|
||||||
# fix/* → dev only
|
|
||||||
# hotfix/* → dev or main (emergency)
|
|
||||||
# dev → main only
|
|
||||||
# alpha/* → dev only
|
|
||||||
# beta/* → dev only
|
|
||||||
# rc/* → main only
|
|
||||||
|
|
||||||
name: Branch Policy Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-target:
|
|
||||||
name: Verify merge target
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check branch policy
|
|
||||||
run: |
|
|
||||||
HEAD="${{ github.head_ref }}"
|
|
||||||
BASE="${{ github.base_ref }}"
|
|
||||||
|
|
||||||
echo "PR: ${HEAD} → ${BASE}"
|
|
||||||
|
|
||||||
ALLOWED=true
|
|
||||||
REASON=""
|
|
||||||
|
|
||||||
case "$HEAD" in
|
|
||||||
feature/*|feat/*)
|
|
||||||
if [ "$BASE" != "dev" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Feature branches must target 'dev', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
fix/*|bugfix/*)
|
|
||||||
if [ "$BASE" != "dev" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Fix branches must target 'dev', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
hotfix/*)
|
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Hotfix branches can only target 'dev' or 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
alpha/*|beta/*)
|
|
||||||
if [ "$BASE" != "dev" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Pre-release branches must target 'dev', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
rc/*)
|
|
||||||
if [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Release candidate branches must target 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
dev)
|
|
||||||
if [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Dev branch can only merge into 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ "$ALLOWED" = false ]; then
|
|
||||||
echo "::error::${REASON}"
|
|
||||||
echo ""
|
|
||||||
echo "## Branch Policy Violation" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "${REASON}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
|
||||||
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
|
||||||
@@ -1,236 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.CI
|
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
|
||||||
# PATH: /templates/workflows/universal/pr-check.yml.template
|
|
||||||
# VERSION: 05.00.00
|
|
||||||
# BRIEF: PR gate — branch policy + code validation before merge
|
|
||||||
|
|
||||||
name: "Universal: PR Check"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, edited]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# ── Branch Policy ──────────────────────────────────────────────────────
|
|
||||||
branch-policy:
|
|
||||||
name: Branch Policy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check branch merge target
|
|
||||||
run: |
|
|
||||||
HEAD="${{ github.head_ref }}"
|
|
||||||
BASE="${{ github.base_ref }}"
|
|
||||||
|
|
||||||
echo "PR: ${HEAD} → ${BASE}"
|
|
||||||
|
|
||||||
ALLOWED=true
|
|
||||||
REASON=""
|
|
||||||
|
|
||||||
case "$HEAD" in
|
|
||||||
feature/*|feat/*)
|
|
||||||
if [ "$BASE" != "dev" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Feature branches must target 'dev', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
fix/*|bugfix/*)
|
|
||||||
if [ "$BASE" != "dev" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Fix branches must target 'dev', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
patch/*)
|
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Patch branches must target 'dev' or 'rc', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
hotfix/*)
|
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Hotfix branches can only target 'dev' or 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
rc)
|
|
||||||
if [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="RC branch can only merge into 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
dev)
|
|
||||||
if [ "$BASE" != "main" ]; then
|
|
||||||
ALLOWED=false
|
|
||||||
REASON="Dev branch can only merge into 'main', not '${BASE}'"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ "$ALLOWED" = false ]; then
|
|
||||||
echo "::error::${REASON}"
|
|
||||||
echo "## Branch Policy Violation" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "${REASON}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
|
||||||
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# ── Code Validation ────────────────────────────────────────────────────
|
|
||||||
validate:
|
|
||||||
name: Validate PR
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Detect platform
|
|
||||||
id: platform
|
|
||||||
run: |
|
|
||||||
# Read platform from XML manifest (<platform> tag) or plain text fallback
|
|
||||||
PLATFORM=$(sed -n 's/.*<platform>\([^<]*\)<\/platform>.*/\1/p' .mokogitea/manifest.xml 2>/dev/null | head -1)
|
|
||||||
[ -z "$PLATFORM" ] && PLATFORM=$(cat .mokogitea/manifest.xml 2>/dev/null | tr -d '[:space:]')
|
|
||||||
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
|
||||||
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
|
||||||
run: |
|
|
||||||
if ! command -v php &> /dev/null; then
|
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: PHP syntax check
|
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
|
||||||
run: |
|
|
||||||
ERRORS=0
|
|
||||||
while IFS= read -r -d '' file; do
|
|
||||||
if ! php -l "$file" 2>&1 | grep -q "No syntax errors"; then
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
done < <(find . -name "*.php" -not -path "./.git/*" -not -path "./vendor/*" -print0)
|
|
||||||
echo "PHP lint: ${ERRORS} error(s)"
|
|
||||||
[ "$ERRORS" -eq 0 ] || { echo "::error::PHP syntax errors found"; exit 1; }
|
|
||||||
|
|
||||||
- name: Validate platform manifest
|
|
||||||
run: |
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
case "$PLATFORM" in
|
|
||||||
joomla)
|
|
||||||
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
|
||||||
if [ -z "$MANIFEST" ]; then
|
|
||||||
echo "::warning::No Joomla manifest found (WaaS site)"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "Manifest: ${MANIFEST}"
|
|
||||||
if command -v php &> /dev/null; then
|
|
||||||
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('$MANIFEST'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::Manifest XML is malformed"; exit 1; }
|
|
||||||
fi
|
|
||||||
for ELEMENT in name version description; do
|
|
||||||
grep -q "<${ELEMENT}>" "$MANIFEST" || { echo "::error::Missing <${ELEMENT}> in manifest"; exit 1; }
|
|
||||||
done
|
|
||||||
echo "Joomla manifest valid"
|
|
||||||
;;
|
|
||||||
dolibarr)
|
|
||||||
MOD_FILE=$(find . -maxdepth 4 -name "mod*.class.php" ! -path "./.git/*" -exec grep -l 'extends DolibarrModules' {} \; 2>/dev/null | head -1)
|
|
||||||
if [ -z "$MOD_FILE" ]; then
|
|
||||||
echo "::error::No mod*.class.php found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Dolibarr module: ${MOD_FILE}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Generic platform — no manifest validation"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Check update stream format
|
|
||||||
run: |
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
case "$PLATFORM" in
|
|
||||||
joomla)
|
|
||||||
if [ -f "updates.xml" ]; then
|
|
||||||
if command -v php &> /dev/null; then
|
|
||||||
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('updates.xml'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::updates.xml is malformed"; exit 1; }
|
|
||||||
fi
|
|
||||||
echo "updates.xml valid"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
dolibarr)
|
|
||||||
[ -f "update.txt" ] && echo "update.txt present" || echo "::warning::No update.txt"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Check changelog has unreleased entry
|
|
||||||
run: |
|
|
||||||
if [ ! -f "CHANGELOG.md" ]; then
|
|
||||||
echo "::warning::No CHANGELOG.md found"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
# Check for content under [Unreleased] section
|
|
||||||
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
|
|
||||||
echo "::error::CHANGELOG.md missing [Unreleased] section"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# Check there's at least one entry (Added/Changed/Fixed/Removed) under Unreleased
|
|
||||||
UNRELEASED_CONTENT=$(sed -n '/## \[Unreleased\]/,/## \[/p' CHANGELOG.md | grep -cE '^\s*-\s' || true)
|
|
||||||
if [ "$UNRELEASED_CONTENT" -eq 0 ]; then
|
|
||||||
echo "::error::CHANGELOG.md [Unreleased] section has no entries. Add a changelog entry describing your changes."
|
|
||||||
echo "## Changelog Check: Failed" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "The \`[Unreleased]\` section in CHANGELOG.md has no entries." >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Add a line like \`- Description of your change\` under a heading (\`### Added\`, \`### Changed\`, \`### Fixed\`, etc.)" >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Changelog: ${UNRELEASED_CONTENT} entry/entries in [Unreleased]"
|
|
||||||
|
|
||||||
- name: Verify package source
|
|
||||||
run: |
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
if [ ! -d "$SOURCE_DIR" ]; then
|
|
||||||
echo "::warning::No src/ or htdocs/ directory"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
FILE_COUNT=$(find "$SOURCE_DIR" -type f | wc -l)
|
|
||||||
echo "Source: ${FILE_COUNT} files"
|
|
||||||
[ "$FILE_COUNT" -gt 0 ] || { echo "::error::Source directory is empty"; exit 1; }
|
|
||||||
|
|
||||||
# ── Pre-Release RC Build ─────────────────────────────────────────────────
|
|
||||||
pre-release:
|
|
||||||
name: Build RC Package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [branch-policy, validate]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Trigger RC pre-release
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
BRANCH: ${{ github.head_ref }}
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
run: |
|
|
||||||
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
|
||||||
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# BRIEF: Auto-build RC release on PR to main, update RC update stream
|
|
||||||
|
|
||||||
name: "PR RC Release"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize]
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
REGISTRY: git.mokoconsulting.tech
|
|
||||||
IMAGE: mokoconsulting/mokogitea
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rc-release:
|
|
||||||
name: Build RC Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check target branch
|
|
||||||
id: guard
|
|
||||||
env:
|
|
||||||
BASE_BRANCH: ${{ github.base_ref }}
|
|
||||||
run: |
|
|
||||||
echo "PR target: ${BASE_BRANCH}"
|
|
||||||
if [ "$BASE_BRANCH" != "main" ]; then
|
|
||||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "Skipping RC — only for PRs targeting main"
|
|
||||||
else
|
|
||||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Checkout PR branch
|
|
||||||
if: steps.guard.outputs.skip != 'true'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Determine RC version
|
|
||||||
if: steps.guard.outputs.skip != 'true'
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
BASE_VERSION=$(sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' updates.xml | head -1)
|
|
||||||
[ -z "$BASE_VERSION" ] && BASE_VERSION="04.00.00"
|
|
||||||
RC_VERSION="${BASE_VERSION}-rc.${PR_NUMBER}"
|
|
||||||
RC_TAG="v1.26.1-moko.${RC_VERSION}"
|
|
||||||
echo "version=$RC_VERSION" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "tag=$RC_TAG" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "RC version: $RC_VERSION (tag: $RC_TAG)"
|
|
||||||
|
|
||||||
- name: Update updates.xml RC channel
|
|
||||||
if: steps.guard.outputs.skip != 'true'
|
|
||||||
env:
|
|
||||||
RC_VERSION: ${{ steps.version.outputs.version }}
|
|
||||||
RC_TAG: ${{ steps.version.outputs.tag }}
|
|
||||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
||||||
PR_NUM: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
DOCKER_TAG="${REGISTRY}/${IMAGE}:${RC_TAG}"
|
|
||||||
|
|
||||||
python3 << 'PYEOF'
|
|
||||||
import os, re
|
|
||||||
|
|
||||||
rc_version = os.environ["RC_VERSION"]
|
|
||||||
rc_tag = os.environ["RC_TAG"]
|
|
||||||
pr_url = os.environ["PR_URL"]
|
|
||||||
pr_num = os.environ["PR_NUM"]
|
|
||||||
docker_tag = os.environ["REGISTRY"] + "/" + os.environ["IMAGE"] + ":" + rc_tag
|
|
||||||
|
|
||||||
entry = f""" <update>
|
|
||||||
<name>MokoGitea</name>
|
|
||||||
<description>MokoGitea RC from PR #{pr_num}</description>
|
|
||||||
<element>mokogitea</element>
|
|
||||||
<type>application</type>
|
|
||||||
<version>{rc_version}</version>
|
|
||||||
<client>server</client>
|
|
||||||
<tags><tag>rc</tag></tags>
|
|
||||||
<infourl title="MokoGitea RC">{pr_url}</infourl>
|
|
||||||
<downloads>
|
|
||||||
<downloadurl type="full" format="docker">{docker_tag}</downloadurl>
|
|
||||||
</downloads>
|
|
||||||
<sha256></sha256>
|
|
||||||
<targetplatform name="mokogitea" version="((1\\.25\\.)|(1\\.26\\.))" />
|
|
||||||
<maintainer>Moko Consulting</maintainer>
|
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
|
||||||
</update>"""
|
|
||||||
|
|
||||||
content = open("updates.xml").read()
|
|
||||||
# Remove existing RC entry
|
|
||||||
content = re.sub(
|
|
||||||
r"\s*<update>[\s\S]*?<tag>rc</tag>[\s\S]*?</update>",
|
|
||||||
"",
|
|
||||||
content,
|
|
||||||
)
|
|
||||||
# Insert before </updates>
|
|
||||||
content = content.replace("</updates>", entry + "\n</updates>")
|
|
||||||
open("updates.xml", "w").write(content)
|
|
||||||
print(f"Updated updates.xml with RC entry: {rc_version}")
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
- name: Create RC release
|
|
||||||
if: steps.guard.outputs.skip != 'true'
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
RC_TAG: ${{ steps.version.outputs.tag }}
|
|
||||||
RC_VERSION: ${{ steps.version.outputs.version }}
|
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
||||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
||||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
||||||
API_BASE: https://${{ env.REGISTRY }}/api/v1/repos/${{ github.repository }}
|
|
||||||
run: |
|
|
||||||
# Delete existing RC release/tag if present
|
|
||||||
curl -s -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API_BASE}/releases/tags/${RC_TAG}" 2>/dev/null || true
|
|
||||||
curl -s -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API_BASE}/tags/${RC_TAG}" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Create prerelease
|
|
||||||
python3 << PYEOF
|
|
||||||
import json, os, urllib.request
|
|
||||||
|
|
||||||
api = os.environ["API_BASE"]
|
|
||||||
token = os.environ["GITEA_TOKEN"]
|
|
||||||
payload = json.dumps({
|
|
||||||
"tag_name": os.environ["RC_TAG"],
|
|
||||||
"target_commitish": os.environ["HEAD_SHA"],
|
|
||||||
"name": f"RC: {os.environ['PR_TITLE']}",
|
|
||||||
"body": f"Release candidate from PR #{os.environ['PR_NUMBER']}\n\nPR: {os.environ['PR_URL']}\nDocker: docker pull {os.environ['REGISTRY']}/{os.environ['IMAGE']}:{os.environ['RC_TAG']}",
|
|
||||||
"draft": False,
|
|
||||||
"prerelease": True,
|
|
||||||
}).encode()
|
|
||||||
|
|
||||||
req = urllib.request.Request(
|
|
||||||
f"{api}/releases",
|
|
||||||
data=payload,
|
|
||||||
headers={
|
|
||||||
"Authorization": f"token {token}",
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
method="POST",
|
|
||||||
)
|
|
||||||
with urllib.request.urlopen(req) as resp:
|
|
||||||
result = json.loads(resp.read())
|
|
||||||
print(f"Created RC release: {result.get('tag_name')}")
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
- name: Commit updates.xml
|
|
||||||
if: steps.guard.outputs.skip != 'true'
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
|
||||||
PR_NUM: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
git config user.name "MokoGitea Bot"
|
|
||||||
git config user.email "deploy@mokoconsulting.tech"
|
|
||||||
git add updates.xml
|
|
||||||
if git diff --cached --quiet; then
|
|
||||||
echo "No changes to updates.xml"
|
|
||||||
else
|
|
||||||
git commit -m "chore(ci): update RC stream for PR #${PR_NUM}"
|
|
||||||
git push origin "HEAD:${HEAD_REF}" || echo "Push failed"
|
|
||||||
fi
|
|
||||||
@@ -1,233 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Release
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
|
||||||
# VERSION: 05.01.00
|
|
||||||
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
|
|
||||||
|
|
||||||
name: "Universal: Pre-Release"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [closed]
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
stability:
|
|
||||||
description: 'Pre-release channel'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- development
|
|
||||||
- alpha
|
|
||||||
- beta
|
|
||||||
- release-candidate
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
|
||||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: "Build Pre-Release (${{ inputs.stability || 'development' }})"
|
|
||||||
runs-on: release
|
|
||||||
if: >-
|
|
||||||
github.event_name == 'workflow_dispatch' ||
|
|
||||||
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
|
||||||
env:
|
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
|
||||||
run: |
|
|
||||||
if ! command -v composer &> /dev/null; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
|
||||||
rm -rf /tmp/moko-platform-api
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
|
||||||
/tmp/moko-platform-api
|
|
||||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
|
||||||
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Detect platform
|
|
||||||
id: platform
|
|
||||||
run: |
|
|
||||||
php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
|
||||||
|
|
||||||
- name: Resolve metadata and bump version
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
STABILITY="${{ inputs.stability || 'development' }}"
|
|
||||||
|
|
||||||
case "$STABILITY" in
|
|
||||||
development) SUFFIX="-dev"; TAG="development" ;;
|
|
||||||
alpha) SUFFIX="-alpha"; TAG="alpha" ;;
|
|
||||||
beta) SUFFIX="-beta"; TAG="beta" ;;
|
|
||||||
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Read current version (bump already handled by push workflow)
|
|
||||||
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null)
|
|
||||||
[ -z "$VERSION" ] && VERSION="00.00.01"
|
|
||||||
|
|
||||||
# Strip any existing suffix from version before applying stability
|
|
||||||
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
|
||||||
|
|
||||||
php ${MOKO_CLI}/version_set_platform.php \
|
|
||||||
--path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Verify version consistency across all files
|
|
||||||
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
|
||||||
|
|
||||||
# Update VERSION variable with suffix
|
|
||||||
if [ -n "$SUFFIX" ]; then
|
|
||||||
VERSION="${VERSION}${SUFFIX}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Commit version bump
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
||||||
git add -A
|
|
||||||
git diff --cached --quiet || {
|
|
||||||
git commit -m "chore(version): pre-release bump to ${VERSION} [skip ci]"
|
|
||||||
git push origin HEAD 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Auto-detect element via manifest_element.php
|
|
||||||
php ${MOKO_CLI}/manifest_element.php \
|
|
||||||
--path . --version "$VERSION" --stability "$STABILITY" \
|
|
||||||
--repo "${GITEA_REPO}" --github-output
|
|
||||||
|
|
||||||
# Read back element outputs
|
|
||||||
EXT_ELEMENT=$(grep '^ext_element=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
|
|
||||||
ZIP_NAME=$(grep '^zip_name=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
|
|
||||||
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
|
|
||||||
[ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}.zip"
|
|
||||||
|
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "ext_element=${EXT_ELEMENT}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ==="
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
id: release
|
|
||||||
run: |
|
|
||||||
TAG="${{ steps.meta.outputs.tag }}"
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
php ${MOKO_CLI}/release_create.php \
|
|
||||||
--path . --version "$VERSION" --tag "$TAG" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
||||||
--repo "${GITEA_REPO}" --branch dev --prerelease
|
|
||||||
|
|
||||||
- name: Build package and upload
|
|
||||||
id: package
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
TAG="${{ steps.meta.outputs.tag }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
php ${MOKO_CLI}/release_package.php \
|
|
||||||
--path . --version "$VERSION" --tag "$TAG" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
||||||
--repo "${GITEA_REPO}" --output /tmp || true
|
|
||||||
|
|
||||||
- name: Update updates.xml
|
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
||||||
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
|
||||||
|
|
||||||
if [ ! -f "updates.xml" ]; then
|
|
||||||
echo "No updates.xml -- skipping"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
SHA_FLAG=""
|
|
||||||
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
|
||||||
|
|
||||||
php ${MOKO_CLI}/updates_xml_build.php \
|
|
||||||
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
|
||||||
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
|
||||||
${SHA_FLAG}
|
|
||||||
|
|
||||||
# Commit and push
|
|
||||||
if ! git diff --quiet updates.xml 2>/dev/null; then
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
git add updates.xml
|
|
||||||
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
|
||||||
git push origin HEAD 2>&1 || echo "WARNING: push failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: "Sync updates.xml to all branches"
|
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
CURRENT_BRANCH="${{ github.ref_name }}"
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
|
|
||||||
for BRANCH in main dev; do
|
|
||||||
[ "$BRANCH" = "$CURRENT_BRANCH" ] && continue
|
|
||||||
echo "Syncing updates.xml -> ${BRANCH}"
|
|
||||||
git fetch origin "${BRANCH}" 2>/dev/null || continue
|
|
||||||
git checkout "origin/${BRANCH}" -- updates.xml 2>/dev/null || continue
|
|
||||||
git checkout "${CURRENT_BRANCH}" -- updates.xml
|
|
||||||
if ! git diff --quiet updates.xml 2>/dev/null; then
|
|
||||||
git add updates.xml
|
|
||||||
git commit -m "chore: sync updates.xml from ${CURRENT_BRANCH} [skip ci]"
|
|
||||||
git push origin HEAD:refs/heads/${BRANCH} 2>&1 || echo "WARNING: push to ${BRANCH} failed"
|
|
||||||
fi
|
|
||||||
git checkout "${CURRENT_BRANCH}" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: "Delete lesser pre-release channels (cascade)"
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
php ${MOKO_CLI}/release_cascade.php \
|
|
||||||
--stability "${{ steps.meta.outputs.stability }}" \
|
|
||||||
--token "${TOKEN}" \
|
|
||||||
--api-base "${API_BASE}"
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
||||||
ZIP_NAME="${{ steps.meta.outputs.zip_name }}"
|
|
||||||
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
|
||||||
echo "## Pre-Release Complete" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Channel | ${STABILITY} |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Package | \`${ZIP_NAME}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| SHA-256 | \`${SHA256:-n/a}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Test workflow to verify .mokogitea/ directory is discovered
|
|
||||||
name: Test .mokogitea workflows
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Verify .mokogitea
|
|
||||||
run: echo "This workflow ran from .mokogitea/workflows/ — feature works!"
|
|
||||||
@@ -1,312 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Universal
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /templates/workflows/update-server.yml
|
|
||||||
# VERSION: 05.00.00
|
|
||||||
# BRIEF: Pre-release build + update server XML for dev/alpha/beta/rc branches
|
|
||||||
#
|
|
||||||
# Thin wrapper around moko-platform CLI tools.
|
|
||||||
# Builds packages, updates updates.xml, and optionally deploys via SFTP.
|
|
||||||
#
|
|
||||||
# Joomla filters update entries by the user's "Minimum Stability" setting.
|
|
||||||
|
|
||||||
name: "Update Server"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'dev'
|
|
||||||
- 'dev/**'
|
|
||||||
- 'alpha/**'
|
|
||||||
- 'beta/**'
|
|
||||||
- 'rc/**'
|
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- 'htdocs/**'
|
|
||||||
pull_request:
|
|
||||||
types: [closed]
|
|
||||||
branches:
|
|
||||||
- 'dev'
|
|
||||||
- 'dev/**'
|
|
||||||
- 'alpha/**'
|
|
||||||
- 'beta/**'
|
|
||||||
- 'rc/**'
|
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- 'htdocs/**'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
stability:
|
|
||||||
description: 'Stability tag'
|
|
||||||
required: true
|
|
||||||
default: 'development'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- development
|
|
||||||
- alpha
|
|
||||||
- beta
|
|
||||||
- rc
|
|
||||||
- stable
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
|
||||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-xml:
|
|
||||||
name: Update Server
|
|
||||||
runs-on: release
|
|
||||||
if: >-
|
|
||||||
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
|
||||||
env:
|
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
|
||||||
COMPOSER_AUTH: '{"http-basic":{"git.mokoconsulting.tech":{"username":"token","password":"${{ secrets.MOKOGITEA_TOKEN }}"}}}'
|
|
||||||
run: |
|
|
||||||
if ! command -v composer &> /dev/null; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
|
||||||
rm -rf /tmp/moko-platform
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
|
||||||
/tmp/moko-platform 2>/dev/null || true
|
|
||||||
if [ -d "/tmp/moko-platform" ] && [ -f "/tmp/moko-platform/composer.json" ]; then
|
|
||||||
cd /tmp/moko-platform && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
echo "MOKO_CLI=/tmp/moko-platform/cli" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Detect platform
|
|
||||||
id: platform
|
|
||||||
run: php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
|
||||||
|
|
||||||
- name: Resolve stability and bump version
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
BRANCH="${{ github.ref_name }}"
|
|
||||||
|
|
||||||
# Configure git for bot pushes
|
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
||||||
git config --local user.name "gitea-actions[bot]"
|
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
||||||
|
|
||||||
# Auto-bump patch version
|
|
||||||
php ${MOKO_CLI}/version_bump.php --path . 2>/dev/null || true
|
|
||||||
|
|
||||||
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "0.0.0")
|
|
||||||
|
|
||||||
# Strip any existing suffix before applying stability
|
|
||||||
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
|
||||||
|
|
||||||
# Determine stability from branch or manual input
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
STABILITY="${{ inputs.stability }}"
|
|
||||||
elif [[ "$BRANCH" == rc/* ]]; then
|
|
||||||
STABILITY="rc"
|
|
||||||
elif [[ "$BRANCH" == beta/* ]]; then
|
|
||||||
STABILITY="beta"
|
|
||||||
elif [[ "$BRANCH" == alpha/* ]]; then
|
|
||||||
STABILITY="alpha"
|
|
||||||
else
|
|
||||||
STABILITY="development"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Version suffix per stability stream
|
|
||||||
case "$STABILITY" in
|
|
||||||
development) SUFFIX="-dev"; TAG="development" ;;
|
|
||||||
alpha) SUFFIX="-alpha"; TAG="alpha" ;;
|
|
||||||
beta) SUFFIX="-beta"; TAG="beta" ;;
|
|
||||||
rc) SUFFIX="-rc"; TAG="release-candidate" ;;
|
|
||||||
*) SUFFIX=""; TAG="stable" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Propagate version with stability suffix to all manifest files
|
|
||||||
php ${MOKO_CLI}/version_set_platform.php \
|
|
||||||
--path . --version "$VERSION" --branch "$BRANCH" --stability "$STABILITY" 2>/dev/null || true
|
|
||||||
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
|
||||||
|
|
||||||
# Re-read version (now includes suffix from version_set_platform)
|
|
||||||
if [ -n "$SUFFIX" ]; then
|
|
||||||
VERSION="${VERSION}${SUFFIX}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "display_version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
# Commit version bump if changed
|
|
||||||
git add -A
|
|
||||||
git diff --cached --quiet || {
|
|
||||||
git commit -m "chore(version): auto-bump ${VERSION} [skip ci]" \
|
|
||||||
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
|
||||||
git push
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Create release and upload package
|
|
||||||
id: package
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
TAG="${{ steps.meta.outputs.tag }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
|
|
||||||
# Create or update Gitea release
|
|
||||||
php ${MOKO_CLI}/release_create.php \
|
|
||||||
--path . --version "$VERSION" --tag "$TAG" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
||||||
--repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease
|
|
||||||
|
|
||||||
# Build package and upload
|
|
||||||
php ${MOKO_CLI}/release_package.php \
|
|
||||||
--path . --version "$VERSION" --tag "$TAG" \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
||||||
--repo "${GITEA_REPO}" --output /tmp || true
|
|
||||||
|
|
||||||
- name: Update updates.xml
|
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
||||||
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
|
||||||
|
|
||||||
if [ ! -f "updates.xml" ]; then
|
|
||||||
echo "No updates.xml — skipping"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
SHA_FLAG=""
|
|
||||||
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
|
||||||
|
|
||||||
php ${MOKO_CLI}/updates_xml_build.php \
|
|
||||||
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
|
||||||
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
|
||||||
${SHA_FLAG}
|
|
||||||
|
|
||||||
# Commit and push updates.xml
|
|
||||||
git add updates.xml
|
|
||||||
git diff --cached --quiet || {
|
|
||||||
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
|
||||||
git push
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Sync updates.xml to main
|
|
||||||
if: github.ref_name != 'main' && steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
GITEA_TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
FILE_SHA=$(curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API_BASE}/contents/updates.xml?ref=main" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -n "$FILE_SHA" ] && [ -f "updates.xml" ]; then
|
|
||||||
python3 -c "
|
|
||||||
import base64, json, urllib.request, sys
|
|
||||||
with open('updates.xml', 'rb') as f:
|
|
||||||
content = base64.b64encode(f.read()).decode()
|
|
||||||
payload = json.dumps({
|
|
||||||
'content': content,
|
|
||||||
'sha': '${FILE_SHA}',
|
|
||||||
'message': 'chore: sync updates.xml from ${{ steps.meta.outputs.stability }} [skip ci]',
|
|
||||||
'branch': 'main'
|
|
||||||
}).encode()
|
|
||||||
req = urllib.request.Request(
|
|
||||||
'${API_BASE}/contents/updates.xml',
|
|
||||||
data=payload, method='PUT',
|
|
||||||
headers={
|
|
||||||
'Authorization': 'token ${GITEA_TOKEN}',
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
})
|
|
||||||
try:
|
|
||||||
urllib.request.urlopen(req)
|
|
||||||
print('updates.xml synced to main')
|
|
||||||
except Exception as e:
|
|
||||||
print(f'WARNING: sync to main failed: {e}', file=sys.stderr)
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: SFTP deploy to dev server
|
|
||||||
if: contains(github.ref, 'dev/') || github.ref == 'refs/heads/dev'
|
|
||||||
env:
|
|
||||||
DEV_HOST: ${{ vars.DEV_FTP_HOST }}
|
|
||||||
DEV_PATH: ${{ vars.DEV_FTP_PATH }}
|
|
||||||
DEV_SUFFIX: ${{ vars.DEV_FTP_SUFFIX }}
|
|
||||||
DEV_USER: ${{ vars.DEV_FTP_USERNAME }}
|
|
||||||
DEV_PORT: ${{ vars.DEV_FTP_PORT }}
|
|
||||||
DEV_KEY: ${{ secrets.DEV_FTP_KEY }}
|
|
||||||
DEV_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
# Permission check: admin or maintain role required
|
|
||||||
ACTOR="${{ github.actor }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
|
|
||||||
PERMISSION=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
"${API_BASE}/collaborators/${ACTOR}/permission" 2>/dev/null | \
|
|
||||||
python3 -c "import sys,json; print(json.load(sys.stdin).get('permission','read'))" 2>/dev/null || echo "read")
|
|
||||||
case "$PERMISSION" in
|
|
||||||
admin|maintain|write) ;;
|
|
||||||
*)
|
|
||||||
echo "Deploy denied: ${ACTOR} has '${PERMISSION}' — requires admin, maintain, or write"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -z "$DEV_HOST" ] || [ -z "$DEV_PATH" ] && { echo "DEV FTP not configured — skipping SFTP"; exit 0; }
|
|
||||||
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && exit 0
|
|
||||||
|
|
||||||
PORT="${DEV_PORT:-22}"
|
|
||||||
REMOTE="${DEV_PATH%/}"
|
|
||||||
[ -n "$DEV_SUFFIX" ] && REMOTE="${REMOTE}/${DEV_SUFFIX#/}"
|
|
||||||
|
|
||||||
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
|
||||||
"$DEV_HOST" "$PORT" "$DEV_USER" "$REMOTE" > /tmp/sftp-config.json
|
|
||||||
if [ -n "$DEV_KEY" ]; then
|
|
||||||
echo "$DEV_KEY" > /tmp/deploy_key && chmod 600 /tmp/deploy_key
|
|
||||||
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
|
||||||
else
|
|
||||||
printf ',"password":"%s"}' "$DEV_PASS" >> /tmp/sftp-config.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
PLATFORM=$(php ${MOKO_CLI}/platform_detect.php --path . 2>/dev/null || true)
|
|
||||||
if [ "$PLATFORM" = "waas-component" ] && [ -f "${MOKO_CLI}/../deploy/deploy-joomla.php" ]; then
|
|
||||||
php ${MOKO_CLI}/../deploy/deploy-joomla.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
|
||||||
elif [ -f "${MOKO_CLI}/../deploy/deploy-sftp.php" ]; then
|
|
||||||
php ${MOKO_CLI}/../deploy/deploy-sftp.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
|
||||||
fi
|
|
||||||
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
|
||||||
echo "SFTP deploy to dev complete" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
||||||
DISPLAY="${{ steps.meta.outputs.display_version }}"
|
|
||||||
echo "## Update Server" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Stability | \`${STABILITY}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Version | \`${DISPLAY}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# BRIEF: Sync upstream Gitea bug fixes into MokoGitea issue tracker
|
|
||||||
|
|
||||||
name: Upstream Bug Sync
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 8 * * *' # daily at 08:00 UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
days_back:
|
|
||||||
description: 'How many days back to scan (default: 7)'
|
|
||||||
required: false
|
|
||||||
default: '7'
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Sync upstream bugs
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_MIRROR_TOKEN }}
|
|
||||||
MOKOGITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
MOKOGITEA_URL: https://git.mokoconsulting.tech
|
|
||||||
MOKOGITEA_REPO: MokoConsulting/MokoGitea
|
|
||||||
UPSTREAM_BRANCH: release/v1.26
|
|
||||||
DAYS_BACK: ${{ github.event.inputs.days_back || '7' }}
|
|
||||||
run: |
|
|
||||||
python3 << 'PYEOF'
|
|
||||||
import json, os, re, sys, urllib.parse, urllib.request
|
|
||||||
from datetime import datetime, timedelta, timezone
|
|
||||||
|
|
||||||
GH_TOKEN = os.environ["GH_TOKEN"]
|
|
||||||
MOKO_TOKEN = os.environ["MOKOGITEA_TOKEN"]
|
|
||||||
MOKO_URL = os.environ["MOKOGITEA_URL"]
|
|
||||||
MOKO_REPO = os.environ["MOKOGITEA_REPO"]
|
|
||||||
BRANCH = os.environ["UPSTREAM_BRANCH"]
|
|
||||||
DAYS = int(os.environ.get("DAYS_BACK", "7"))
|
|
||||||
|
|
||||||
# Label IDs in MokoGitea
|
|
||||||
LABELS = {
|
|
||||||
"type_bug": 5757, "upstream": 5758, "security": 5032,
|
|
||||||
"critical": 5018, "high": 5019, "medium": 5020, "low": 5021,
|
|
||||||
}
|
|
||||||
|
|
||||||
def gh_get(url):
|
|
||||||
req = urllib.request.Request(url, headers={
|
|
||||||
"Authorization": f"token {GH_TOKEN}",
|
|
||||||
"Accept": "application/vnd.github.v3+json",
|
|
||||||
})
|
|
||||||
with urllib.request.urlopen(req) as r:
|
|
||||||
return json.loads(r.read())
|
|
||||||
|
|
||||||
def moko_get(path):
|
|
||||||
req = urllib.request.Request(f"{MOKO_URL}/api/v1/{path}", headers={
|
|
||||||
"Authorization": f"token {MOKO_TOKEN}",
|
|
||||||
})
|
|
||||||
with urllib.request.urlopen(req) as r:
|
|
||||||
return json.loads(r.read())
|
|
||||||
|
|
||||||
def moko_post(path, data):
|
|
||||||
payload = json.dumps(data).encode()
|
|
||||||
req = urllib.request.Request(f"{MOKO_URL}/api/v1/{path}",
|
|
||||||
data=payload, method="POST", headers={
|
|
||||||
"Authorization": f"token {MOKO_TOKEN}",
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
})
|
|
||||||
with urllib.request.urlopen(req) as r:
|
|
||||||
return json.loads(r.read())
|
|
||||||
|
|
||||||
# ── Step 1: Find recently merged upstream PRs ──
|
|
||||||
since = (datetime.now(timezone.utc) - timedelta(days=DAYS)).strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
||||||
query = f"repo:go-gitea/gitea is:pr is:merged base:{BRANCH} merged:>={since}"
|
|
||||||
encoded = urllib.parse.quote(query)
|
|
||||||
print(f"Scanning: {query}")
|
|
||||||
|
|
||||||
result = gh_get(f"https://api.github.com/search/issues?q={encoded}&per_page=100&sort=updated&order=desc")
|
|
||||||
total = result["total_count"]
|
|
||||||
print(f"Found {total} merged PRs in the last {DAYS} days")
|
|
||||||
|
|
||||||
if total == 0:
|
|
||||||
print("Nothing to sync.")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
# ── Step 2: Filter for bug/security fixes ──
|
|
||||||
bugs = []
|
|
||||||
for pr in result["items"]:
|
|
||||||
title = pr["title"]
|
|
||||||
label_names = [l["name"].lower() for l in pr.get("labels", [])]
|
|
||||||
is_fix = title.lower().startswith("fix")
|
|
||||||
is_security = any("security" in l for l in label_names) or "[security]" in title.lower()
|
|
||||||
is_bug = any("bug" in l for l in label_names)
|
|
||||||
|
|
||||||
if not (is_fix or is_security or is_bug):
|
|
||||||
continue
|
|
||||||
|
|
||||||
refs = re.findall(r"#(\d+)", title)
|
|
||||||
severity = "critical" if is_security and "[security]" in title.lower() else \
|
|
||||||
"high" if is_security else "medium"
|
|
||||||
|
|
||||||
bugs.append({
|
|
||||||
"number": pr["number"], "title": title, "url": pr["html_url"],
|
|
||||||
"severity": severity, "is_security": is_security, "refs": refs,
|
|
||||||
"merged": pr.get("pull_request", {}).get("merged_at", "")[:10],
|
|
||||||
})
|
|
||||||
|
|
||||||
print(f"Filtered to {len(bugs)} bug/security fixes")
|
|
||||||
if not bugs:
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
# ── Step 3: Collect already-tracked PR numbers ──
|
|
||||||
tracked = set()
|
|
||||||
for state in ["open", "closed"]:
|
|
||||||
try:
|
|
||||||
issues = moko_get(f"repos/{MOKO_REPO}/issues?state={state}&type=issues&limit=50&labels=upstream")
|
|
||||||
for iss in issues:
|
|
||||||
text = (iss.get("body") or "") + " " + (iss.get("title") or "")
|
|
||||||
tracked.update(re.findall(r"(?:#|/pull/)(\d{4,})", text))
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
print(f"Already tracked: {len(tracked)} upstream PRs")
|
|
||||||
|
|
||||||
# ── Step 4: Create issues for new bugs ──
|
|
||||||
created = skipped = errors = 0
|
|
||||||
for bug in bugs:
|
|
||||||
if any(r in tracked for r in bug["refs"]):
|
|
||||||
print(f" SKIP #{bug['number']}: {bug['title'][:55]} (tracked)")
|
|
||||||
skipped += 1
|
|
||||||
continue
|
|
||||||
|
|
||||||
labels = [LABELS["type_bug"], LABELS["upstream"], LABELS[bug["severity"]]]
|
|
||||||
if bug["is_security"]:
|
|
||||||
labels.append(LABELS["security"])
|
|
||||||
|
|
||||||
body = (
|
|
||||||
f"## Summary\n\n"
|
|
||||||
f"Upstream bug fix merged into `{BRANCH}`.\n\n"
|
|
||||||
f"## Upstream Reference\n\n"
|
|
||||||
f"- PR: {bug['url']}\n"
|
|
||||||
f"- Merged: {bug['merged']}\n"
|
|
||||||
f"- Branch: {BRANCH}\n\n"
|
|
||||||
f"## Severity: {bug['severity'].title()}"
|
|
||||||
f"{' (security)' if bug['is_security'] else ''}\n\n"
|
|
||||||
f"## Action\n\n"
|
|
||||||
f"Cherry-pick from upstream `{BRANCH}` branch.\n\n"
|
|
||||||
f"---\n"
|
|
||||||
f"*Auto-created by upstream-bug-sync workflow*\n"
|
|
||||||
f"*Authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>*"
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
|
||||||
iss = moko_post(f"repos/{MOKO_REPO}/issues", {
|
|
||||||
"title": bug["title"], "body": body, "labels": labels,
|
|
||||||
})
|
|
||||||
print(f" CREATED #{iss['number']}: {bug['title'][:55]}")
|
|
||||||
created += 1
|
|
||||||
except Exception as e:
|
|
||||||
print(f" ERROR #{bug['number']}: {e}")
|
|
||||||
errors += 1
|
|
||||||
|
|
||||||
print(f"\n=== Done: {created} created, {skipped} skipped, {errors} errors ===")
|
|
||||||
PYEOF
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
audit=false
|
|
||||||
fund=false
|
|
||||||
update-notifier=false
|
|
||||||
save-exact=true
|
|
||||||
auto-install-peers=true
|
|
||||||
dedupe-peer-dependents=false
|
|
||||||
enable-pre-post-scripts=true
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
extends: [[spectral:oas, all]]
|
|
||||||
|
|
||||||
rules:
|
|
||||||
info-contact: off
|
|
||||||
oas2-api-host: off
|
|
||||||
oas2-parameter-description: off
|
|
||||||
oas2-schema: off
|
|
||||||
oas2-valid-schema-example: off
|
|
||||||
openapi-tags: off
|
|
||||||
operation-description: off
|
|
||||||
operation-singular-tag: off
|
|
||||||
operation-tag-defined: off
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
extends: default
|
|
||||||
|
|
||||||
rules:
|
|
||||||
braces:
|
|
||||||
min-spaces-inside: 0
|
|
||||||
max-spaces-inside: 1
|
|
||||||
min-spaces-inside-empty: 0
|
|
||||||
max-spaces-inside-empty: 0
|
|
||||||
|
|
||||||
brackets:
|
|
||||||
min-spaces-inside: 0
|
|
||||||
max-spaces-inside: 1
|
|
||||||
min-spaces-inside-empty: 0
|
|
||||||
max-spaces-inside-empty: 0
|
|
||||||
|
|
||||||
comments:
|
|
||||||
require-starting-space: true
|
|
||||||
ignore-shebangs: true
|
|
||||||
min-spaces-from-content: 1
|
|
||||||
|
|
||||||
comments-indentation:
|
|
||||||
level: error
|
|
||||||
|
|
||||||
document-start: disable
|
|
||||||
|
|
||||||
document-end:
|
|
||||||
present: false
|
|
||||||
|
|
||||||
empty-lines:
|
|
||||||
max: 1
|
|
||||||
|
|
||||||
indentation:
|
|
||||||
spaces: 2
|
|
||||||
|
|
||||||
line-length: disable
|
|
||||||
|
|
||||||
truthy:
|
|
||||||
allowed-values: ["true", "false", "on", "off"]
|
|
||||||
|
|
||||||
ignore: |
|
|
||||||
.venv
|
|
||||||
node_modules
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
- Use `make help` to find available development targets
|
|
||||||
- Run `make fmt` to format `.go` files, and run `make lint-go` to lint them
|
|
||||||
- Run `make lint-js` to lint `.ts` files
|
|
||||||
- Run `make tidy` after any `go.mod` changes
|
|
||||||
- Run single go tests with `go test -run '^TestName$' ./modulepath/`
|
|
||||||
- Run single js test files with `pnpm exec vitest <path-filter>`
|
|
||||||
- Run single playwright e2e test files with `GITEA_TEST_E2E_FLAGS='<filepath>' make test-e2e`
|
|
||||||
- Add the current year into the copyright header of new `.go` files
|
|
||||||
- Ensure no trailing whitespace in edited files
|
|
||||||
- Use Conventional Commits format for commit messages and PR titles (e.g. `type(scope): subject`)
|
|
||||||
- Never force-push, amend, or squash unless asked. Use new commits and normal push for pull request updates
|
|
||||||
- Preserve existing code comments, do not remove or rewrite comments that are still relevant
|
|
||||||
- In TypeScript, use `!` (non-null assertion) instead of `?.`/`??` when a value is known to always exist
|
|
||||||
- For CSS layout, prefer `flex-*` helpers over per-child `tw-ml-*` / `tw-mr-*` margins; fall back to `tw-*` utilities when specificity requires `!important`
|
|
||||||
- Include authorship attribution in issue and pull request comments
|
|
||||||
- Add `Co-Authored-By` lines to all commits, indicating name and model used
|
|
||||||
-58
@@ -1,58 +0,0 @@
|
|||||||
# GNU makefile proxy script for BSD make
|
|
||||||
#
|
|
||||||
# Written and maintained by Mahmoud Al-Qudsi <mqudsi@neosmart.net>
|
|
||||||
# Copyright NeoSmart Technologies <https://neosmart.net/> 2014-2019
|
|
||||||
# Obtain updates from <https://github.com/neosmart/gmake-proxy>
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
# list of conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
# this list of conditions and the following disclaimer in the documentation
|
|
||||||
# and/or other materials provided with the distribution.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
JARG =
|
|
||||||
GMAKE = "gmake"
|
|
||||||
# When gmake is called from another make instance, -w is automatically added
|
|
||||||
# which causes extraneous messages about directory changes to be emitted.
|
|
||||||
# Running with --no-print-directory silences these messages.
|
|
||||||
GARGS = "--no-print-directory"
|
|
||||||
|
|
||||||
.if "$(.MAKE.JOBS)" != ""
|
|
||||||
JARG = -j$(.MAKE.JOBS)
|
|
||||||
.endif
|
|
||||||
|
|
||||||
# bmake prefers out-of-source builds and tries to cd into ./obj (among others)
|
|
||||||
# where possible. GNU Make doesn't, so override that value.
|
|
||||||
.OBJDIR: ./
|
|
||||||
|
|
||||||
# The GNU convention is to use the lowercased `prefix` variable/macro to
|
|
||||||
# specify the installation directory. Humor them.
|
|
||||||
GPREFIX =
|
|
||||||
.if defined(PREFIX) && ! defined(prefix)
|
|
||||||
GPREFIX = 'prefix = "$(PREFIX)"'
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.BEGIN: .SILENT
|
|
||||||
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
|
|
||||||
|
|
||||||
.PHONY: FRC
|
|
||||||
$(.TARGETS): FRC
|
|
||||||
$(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
|
|
||||||
|
|
||||||
.DONE .DEFAULT: .SILENT
|
|
||||||
$(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
|
|
||||||
File diff suppressed because it is too large
Load Diff
+47
-487
@@ -1,496 +1,56 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
This changelog goes through the changes that have been made in each release
|
## [1.0.1](https://github.com/go-gitea/gitea/releases/tag/v1.0.1) - 2017-01-05
|
||||||
without substantial changes to our git log; to see the highlights of what has
|
|
||||||
been added to each release, please refer to the [blog](https://blog.gitea.com).
|
|
||||||
## [v1.26.1-moko.05.06.00] - 2026-05-30
|
|
||||||
|
|
||||||
* FEATURES
|
|
||||||
* feat(actions): rebrand actions bot user to mokogitea-actions (#233, #234)
|
|
||||||
* Name: gitea-actions → mokogitea-actions, FullName: MokoGitea Actions
|
|
||||||
* Email: mokogitea-actions[bot]@mokoconsulting.tech
|
|
||||||
* Backward-compatible: recognizes github-actions[bot], gitea-actions[bot], mokogitea-actions[bot]
|
|
||||||
* feat(actions): add actions bot user to branch protection whitelist (#233, #234)
|
|
||||||
* New toggles: WhitelistActionsUser, MergeWhitelistActionsUser, ForcePushAllowlistActionsUser
|
|
||||||
* Allows CI/CD workflows to push/merge/force-push to protected branches when enabled
|
|
||||||
* DB migration v334 adds the three boolean columns
|
|
||||||
* Exposed in API (create/edit branch protection) and web UI settings
|
|
||||||
* INFRASTRUCTURE
|
|
||||||
* fix(ci): auto-deploy to production on merge to main (#235)
|
|
||||||
* Deploy workflow now triggers on push to main, not just manual dispatch
|
|
||||||
* Version derived from git describe for auto-deploys
|
|
||||||
|
|
||||||
## [v1.26.1-moko.04.00.00] - 2026-05-24
|
|
||||||
|
|
||||||
* SECURITY
|
|
||||||
* Backport 12 upstream v1.26.2 security fixes:
|
|
||||||
* golang.org/x/net v0.55.0 security update (#140)
|
|
||||||
* Token scope enforcement on raw/media/attachment downloads (#141)
|
|
||||||
* OAuth PKCE hardening and refresh token replay protection (#142)
|
|
||||||
* Wiki git write and LFS token access enforcement (#143)
|
|
||||||
* Public-only token filtering in API queries (#144)
|
|
||||||
* Reading permission fix (#145)
|
|
||||||
* Artifact signature payload hardening (#146)
|
|
||||||
* AWS credentials encryption (#161)
|
|
||||||
* Mermaid v11.15.0 security update (#162)
|
|
||||||
* Composer package permission check (#164)
|
|
||||||
* BUGFIXES
|
|
||||||
* fix(actions): nil pointer dereference in concurrency during PR creation (#136)
|
|
||||||
* fix(ui): actions runs list broken row layout — CSS class mismatch (#138)
|
|
||||||
* fix: scheduled action panic with null event payload (upstream #37459)
|
|
||||||
* fix: treat email addresses case-insensitively (upstream #37600)
|
|
||||||
* fix: .mod lexer panic — removed invalid AMPL mapping
|
|
||||||
* fix: remove unused setting import in action.go
|
|
||||||
* fix: restore Permission field access in context middleware
|
|
||||||
* FEATURES
|
|
||||||
* Joomla-style updates.xml with channel selection (stable/dev/security/rc)
|
|
||||||
* Update checker reads from updates.xml with configurable CHANNEL setting
|
|
||||||
* Admin dashboard shows update banner with channel name and docker pull command
|
|
||||||
* Upstream bug sync workflow — daily automated issue creation from release/v1.26
|
|
||||||
* PR RC release workflow — auto-build RC on PR to main
|
|
||||||
* INFRASTRUCTURE
|
|
||||||
* New 3-part versioning: v{upstream}-moko.{major}.{minor}.{patch}
|
|
||||||
* Branding updates: error pages, home page, settings link to MokoGitea
|
|
||||||
* Deploy workflow updated for new version format
|
|
||||||
* PROCESS
|
|
||||||
* Created `type: bug` and `upstream` labels for automated issue tracking
|
|
||||||
* Deduplicated 19 duplicate feature request issues
|
|
||||||
* Closed 24 upstream bug/security issues after backporting
|
|
||||||
|
|
||||||
## [MokoGitea Unreleased]
|
|
||||||
|
|
||||||
* FEATURES
|
|
||||||
* feat(api): Bulk issue operations — add/remove/replace labels, close/reopen, set milestone, and set assignees across multiple issues in a single request (#21)
|
|
||||||
* `POST /api/v1/repos/{owner}/{repo}/issues/bulk/labels`
|
|
||||||
* `POST /api/v1/repos/{owner}/{repo}/issues/bulk/state`
|
|
||||||
* `POST /api/v1/repos/{owner}/{repo}/issues/bulk/milestone`
|
|
||||||
* `POST /api/v1/repos/{owner}/{repo}/issues/bulk/assignees`
|
|
||||||
* Partial-failure support: returns per-issue success/failure map
|
|
||||||
* INFRASTRUCTURE
|
|
||||||
* Grafana: Standardized kiosk header across all 14 playlist dashboards — each now shows dashboard name, kiosk link, terminal/exit/switch instructions
|
|
||||||
* PROCESS
|
|
||||||
* Reopened 9 closed issues lacking documented testing proof (#3, #5, #38, #41, #70, #74, #75, #76, #78)
|
|
||||||
* Created `pending: testing` label for features awaiting verification
|
|
||||||
* Established policy: issues must not be closed without documented testing proof
|
|
||||||
|
|
||||||
## [1.26.1](https://github.com/go-gitea/gitea/releases/tag/v1.26.1) - 2026-04-21
|
|
||||||
|
|
||||||
* BUGFIXES
|
* BUGFIXES
|
||||||
* Add event.schedule context for schedule actions task (#37320) (#37348)
|
* Fixed localized MIN_PASSWORD_LENGTH [#501](https://github.com/go-gitea/gitea/pull/501)
|
||||||
* Fix an issue where changing an organization's visibility caused problems when users had forked its repositories. (#37324) (#37344)
|
* Fixed 500 error on organization delete [#507](https://github.com/go-gitea/gitea/pull/507)
|
||||||
* Use modern "git update-index --cacheinfo" syntax to support more file names (#37338) (#37343)
|
* Ignore empty wiki repo on migrate [#544](https://github.com/go-gitea/gitea/pull/544)
|
||||||
* Fix URL related escaping for oauth2 (#37334) (#37340)
|
* Proper check access for forking [#563](https://github.com/go-gitea/gitea/pull/563)
|
||||||
* When the requested arch rpm is missing fall back to noarch (#37236) (#37339)
|
* Fix SSH domain on installer [#506](https://github.com/go-gitea/gitea/pull/506)
|
||||||
* Fix actions concurrency groups cross-branch leak (#37311) (#37331)
|
* Fix missing data rows on admin UI [#580](https://github.com/go-gitea/gitea/pull/580)
|
||||||
* Fix bug when accessing user badges (#37321) (#37329)
|
* Do not delete tags with releases by default [#579](https://github.com/go-gitea/gitea/pull/579)
|
||||||
* Fix AppFullLink (#37325) (#37328)
|
* Fix missing session config data on admin UI [#578](https://github.com/go-gitea/gitea/pull/578)
|
||||||
* Fix container auth for public instance (#37290) (#37294)
|
* Properly show the version within footer on the UI [#593](https://github.com/go-gitea/gitea/pull/593)
|
||||||
* Enhance GetActionWorkflow to support fallback references (#37189) (#37283)
|
|
||||||
* Fix vite manifest update masking build errors (#37279) (#37310)
|
|
||||||
* Fix Mermaid diagrams failing when node labels contain line breaks (#37296) (#37299)
|
|
||||||
* Use TriggerEvent instead of Event in workflow runs API response for scheduled runs (#37288) #37360
|
|
||||||
* Add URL to Learn more about blocking a user. (#37355) #37367
|
|
||||||
* Fix button layout shift when collapsing file tree in editor (#37363) #37375
|
|
||||||
* Fix org team assignee/reviewer lookups for team member permissions (#37365) #37391
|
|
||||||
* Fix repo init README EOL (#37388) #37399
|
|
||||||
* Fix: dump with default zip type produces uncompressed zip (#37401)#37402
|
|
||||||
|
|
||||||
## [1.26.0](https://github.com/go-gitea/gitea/releases/tag/v1.26.0) - 2026-04-17
|
## [1.0.0](https://github.com/go-gitea/gitea/releases/tag/v1.0.0) - 2016-12-23
|
||||||
|
|
||||||
* BREAKING
|
* BREAKING
|
||||||
* Correct swagger annotations for enums, status codes, and notification state (#37030)
|
* We have various changes on the API, scripting against API must be updated
|
||||||
* Remove GET API registration-token (#36801)
|
* FEATURE
|
||||||
* Support Actions `concurrency` syntax (#32751)
|
* Show last login for admins [#121](https://github.com/go-gitea/gitea/pull/121)
|
||||||
* Make PUBLIC_URL_DETECTION default to "auto" (#36955)
|
|
||||||
* SECURITY
|
|
||||||
* Bound PageSize in `ListUnadoptedRepositories` (#36884)
|
|
||||||
* FEATURES
|
|
||||||
* Support Actions `concurrency` syntax (#32751)
|
|
||||||
* Add terraform state registry (#36710)
|
|
||||||
* Instance-wide (global) info banner and maintenance mode (#36571)
|
|
||||||
* Support rendering OpenAPI spec (#36449)
|
|
||||||
* Add keyboard shortcuts for repository file and code search (#36416)
|
|
||||||
* Add support for archive-upload rpc (#36391)
|
|
||||||
* Add ability to download subpath archive (#36371)
|
|
||||||
* Add workflow dependencies visualization (#26062) (#36248) & Restyle Workflow Graph (#36912)
|
|
||||||
* Automatic generation of release notes (#35977)
|
|
||||||
* Add "Go to file", "Delete Directory" to repo file list page (#35911)
|
|
||||||
* Introduce "config edit-ini" sub command to help maintaining INI config file (#35735)
|
|
||||||
* Add button to re-run failed jobs in Actions (#36924)
|
|
||||||
* Support actions and reusable workflows from private repos (#32562)
|
|
||||||
* Add summary to action runs view (#36883)
|
|
||||||
* Add user badges (#36752)
|
|
||||||
* Add configurable permissions for Actions automatic tokens (#36173)
|
|
||||||
* Add per-runner "Disable/Pause" (#36776)
|
|
||||||
* Feature non-zipped actions artifacts (action v7 / nodejs / npm v6.2.0) (#36786)
|
|
||||||
* PERFORMANCE
|
|
||||||
* WorkflowDispatch API optionally return runid (#36706)
|
|
||||||
* Add render cache for SVG icons (#36863)
|
|
||||||
* Load `mentionValues` asynchronously (#36739)
|
|
||||||
* Lazy-load some Vue components, fix heatmap chunk loading on every page (#36719)
|
|
||||||
* Load heatmap data asynchronously (#36622)
|
|
||||||
* Use prev/next pagination for user profile activities page to speed up (#36642)
|
|
||||||
* Refactor cat-file batch operations and support `--batch-command` approach (#35775)
|
|
||||||
* Use merge tree to detect conflicts when possible (#36400)
|
|
||||||
* ENHANCEMENTS
|
|
||||||
* Implement logout redirection for reverse proxy auth setups (#36085) (#37171)
|
|
||||||
* Adds option to force update new branch in contents routes (#35592)
|
|
||||||
* Add viewer controller for mermaid (zoom, drag) (#36557)
|
|
||||||
* Add code editor setting dropdowns (#36534)
|
|
||||||
* Add `elk` layout support to mermaid (#36486)
|
|
||||||
* Add resolve/unresolve review comment API endpoints (#36441)
|
|
||||||
* Allow configuring default PR base branch (fixes #36412) (#36425)
|
|
||||||
* Add support for RPM Errata (updateinfo.xml) (#37125)
|
|
||||||
* Require additional user confirmation for making repo private (#36959)
|
|
||||||
* Add `actions.WORKFLOW_DIRS` setting (#36619)
|
|
||||||
* Avoid opening new tab when downloading actions logs (#36740)
|
|
||||||
* Implements OIDC RP-Initiated Logout (#36724)
|
|
||||||
* Show workflow link (#37070)
|
|
||||||
* Desaturate dark theme background colors (#37056)
|
|
||||||
* Refactor "org teams" page and help new users to "add member" to an org (#37051)
|
|
||||||
* Add webhook name field to improve webhook identification (#37025) (#37040)
|
|
||||||
* Make task list checkboxes clickable in the preview tab (#37010)
|
|
||||||
* Improve severity labels in Actions logs and tweak colors (#36993)
|
|
||||||
* Linkify URLs in Actions workflow logs (#36986)
|
|
||||||
* Allow text selection on checkbox labels (#36970)
|
|
||||||
* Support dark/light theme images in markdown (#36922)
|
|
||||||
* Enable native dark mode for swagger-ui (#36899)
|
|
||||||
* Rework checkbox styling, remove `input` border hover effect (#36870)
|
|
||||||
* Refactor storage content-type handling of ServeDirectURL (#36804)
|
|
||||||
* Use "Enable Gravatar" but not "Disable" (#36771)
|
|
||||||
* Use case-insensitive matching for Git error "Not a valid object name" (#36728)
|
|
||||||
* Add "Copy Source" to markup comment menu (#36726)
|
|
||||||
* Change image transparency grid to CSS (#36711)
|
|
||||||
* Add "Run" prefix for unnamed action steps (#36624)
|
|
||||||
* Persist actions log time display settings in `localStorage` (#36623)
|
|
||||||
* Use first commit title for multi-commit PRs and fix auto-focus title field (#36606)
|
|
||||||
* Improve BuildCaseInsensitiveLike with lowercase (#36598)
|
|
||||||
* Improve diff highlighting (#36583)
|
|
||||||
* Exclude cancelled runs from failure-only email notifications (#36569)
|
|
||||||
* Use full-file highlighting for diff sections (#36561)
|
|
||||||
* Color command/error logs in Actions log (#36538)
|
|
||||||
* Add paging headers (#36521)
|
|
||||||
* Improve timeline entries for WIP prefix changes in pull requests (#36518)
|
|
||||||
* Add FOLDER_ICON_THEME configuration option (#36496)
|
|
||||||
* Normalize guessed languages for code highlighting (#36450)
|
|
||||||
* Add chunked transfer encoding support for LFS uploads (#36380)
|
|
||||||
* Indicate when only optional checks failed (#36367)
|
|
||||||
* Add 'allow_maintainer_edit' API option for creating a pull request (#36283)
|
|
||||||
* Support closing keywords with URL references (#36221)
|
|
||||||
* Improve diff file headers (#36215)
|
|
||||||
* Fix and enhance comment editor monospace toggle (#36181)
|
|
||||||
* Add git.DIFF_RENAME_SIMILARITY_THRESHOLD option (#36164)
|
|
||||||
* Add matching pair insertion to markdown textarea (#36121)
|
|
||||||
* Add sorting/filtering to admin user search API endpoint (#36112)
|
|
||||||
* Allow action user have read permission in public repo like other user (#36095)
|
|
||||||
* Disable matchBrackets in monaco (#36089)
|
|
||||||
* Use GitHub-style commit message for squash merge (#35987)
|
|
||||||
* Make composer registry support tar.gz and tar.bz2 and fix bugs (#35958)
|
|
||||||
* Add GITEA_PR_INDEX env variable to githooks (#35938)
|
|
||||||
* Add proper error message if session provider can not be created (#35520)
|
|
||||||
* Add button to copy file name in PR files (#35509)
|
|
||||||
* Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (#30256)
|
|
||||||
* Add placeholder content for empty content page (#37114)
|
|
||||||
* Add `DEFAULT_DELETE_BRANCH_AFTER_MERGE` setting (#36917)
|
|
||||||
* Redirect to the only OAuth2 provider when no other login methods and fix various problems (#36901)
|
|
||||||
* Add admin badge to navbar avatar (#36790)
|
|
||||||
* Add `never` option to `PUBLIC_URL_DETECTION` configuration (#36785)
|
|
||||||
* Add background and run count to actions list page (#36707)
|
|
||||||
* Add icon to buttons "Close with Comment", "Close Pull Request", "Close Issue" (#36654)
|
|
||||||
* Add support for in_progress event in workflow_run webhook (#36979)
|
|
||||||
* Report commit status for pull_request_review events (#36589)
|
|
||||||
* Render merged pull request title as such in dashboard feed (#36479)
|
|
||||||
* Feature to be able to filter project boards by milestones (#36321)
|
|
||||||
* Use user id in noreply emails (#36550)
|
|
||||||
* Enable pagination on GiteaDownloader.getIssueReactions() (#36549)
|
|
||||||
* Remove striped tables in UI (#36509)
|
|
||||||
* Improve control char rendering and escape button styling (#37094)
|
|
||||||
* Support legacy run/job index-based URLs and refactor migration 326 (#37008)
|
|
||||||
* Add date to "No Contributions" tooltip (#36190)
|
|
||||||
* Show edit page confirmation dialog on tree view file change (#36130)
|
|
||||||
* Mention proc-receive in text for dashboard.resync_all_hooks func (#35991)
|
|
||||||
* Reuse selectable style for wiki (#35990)
|
|
||||||
* Support blue yellow colorblind theme (#35910)
|
|
||||||
* Support selecting theme on the footer (#35741)
|
|
||||||
* Improve online runner check (#35722)
|
|
||||||
* Add quick approve button on PR page (#35678)
|
|
||||||
* Enable commenting on expanded lines in PR diffs (#35662)
|
|
||||||
* Print PR-Title into tooltip for actions (#35579)
|
|
||||||
* Use explicit, stronger defaults for newly generated repo signing keys for Debian (#36236)
|
|
||||||
* Improve the compare page (#36261)
|
|
||||||
* Unify repo names in system notices (#36491)
|
|
||||||
* Move package settings to package instead of being tied to version (#37026)
|
|
||||||
* Add Actions API rerun endpoints for runs and jobs (#36768)
|
|
||||||
* Add branch_count to repository API (#35351) (#36743)
|
|
||||||
* Add created_by filter to SearchIssues (#36670)
|
|
||||||
* Allow admins to rename non-local users (#35970)
|
|
||||||
* Support updating branch via API (#35951)
|
|
||||||
* Add an option to automatically verify SSH keys from LDAP (#35927)
|
|
||||||
* Make "update file" API can create a new file when SHA is not set (#35738)
|
|
||||||
* Update issue.go with labels documentation (labels content, not ids) (#35522)
|
|
||||||
* Expose content_version for optimistic locking on issue and PR edits (#37035)
|
|
||||||
* Pass ServeHeaderOptions by value instead of pointer, fine tune httplib tests (#36982)
|
|
||||||
* BUGFIXES
|
* BUGFIXES
|
||||||
* Frontend iframe renderer framework: 3D models, OpenAPI (#37233) (#37273)
|
* Fixed sender of notifications [#2](https://github.com/go-gitea/gitea/pull/2)
|
||||||
* Fix CODEOWNERS absolute path matching. (#37244) (#37264)
|
* Fixed keyword hijacking vulnerability [#20](https://github.com/go-gitea/gitea/pull/20)
|
||||||
* Swift registry metadata: preserve more JSON fields and accept empty metadata (#37254) (#37261)
|
* Fixed non-markdown readme rendering [#95](https://github.com/go-gitea/gitea/pull/95)
|
||||||
* Fix user ssh key exporting and tests (#37256) (#37258)
|
* Allow updating draft releases [#169](https://github.com/go-gitea/gitea/pull/169)
|
||||||
* Fix team member avatar size and add tooltip (#37253)
|
* GitHub API compliance [#227](https://github.com/go-gitea/gitea/pull/227)
|
||||||
* Fix commit title rendering in action run and blame (#37243) (#37251)
|
* Added commit SHA to tag webhook [#286](https://github.com/go-gitea/gitea/issues/286)
|
||||||
* Fix corrupted JSON caused by goccy library (#37214) (#37220)
|
* Secured links via noopener [#315](https://github.com/go-gitea/gitea/issues/315)
|
||||||
* Add test for "fetch redirect", add CSS value validation for external render (#37207) (#37216)
|
* Replace tabs with spaces on wiki title [#371](https://github.com/go-gitea/gitea/pull/371)
|
||||||
* Fix incorrect concurrency check (#37205) (#37215)
|
* Fixed vulnerability on labels and releases [#409](https://github.com/go-gitea/gitea/pull/409)
|
||||||
* Fix handle missing base branch in PR commits API (#37193) (#37203)
|
* Fixed issue comment API [#449](https://github.com/go-gitea/gitea/pull/449)
|
||||||
* Fix encoding for Matrix Webhooks (#37190) (#37201)
|
* ENHANCEMENT
|
||||||
* Fix handle fork-only commits in compare API (#37185) (#37199)
|
* Use proper import path for libravatar [#3](https://github.com/go-gitea/gitea/pull/3)
|
||||||
* Indicate form field readonly via background, fix RunUser config (#37175, #37180) (#37178)
|
* Integrated DroneCI for tests and builds [#24](https://github.com/go-gitea/gitea/issues/24)
|
||||||
* Report structurally invalid workflows to users (#37116) (#37164)
|
* Integrated dependency manager [#29](https://github.com/go-gitea/gitea/issues/29)
|
||||||
* Fix API not persisting pull request unit config when has_pull_requests is not set (#36718)
|
* Embedded bindata optionally [#30](https://github.com/go-gitea/gitea/issues/30)
|
||||||
* Rename CSS variables and improve colorblind themes (#36353)
|
* Integrated pagination for releases [#73](https://github.com/go-gitea/gitea/pull/73)
|
||||||
* Hide `add-matcher` and `remove-matcher` from actions job logs (#36520)
|
* Autogenerate version on every build [#91](https://github.com/go-gitea/gitea/issues/91)
|
||||||
* Prevent navigation keys from triggering actions during IME composition (#36540)
|
* Refactored Docker container [#104](https://github.com/go-gitea/gitea/issues/104)
|
||||||
* Fix vertical alignment of `.commit-sign-badge` children (#36570)
|
* Added short-hash support for downloads [#211](https://github.com/go-gitea/gitea/issues/211)
|
||||||
* Fix duplicate startup warnings in admin panel (#36641)
|
* Display tooltip for downloads [#221](https://github.com/go-gitea/gitea/issues/221)
|
||||||
* Fix CODEOWNERS review request attribution using comment metadata (#36348)
|
* Improved HTTP headers for issue attachments [#270](https://github.com/go-gitea/gitea/pull/270)
|
||||||
* Fix HTML tags appearing in wiki table of contents (#36284)
|
* Integrate public as bindata optionally [#293](https://github.com/go-gitea/gitea/pull/293)
|
||||||
* Fix various bugs (#37096)
|
* Integrate templates as bindata optionally [#314](https://github.com/go-gitea/gitea/pull/314)
|
||||||
* Fix various legacy problems (#37092)
|
* Inject more ENV variables into custom hooks [#316](https://github.com/go-gitea/gitea/issues/316)
|
||||||
* Fix RPM Registry 404 when package name contains 'package' (#37087)
|
* Correct LDAP login validation [#342](https://github.com/go-gitea/gitea/pull/342)
|
||||||
* Merge some standalone Vite entries into index.js (#37085)
|
* Integrate conf as bindata optionally [#354](https://github.com/go-gitea/gitea/pull/354)
|
||||||
* Fix various problems (#37077)
|
* Serve video files in browser [#418](https://github.com/go-gitea/gitea/pull/418)
|
||||||
* Fix issue label deletion with Actions tokens (#37013)
|
* Configurable SSH host binding [#431](https://github.com/go-gitea/gitea/issues/431)
|
||||||
* Hide delete branch or tag buttons in mirror or archived repositories. (#37006)
|
|
||||||
* Fix org contact email not clearable once set (#36975)
|
|
||||||
* Fix a bug when forking a repository in an organization (#36950)
|
|
||||||
* Preserve sort order of exclusive labels from template repo (#36931)
|
|
||||||
* Make container registry support Apple Container (basic auth) (#36920)
|
|
||||||
* Fix the wrong push commits in the pull request when force push (#36914)
|
|
||||||
* Add class "list-header-filters" to the div for projects (#36889)
|
|
||||||
* Fix dbfs error handling (#36844)
|
|
||||||
* Fix incorrect viewed files counter if reverted change was viewed (#36819)
|
|
||||||
* Refactor avatar package, support default avatar fallback (#36788)
|
|
||||||
* Fix README symlink resolution in subdirectories like .github (#36775)
|
|
||||||
* Fix CSS stacking context issue in actions log (#36749)
|
|
||||||
* Add gpg signing for merge rebase and update by rebase (#36701)
|
|
||||||
* Delete non-exist branch should return 404 (#36694)
|
|
||||||
* Fix `TestActionsCollaborativeOwner` (#36657)
|
|
||||||
* Fix multi-arch Docker build SIGILL by splitting frontend stage (#36646)
|
|
||||||
* Fix linguist-detectable attribute being ignored for configuration files (#36640)
|
|
||||||
* Fix state desync in ComboMarkdownEditor (#36625)
|
|
||||||
* Unify DEFAULT_SHOW_FULL_NAME output in templates and dropdown (#36597)
|
|
||||||
* Pull Request Pusher should be the author of the merge (#36581)
|
|
||||||
* Fix various version parsing problems (#36553)
|
|
||||||
* Fix highlight diff result (#36539)
|
|
||||||
* Fix mirror sync parser and fix mirror messages (#36504)
|
|
||||||
* Fix bug when list pull request commits (#36485)
|
|
||||||
* Fix various bugs (#36446)
|
|
||||||
* Fix issue filter menu layout (#36426)
|
|
||||||
* Restrict branch naming when new change matches with protection rules (#36405)
|
|
||||||
* Fix link/origin referrer and login redirect (#36279)
|
|
||||||
* Generate IDs for HTML headings without id attribute (#36233)
|
|
||||||
* Use a migration test instead of a wrong test which populated the meta test repositories and fix a migration bug (#36160)
|
|
||||||
* Fix issue close timeline icon (#36138)
|
|
||||||
* Fix diff blob excerpt expansion (#35922)
|
|
||||||
* Fix external render (#35727)
|
|
||||||
* Fix review request webhook bug (#35339) (#35723)
|
|
||||||
* Fix shutdown waitgroup panic (#35676)
|
|
||||||
* Cleanup ActionRun creation (#35624)
|
|
||||||
* Fix possible bug when migrating issues/pull requests (#33487)
|
|
||||||
* Various fixes (#36697)
|
|
||||||
* Apply notify/register mail flags during install load (#37120)
|
|
||||||
* Repair duration display for bad stopped timestamps (#37121)
|
|
||||||
* Fix(upgrade.sh): use HTTPS for GPG key import and restore SELinux context after upgrade (#36930)
|
|
||||||
* Fix various trivial problems (#36921)
|
|
||||||
* Fix various trivial problems (#36953)
|
|
||||||
* Fix NuGet package upload error handling (#37074)
|
|
||||||
* Fix CodeQL code scanning alerts (#36858)
|
|
||||||
* Refactor issue sidebar and fix various problems (#37045)
|
|
||||||
* Fix various problems (#37029)
|
|
||||||
* Fix relative-time RangeError (#37021)
|
|
||||||
* Fix chroma lexer mapping (#36629)
|
|
||||||
* Fix typos and grammar in English locale (#36751)
|
|
||||||
* Fix milestone/project text overflow in issue sidebar (#36741)
|
|
||||||
* Fix `no-content` message not rendering after comment edit (#36733)
|
|
||||||
* Fix theme loading in development (#36605)
|
|
||||||
* Fix workflow run jobs API returning null steps (#36603)
|
|
||||||
* Fix timeline event layout overflow with long content (#36595)
|
|
||||||
* Fix minor UI issues in runner edit page (#36590)
|
|
||||||
* Fix incorrect vendored detections (#36508)
|
|
||||||
* Fix editorconfig not respected in PR Conversation view (#36492)
|
|
||||||
* Don't create self-references in merged PRs (#36490)
|
|
||||||
* Fix potential incorrect runID in run status update (#36437)
|
|
||||||
* Fix file-tree ui error when adding files to repo without commits (#36312)
|
|
||||||
* Improve image captcha contrast for dark mode (#36265)
|
|
||||||
* Fix panic in blame view when a file has only a single commit (#36230)
|
|
||||||
* Fix spelling error in migrate-storage cmd utility (#36226)
|
|
||||||
* Fix code highlighting on blame page (#36157)
|
|
||||||
* Fix nilnil in onedev downloader (#36154)
|
|
||||||
* Fix actions lint (#36029)
|
|
||||||
* Fix oauth2 session gob register (#36017)
|
|
||||||
* Fix Arch repo pacman.conf snippet (#35825)
|
|
||||||
* Fix a number of `strictNullChecks`-related issues (#35795)
|
|
||||||
* Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (#36861)
|
|
||||||
* Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (#36384)
|
|
||||||
* Update message severity colors, fix navbar double border (#37019)
|
|
||||||
* Inline and lazy-load EasyMDE CSS, fix border colors (#36714)
|
|
||||||
* Closed milestones with no issues now show as 100% completed (#36220)
|
|
||||||
* Add test for ExtendCommentTreePathLength migration and fix bugs (#35791)
|
|
||||||
* Only turn links to current instance into hash links (#36237)
|
|
||||||
* Fix typos in code comments: doesnt, dont, wont (#36890)
|
|
||||||
* REFACTOR
|
|
||||||
* Clean up and improve non-gitea js error filter (#37148) (#37155)
|
|
||||||
* Always show owner/repo name in compare page dropdowns (#37172) (#37200)
|
|
||||||
* Remove dead CSS rules (#37173) (#37177)
|
|
||||||
* Replace Monaco with CodeMirror (#36764)
|
|
||||||
* Replace CSRF cookie with `CrossOriginProtection` (#36183)
|
|
||||||
* Replace index with id in actions routes (#36842)
|
|
||||||
* Remove unnecessary function parameter (#35765)
|
|
||||||
* Move jobparser from act repository to Gitea (#36699)
|
|
||||||
* Refactor compare router param parse (#36105)
|
|
||||||
* Optimize 'refreshAccesses' to perform update without removing then adding (#35702)
|
|
||||||
* Clean up checkbox cursor styles (#37016)
|
|
||||||
* Remove undocumented support of signing key in the repository git configuration file (#36143)
|
|
||||||
* Switch `cmd/` to use constructor functions. (#36962)
|
|
||||||
* Use `relative-time` to render absolute dates (#36238)
|
|
||||||
* Some refactors about GetMergeBase (#36186)
|
|
||||||
* Some small refactors (#36163)
|
|
||||||
* Use gitRepo as parameter instead of repopath when invoking sign functions (#36162)
|
|
||||||
* Move blame to gitrepo (#36161)
|
|
||||||
* Move some functions to gitrepo package to reduce RepoPath reference directly (#36126)
|
|
||||||
* Use gitrepo's clone and push when possible (#36093)
|
|
||||||
* Remove mermaid margin workaround (#35732)
|
|
||||||
* Move some functions to gitrepo package (#35543)
|
|
||||||
* Move GetDiverging functions to gitrepo (#35524)
|
|
||||||
* Use global lock instead of status pool for cron lock (#35507)
|
|
||||||
* Use explicit mux instead of DefaultServeMux (#36276)
|
|
||||||
* Use gitrepo's push function (#36245)
|
|
||||||
* Pass request context to generateAdditionalHeadersForIssue (#36274)
|
|
||||||
* Move assign project when creating pull request to the same database transaction (#36244)
|
|
||||||
* Move catfile batch to a sub package of git module (#36232)
|
|
||||||
* Use gitrepo.Repository instead of wikipath (#35398)
|
|
||||||
* Use experimental go json v2 library (#35392)
|
|
||||||
* Refactor template render (#36438)
|
|
||||||
* Refactor GetRepoRawDiffForFile to avoid unnecessary pipe or goroutine (#36434)
|
|
||||||
* Refactor text utility classes to Tailwind CSS (#36703)
|
|
||||||
* Refactor git command stdio pipe (#36422)
|
|
||||||
* Refactor git command context & pipeline (#36406)
|
|
||||||
* Refactor git command stdio pipe (#36393)
|
|
||||||
* Remove unused functions (#36672)
|
|
||||||
* Refactor Actions Token Access (#35688)
|
|
||||||
* Move commit related functions to gitrepo package (#35600)
|
|
||||||
* Move archive function to repo_model and gitrepo (#35514)
|
|
||||||
* Move some functions to gitrepo package (#35503)
|
|
||||||
* Use git model to detect whether branch exist instead of gitrepo method (#35459)
|
|
||||||
* Some refactor for repo path (#36251)
|
|
||||||
* Extract helper functions from SearchIssues (#36158)
|
|
||||||
* Refactor merge conan and container auth preserve actions taskID (#36560)
|
|
||||||
* Refactor Nuget Auth to reuse Basic Auth Token Validation (#36558)
|
|
||||||
* Refactor ActionsTaskID (#36503)
|
|
||||||
* Refactor auth middleware (#36848)
|
|
||||||
* Refactor code render and render control chars (#37078)
|
|
||||||
* Clean up AppURL, remove legacy origin-url webcomponent (#37090)
|
|
||||||
* Remove `util.URLJoin` and replace all callers with direct path concatenation (#36867)
|
|
||||||
* Replace legacy tw-flex utility classes with flex-text-block/inline (#36778)
|
|
||||||
* Mark unused&immature activitypub as "not implemented" (#36789)
|
|
||||||
* TESTING
|
|
||||||
* Add e2e tests for server push events (#36879)
|
|
||||||
* Rework e2e tests (#36634)
|
|
||||||
* Add e2e reaction test, improve accessibility, enable parallel testing (#37081)
|
|
||||||
* Increase e2e test timeouts on CI to fix flaky tests (#37053)
|
|
||||||
* BUILD
|
|
||||||
* Upgrade go-git to v5.18.0 (#37269)
|
|
||||||
* Replace rollup-plugin-license with rolldown-license-plugin (#37130) (#37158)
|
|
||||||
* Bump min go version to 1.26.2 (#37139) (#37143)
|
|
||||||
* Convert locale files from ini to json format (#35489)
|
|
||||||
* Bump golangci-lint to 2.7.2, enable modernize stringsbuilder (#36180)
|
|
||||||
* Port away from `flake-utils` (#35675)
|
|
||||||
* Remove nolint (#36252)
|
|
||||||
* Update the Unlicense copy to latest version (#36636)
|
|
||||||
* Update to go 1.26.0 and golangci-lint 2.9.0 (#36588)
|
|
||||||
* Replace `google/go-licenses` with custom generation (#36575)
|
|
||||||
* Update go dependencies (#36548)
|
|
||||||
* Bump appleboy/git-push-action from 1.0.0 to 1.2.0 (#36306)
|
|
||||||
* Remove fomantic form module (#36222)
|
|
||||||
* Bump setup-node to v6, re-enable cache (#36207)
|
|
||||||
* Bump crowdin/github-action from 1 to 2 (#36204)
|
|
||||||
* Revert "Bump alpine to 3.23 (#36185)" (#36202)
|
|
||||||
* Update chroma to v2.21.1 (#36201)
|
|
||||||
* Bump astral-sh/setup-uv from 6 to 7 (#36198)
|
|
||||||
* Bump docker/build-push-action from 5 to 6 (#36197)
|
|
||||||
* Bump aws-actions/configure-aws-credentials from 4 to 5 (#36196)
|
|
||||||
* Bump dev-hanz-ops/install-gh-cli-action from 0.1.0 to 0.2.1 (#36195)
|
|
||||||
* Add JSON linting (#36192)
|
|
||||||
* Enable dependabot for actions (#36191)
|
|
||||||
* Bump alpine to 3.23 (#36185)
|
|
||||||
* Update chroma to v2.21.0 (#36171)
|
|
||||||
* Update JS deps and eslint enhancements (#36147)
|
|
||||||
* Update JS deps (#36091)
|
|
||||||
* update golangci-lint to v2.7.0 (#36079)
|
|
||||||
* Update JS deps, fix deprecations (#36040)
|
|
||||||
* Update JS deps (#35978)
|
|
||||||
* Add toolchain directive to go.mod (#35901)
|
|
||||||
* Move `gitea-vet` to use `go tool` (#35878)
|
|
||||||
* Update to go 1.25.4 (#35877)
|
|
||||||
* Enable TypeScript `strictNullChecks` (#35843)
|
|
||||||
* Enable `vue/require-typed-ref` eslint rule (#35764)
|
|
||||||
* Update JS dependencies (#35759)
|
|
||||||
* Move `codeformat` folder to tools (#35758)
|
|
||||||
* Update dependencies (#35733)
|
|
||||||
* Bump happy-dom from 20.0.0 to 20.0.2 (#35677)
|
|
||||||
* Bump setup-go to v6 (#35660)
|
|
||||||
* Update JS deps, misc tweaks (#35643)
|
|
||||||
* Bump happy-dom from 19.0.2 to 20.0.0 (#35625)
|
|
||||||
* Use bundled version of spectral (#35573)
|
|
||||||
* Update JS and PY deps (#35565)
|
|
||||||
* Bump github.com/wneessen/go-mail from 0.6.2 to 0.7.1 (#35557)
|
|
||||||
* Migrate from webpack to vite (#37002)
|
|
||||||
* Update JS dependencies and misc tweaks (#37064)
|
|
||||||
* Update to eslint 10 (#36925)
|
|
||||||
* Optimize Docker build with dependency layer caching (#36864)
|
|
||||||
* Update JS deps (#36850)
|
|
||||||
* Update tool dependencies and fix new lint issues (#36702)
|
|
||||||
* Remove redundant linter rules (#36658)
|
|
||||||
* Move Fomantic dropdown CSS to custom module (#36530)
|
|
||||||
* Remove and forbid `@ts-expect-error` (#36513)
|
|
||||||
* Refactor git command stderr handling (#36402)
|
|
||||||
* Enable gocheckcompilerdirectives linter (#36156)
|
|
||||||
* Replace `lint-go-gopls` with additional `govet` linters (#36028)
|
|
||||||
* Update golangci-lint to v2.6.0 (#35801)
|
|
||||||
* Misc tool tweaks (#35734)
|
|
||||||
* Add cache to container build (#35697)
|
|
||||||
* Upgrade vite (#37126)
|
|
||||||
* Update `setup-uv` to v8.0.0 (#37101)
|
|
||||||
* Upgrade `go-git` to v5.17.2 and related dependencies (#37060)
|
|
||||||
* Raise minimum Node.js version to 22.18.0 (#37058)
|
|
||||||
* Upgrade `golang.org/x/image` to v0.38.0 (#37054)
|
|
||||||
* Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style (#36876)
|
|
||||||
* Enable eslint concurrency (#36878)
|
|
||||||
* Vendor relative-time-element as local web component (#36853)
|
|
||||||
* Update material-icon-theme v5.32.0 (#36832)
|
|
||||||
* Update Go dependencies (#36781)
|
|
||||||
* Upgrade minimatch (#36760)
|
|
||||||
* Remove i18n backport tool at the moment because of translation format changed (#36643)
|
|
||||||
* Update emoji data for Unicode 16 (#36596)
|
|
||||||
* Update JS dependencies, adjust webpack config, misc fixes (#36431)
|
|
||||||
* Update material-icon-theme to v5.31.0 (#36427)
|
|
||||||
* Update JS and PY deps (#36383)
|
|
||||||
* Bump alpine to 3.23, add platforms to `docker-dryrun` (#36379)
|
|
||||||
* Update JS deps (#36354)
|
|
||||||
* Update goldmark to v1.7.16 (#36343)
|
|
||||||
* Update chroma to v2.22.0 (#36342)
|
|
||||||
* DOCS
|
|
||||||
* Update AI Contribution Policy (#37022)
|
|
||||||
* Update AGENTS.md with additional guidelines (#37018)
|
|
||||||
* Add missing cron tasks to example ini (#37012)
|
|
||||||
* Add AI Contribution Policy to CONTRIBUTING.md (#36651)
|
|
||||||
* Minor punctuation improvement in CONTRIBUTING.md (#36291)
|
|
||||||
* Add documentation for markdown anchor post-processing (#36443)
|
|
||||||
* MISC
|
* MISC
|
||||||
* Correct spelling (#36783)
|
* Forked from Gogs and renamed to Gitea
|
||||||
* Update Nix flake (#37110)
|
* Catching more errors with logs
|
||||||
* Update Nix flake (#37024)
|
* Fixed all linting errors
|
||||||
* Add valid github scopes (#36977)
|
* Made the go linter entirely happy
|
||||||
* Update Nix flake (#36943)
|
* Really integrated vendoring
|
||||||
* Update Nix flake (#36902)
|
|
||||||
* Update Nix flake (#36857)
|
|
||||||
* Update Nix flake (#36787)
|
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
# Gitea Community Code of Conduct
|
|
||||||
|
|
||||||
## About
|
|
||||||
|
|
||||||
Online communities include people from many different backgrounds. The Gitea contributors are committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity and expression, sexual orientation, disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality, race, age, religion, or similar personal characteristics.
|
|
||||||
|
|
||||||
The first goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Gitea effectively, productively, and respectfully.
|
|
||||||
|
|
||||||
The second goal is to provide a mechanism for resolving conflicts in the community when they arise.
|
|
||||||
|
|
||||||
The third goal of the Code of Conduct is to make our community welcoming to people from different backgrounds. Diversity is critical to the project; for Gitea to be successful, it needs contributors and users from all backgrounds.
|
|
||||||
|
|
||||||
We believe that healthy debate and disagreement are essential to a healthy project and community. However, it is never ok to be disrespectful. We value diverse opinions, but we value respectful behavior more.
|
|
||||||
|
|
||||||
## Community values
|
|
||||||
|
|
||||||
These are the values to which people in the Gitea community should aspire.
|
|
||||||
|
|
||||||
- **Be friendly and welcoming.**
|
|
||||||
- **Be patient.**
|
|
||||||
- Remember that people have varying communication styles and that not everyone is using their native language. (Meaning and tone can be lost in translation.)
|
|
||||||
- **Be thoughtful.**
|
|
||||||
- Productive communication requires effort. Think about how your words will be interpreted.
|
|
||||||
- Remember that sometimes it is best to refrain entirely from commenting.
|
|
||||||
- **Be respectful.**
|
|
||||||
- In particular, respect differences of opinion.
|
|
||||||
- **Be charitable.**
|
|
||||||
- Interpret the arguments of others in good faith, do not seek to disagree.
|
|
||||||
- When we do disagree, try to understand why.
|
|
||||||
- **Be constructive.**
|
|
||||||
- Avoid derailing: stay on topic; if you want to talk about something else, start a new conversation.
|
|
||||||
- Avoid unconstructive criticism: don't merely decry the current state of affairs; offer—or at least solicit—suggestions as to how things may be improved.
|
|
||||||
- Avoid snarking (pithy, unproductive, sniping comments).
|
|
||||||
- Avoid discussing potentially offensive or sensitive issues; this all too often leads to unnecessary conflict.
|
|
||||||
- Avoid microaggressions (brief and commonplace verbal, behavioral and environmental indignities that communicate hostile, derogatory or negative slights and insults to a person or group).
|
|
||||||
- **Be responsible.**
|
|
||||||
- What you say and do matters. Take responsibility for your words and actions, including their consequences, whether intended or otherwise.
|
|
||||||
|
|
||||||
People are complicated. You should expect to be misunderstood and to misunderstand others; when this inevitably occurs, resist the urge to be defensive or assign blame. Try not to take offense where no offense was intended. Give people the benefit of the doubt. Even if the intent was to provoke, do not rise to it. It is the responsibility of all parties to de-escalate conflict when it arises.
|
|
||||||
|
|
||||||
## Code of Conduct
|
|
||||||
|
|
||||||
### Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
||||||
|
|
||||||
### Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment include:
|
|
||||||
|
|
||||||
- Using welcoming and inclusive language
|
|
||||||
- Being respectful of differing viewpoints and experiences
|
|
||||||
- Gracefully accepting constructive criticism
|
|
||||||
- Focusing on what is best for the community
|
|
||||||
- Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
||||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
- Public or private harassment
|
|
||||||
- Publishing others’ private information, such as a physical or electronic address, without explicit permission
|
|
||||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
||||||
|
|
||||||
### Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or reject: comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, as well as to ban (temporarily or permanently) any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
### Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
This Code of Conduct also applies outside the project spaces when the Project Stewards have a reasonable belief that an individual’s behavior may have a negative impact on the project or its community.
|
|
||||||
|
|
||||||
### Conflict Resolution
|
|
||||||
|
|
||||||
We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the project’s code of conduct.
|
|
||||||
|
|
||||||
If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe.
|
|
||||||
|
|
||||||
Reports should be directed to the Gitea Project Stewards at conduct@gitea.com. It is the Project Stewards’ duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the technical-oversight-committee.
|
|
||||||
|
|
||||||
We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. Under normal circumstances, we will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. If there is a consensus between maintainers that such an endeavor would be useless (i.e. in case of an obvious spammer), we reserve the right to take action without notifying the accused first. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyone’s safety, we may take action without notice.
|
|
||||||
|
|
||||||
### Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
- Treat everyone with respect and kindness.
|
|
||||||
- Be thoughtful in how you communicate.
|
|
||||||
- Don’t be destructive or inflammatory.
|
|
||||||
- If you encounter an issue, please mail conduct@gitea.com.
|
|
||||||
+66
-141
@@ -1,161 +1,86 @@
|
|||||||
# Contributing to Moko Consulting Projects
|
# Contribution Guidelines
|
||||||
|
|
||||||
Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy.
|
## Introduction
|
||||||
|
|
||||||
## Branching Workflow
|
This document explains how to contribute changes to the Gitea project. It assumes you have followed the [installation instructions](https://github.com/go-gitea/docs/tree/master/en-US/installation). Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io).
|
||||||
|
|
||||||
|
## Bug reports
|
||||||
|
|
||||||
|
Please search the issues on the issue tracker with a variety of keywords to ensure your bug is not already reported.
|
||||||
|
|
||||||
|
If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new) and answer the questions so we can understand and reproduce the problematic behavior.
|
||||||
|
|
||||||
|
The burden is on you to convince us that it is actually a bug in Gitea. This is easiest to do when you write clear, concise instructions so we can reproduce the behavior (even if it seems obvious). The more detailed and specific you are, the faster we will be able to help you. Check out [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).
|
||||||
|
|
||||||
|
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
|
||||||
|
|
||||||
|
## Discuss your design
|
||||||
|
|
||||||
|
The project welcomes submissions but please let everyone know what you're working on if you want to change or add something to the Gitea repositories.
|
||||||
|
|
||||||
|
Before starting to write something new for the Gitea project, please [file an issue](https://github.com/go-gitea/gitea/issues/new). Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals) before they can be accepted.
|
||||||
|
|
||||||
|
This process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside the goals for the project and tools. It also checks that the design is sound before code is written; the code review tool is not the place for high-level discussions.
|
||||||
|
|
||||||
|
## Testing redux
|
||||||
|
|
||||||
|
Before sending code out for review, run all the tests for the whole tree to make sure the changes don't break other usage and keep the compatibility on upgrade. To make sure you are running the test suite exactly like we do you should install the CLI for [Drone CI](https://github.com/drone/drone), as we are using the server for continous testing, following [these instructions](http://readme.drone.io/0.5/install/cli/). After that you can simply call `drone exec` within your working directory and it will try to run the test suite locally.
|
||||||
|
|
||||||
|
## Code review
|
||||||
|
|
||||||
|
Changes to Gitea must be reviewed before they are accepted, no matter who makes the change even if it is an owner or a maintainer. We use GitHub's pull request workflow to do that and we also use [LGTM](http://lgtm.co) to ensure every PR is reviewed by at least 2 maintainers.
|
||||||
|
|
||||||
|
Please try to make your pull request easy to review for us. Please read the "[How to get faster PR reviews](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md)" guide, it has lots of useful tips for any project you may want to contribute. Some of the key points:
|
||||||
|
|
||||||
|
* Make small pull requests. The smaller, the faster to review and the more likely it will be merged soon.
|
||||||
|
* Don't make changes unrelated to your PR. Maybe there are typos on some comments, maybe refactoring would be welcome on a function... but if that is not related to your PR, please make *another* PR for that.
|
||||||
|
* Split big pull requests in multiple small ones. An incremental change will be faster to review than a huge PR.
|
||||||
|
|
||||||
|
## Sign your work
|
||||||
|
|
||||||
|
The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: If you can certify [DCO](DCO), then you just add a line to every git commit message:
|
||||||
|
|
||||||
```
|
```
|
||||||
feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main
|
Signed-off-by: Joe Smith <joe.smith@email.com>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step by step
|
Please use your real name, we really dislike pseudonyms or anonymous contributions. We are in the opensource world without secrets. If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
|
||||||
|
|
||||||
1. **Create a feature branch** from `dev`:
|
## Maintainers
|
||||||
```bash
|
|
||||||
git checkout dev && git pull
|
|
||||||
git checkout -b feature/my-change
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Work and commit** on your feature branch. Push to origin.
|
To make sure every PR is checked, we got team maintainers. Every PR **MUST** be reviewed by at least two maintainers (or owners) before it can get merged. A maintainer should be a contributor of Gitea (or Gogs) and contributed at least 4 accepted PRs. A contributor should apply as a maintainer in the [Gitter develop channel](https://gitter.im/go-gitea/develop). The owners or the team maintainers may invite the contributor. A maintainer should spend some time on code reviews. If a maintainer has no time to do that, they should apply to leave the maintainers team and we will give them the honor of being a member of the advisors team. Of course, if an advisor has time to code review, we will gladly welcome them back to maintainers team. If someone has no time to code review and forgets to leave the maintainers team, the owners have the power to move him from maintainers team to advisors team.
|
||||||
|
|
||||||
3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it.
|
## Owners
|
||||||
|
|
||||||
4. **When ready for release**, open a **draft PR**: `dev` → `main`.
|
Since Gitea is a pure community organization without any company support, to keep the development healthy we will elect the owners every year. Every time we will elect three owners. All the contributors may vote up to three people, one of which is the main owner, and the others are assistant owners. When the new owners have been elected, the old owners MUST move the power to the new ones. If an owner don't obey these rules, the others are allowed to revoke his owner status.
|
||||||
- This automatically renames the source branch to `rc` (release candidate)
|
|
||||||
- An RC pre-release is built and uploaded
|
|
||||||
|
|
||||||
5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage:
|
After the election, the new owners should say they agree with these rules on the [CONTRIBUTING](CONTRIBUTING.md) on the [Gitter main channel](https://gitter.im/go-gitea/gitea). Below are the words to speak:
|
||||||
- Rename `dev` to `alpha` for early testing → alpha pre-release is built
|
|
||||||
- Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built
|
|
||||||
- When the draft PR is created, the branch is renamed to `rc`
|
|
||||||
|
|
||||||
6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`.
|
|
||||||
|
|
||||||
7. **Merging to main** triggers the stable release pipeline:
|
|
||||||
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
|
||||||
- Stability suffix stripped (clean version)
|
|
||||||
- Gitea release created with ZIP/tar.gz packages
|
|
||||||
- `updates.xml` updated (Joomla extensions)
|
|
||||||
- `dev` branch recreated from `main`
|
|
||||||
|
|
||||||
### Branch summary
|
|
||||||
|
|
||||||
| Branch | Purpose | Created by |
|
|
||||||
|--------|---------|-----------|
|
|
||||||
| `feature/*` | New features and fixes | Developer |
|
|
||||||
| `dev` | Integration branch | Auto-recreated after release |
|
|
||||||
| `alpha` | Alpha pre-release testing | Manual rename from `dev` |
|
|
||||||
| `beta` | Beta pre-release testing | Manual rename from `alpha` |
|
|
||||||
| `rc` | Release candidate | Auto-renamed on draft PR to main |
|
|
||||||
| `main` | Stable releases | Protected, merge only |
|
|
||||||
| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI |
|
|
||||||
|
|
||||||
### Protected branches
|
|
||||||
|
|
||||||
| Branch | Direct push | Merge via |
|
|
||||||
|--------|------------|-----------|
|
|
||||||
| `main` | Blocked (CI bot whitelisted) | PR merge only |
|
|
||||||
| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* |
|
|
||||||
| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR |
|
|
||||||
| `alpha` | Blocked (CI bot whitelisted) | Manual rename |
|
|
||||||
| `beta` | Blocked (CI bot whitelisted) | Manual rename |
|
|
||||||
| `feature/*` | Open | N/A (source branch) |
|
|
||||||
|
|
||||||
## Version Policy
|
|
||||||
|
|
||||||
### Format
|
|
||||||
|
|
||||||
All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded:
|
|
||||||
|
|
||||||
- **XX** — Major version (breaking changes)
|
|
||||||
- **YY** — Minor version (new features, bumped on release to main)
|
|
||||||
- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches)
|
|
||||||
|
|
||||||
Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major.
|
|
||||||
|
|
||||||
### Stability suffixes
|
|
||||||
|
|
||||||
Each branch appends a suffix to indicate stability:
|
|
||||||
|
|
||||||
| Branch | Suffix | Example |
|
|
||||||
|--------|--------|---------|
|
|
||||||
| `main` | (none) | `02.09.00` |
|
|
||||||
| `dev` | `-dev` | `02.09.01-dev` |
|
|
||||||
| `feature/*` | `-dev` | `02.09.01-dev` |
|
|
||||||
| `alpha` | `-alpha` | `02.09.01-alpha` |
|
|
||||||
| `beta` | `-beta` | `02.09.01-beta` |
|
|
||||||
| `rc` | `-rc` | `02.09.01-rc` |
|
|
||||||
|
|
||||||
### Auto version bump
|
|
||||||
|
|
||||||
On every push to `dev`, `feature/*`, or `patch/*`:
|
|
||||||
|
|
||||||
1. Patch version incremented
|
|
||||||
2. Stability suffix `-dev` applied
|
|
||||||
3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.)
|
|
||||||
4. Commit created with `[skip ci]` to avoid loops
|
|
||||||
|
|
||||||
### Release version flow
|
|
||||||
|
|
||||||
Version bumps happen at specific release events:
|
|
||||||
|
|
||||||
| Event | Bump | Example |
|
|
||||||
|-------|------|---------|
|
|
||||||
| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` |
|
|
||||||
| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` |
|
|
||||||
| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) |
|
|
||||||
| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` |
|
|
||||||
|
|
||||||
### Release stream copies
|
|
||||||
|
|
||||||
When a higher-stability release is published, copies are created for all lesser streams with the same base version:
|
|
||||||
|
|
||||||
- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta`
|
|
||||||
- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc`
|
|
||||||
|
|
||||||
This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed).
|
|
||||||
|
|
||||||
### Version files
|
|
||||||
|
|
||||||
The version tools update all files containing version stamps:
|
|
||||||
|
|
||||||
- `.mokogitea/manifest.xml` (canonical source)
|
|
||||||
- Joomla XML manifests (`<version>` tag)
|
|
||||||
- `README.md`, `CHANGELOG.md` (`VERSION:` pattern)
|
|
||||||
- `package.json`, `pyproject.toml`
|
|
||||||
- Any text file with a `VERSION: XX.YY.ZZ` label
|
|
||||||
|
|
||||||
Files synced from other repos (with a `# REPO:` header) are not touched.
|
|
||||||
|
|
||||||
## Code Standards
|
|
||||||
|
|
||||||
- **PHP**: PSR-12, tabs for indentation
|
|
||||||
- **Copyright**: all files must include the Moko Consulting copyright header
|
|
||||||
- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo)
|
|
||||||
- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names
|
|
||||||
|
|
||||||
## Commit Messages
|
|
||||||
|
|
||||||
Use conventional commit format:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
type(scope): short description
|
I'm glad to be an owner of Gitea, I agree with [CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea and lead the development of Gitea.
|
||||||
|
|
||||||
Optional body with context.
|
|
||||||
|
|
||||||
Authored-by: Moko Consulting
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci`
|
To honor the past owners, here's the history of the owners and the time they served:
|
||||||
|
|
||||||
Special flags in commit messages:
|
* 2016-11-04 ~ 2017-12-31
|
||||||
- `[skip ci]` — skip all CI workflows
|
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
||||||
- `[skip bump]` — skip auto version bump only
|
* [Thomas Boerger](https://github.com/tboerger) <thomas@webhippie.de>
|
||||||
|
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
||||||
|
|
||||||
## Reporting Issues
|
## Versions
|
||||||
|
|
||||||
Use the repository's issue tracker with the appropriate template.
|
Gitea has the `master` branch as a tip branch and has version branches such as `v0.9`. `v0.9` is a release branch and we will tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept pull requests on the `v0.9` branch and publish a `v0.9.1` tag, after bringing the bug fix also to the master branch.
|
||||||
|
|
||||||
---
|
Since the `master` branch is a tip version, if you wish to use Gitea in production, please download the latest release tag version. All the branches will be protected via GitHub, all the PRs to every branch must be reviewed by two maintainers and must pass the automatic tests.
|
||||||
|
|
||||||
*Moko Consulting <hello@mokoconsulting.tech>*
|
## Copyright
|
||||||
|
|
||||||
|
Code that you contribute should use the standard copyright header:
|
||||||
|
|
||||||
|
```
|
||||||
|
// Copyright 2016 The Gitea Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
```
|
||||||
|
|
||||||
|
Files in the repository contain copyright from the year they are added to the year they are last changed. If the copyright author is changed, just paste the header below the old one.
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ Developer Certificate of Origin
|
|||||||
Version 1.1
|
Version 1.1
|
||||||
|
|
||||||
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||||
|
660 York Street, Suite 102,
|
||||||
|
San Francisco, CA 94110 USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
license document, but changing it is not allowed.
|
license document, but changing it is not allowed.
|
||||||
@@ -31,4 +33,4 @@ By making a contribution to this project, I certify that:
|
|||||||
are public and that a record of the contribution (including all
|
are public and that a record of the contribution (including all
|
||||||
personal information I submit with it, including my sign-off) is
|
personal information I submit with it, including my sign-off) is
|
||||||
maintained indefinitely and may be redistributed consistent with
|
maintained indefinitely and may be redistributed consistent with
|
||||||
this project or the open source license(s) involved.
|
this project or the open source license(s) involved.
|
||||||
+21
-66
@@ -1,68 +1,23 @@
|
|||||||
# syntax=docker/dockerfile:1
|
FROM alpine:3.4
|
||||||
# Build frontend on the native platform to avoid QEMU-related issues with nodejs ecosystem
|
MAINTAINER Thomas Boerger <thomas@webhippie.de>
|
||||||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.26-alpine3.23 AS frontend-build
|
|
||||||
RUN apk --no-cache add build-base git nodejs pnpm
|
|
||||||
WORKDIR /src
|
|
||||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
|
||||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
|
|
||||||
COPY --exclude=.git/ . .
|
|
||||||
RUN make frontend
|
|
||||||
|
|
||||||
# Build backend for each target platform
|
|
||||||
FROM docker.io/library/golang:1.26-alpine3.23 AS build-env
|
|
||||||
|
|
||||||
ARG GITEA_VERSION
|
|
||||||
ARG TAGS=""
|
|
||||||
ENV TAGS="bindata timetzdata $TAGS"
|
|
||||||
ARG CGO_EXTRA_CFLAGS
|
|
||||||
|
|
||||||
# Build deps
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
build-base \
|
|
||||||
git
|
|
||||||
|
|
||||||
WORKDIR ${GOPATH}/src/git.mokoconsulting.tech/MokoConsulting/MokoGitea
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
# Use COPY instead of bind mount as read-only one breaks makefile state tracking
|
|
||||||
COPY --exclude=.git/ . .
|
|
||||||
COPY --from=frontend-build /src/public/assets public/assets
|
|
||||||
|
|
||||||
# Build gitea, .git mount is required for version data
|
|
||||||
# GOFLAGS=-p 1 serializes compilation to prevent OOM on low-memory servers
|
|
||||||
ARG GOFLAGS="-p 1"
|
|
||||||
RUN --mount=type=cache,target="/root/.cache/go-build" \
|
|
||||||
--mount=type=bind,source=".git/",target=".git/" \
|
|
||||||
GOFLAGS="${GOFLAGS}" make backend
|
|
||||||
|
|
||||||
COPY docker/root /tmp/local
|
|
||||||
|
|
||||||
# Set permissions for builds that made under windows which strips the executable bit from file
|
|
||||||
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
|
|
||||||
/tmp/local/usr/local/bin/* \
|
|
||||||
/tmp/local/etc/s6/gitea/* \
|
|
||||||
/tmp/local/etc/s6/openssh/* \
|
|
||||||
/tmp/local/etc/s6/.s6-svscan/* \
|
|
||||||
/go/src/git.mokoconsulting.tech/MokoConsulting/MokoGitea/gitea
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.23 AS gitea
|
|
||||||
|
|
||||||
EXPOSE 22 3000
|
EXPOSE 22 3000
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN apk update && \
|
||||||
bash \
|
apk add \
|
||||||
|
su-exec \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
sqlite \
|
||||||
gettext \
|
bash \
|
||||||
git \
|
git \
|
||||||
linux-pam \
|
linux-pam \
|
||||||
openssh \
|
|
||||||
s6 \
|
s6 \
|
||||||
sqlite \
|
curl \
|
||||||
su-exec \
|
openssh \
|
||||||
gnupg
|
tzdata && \
|
||||||
|
rm -rf \
|
||||||
RUN addgroup \
|
/var/cache/apk/* && \
|
||||||
|
addgroup \
|
||||||
-S -g 1000 \
|
-S -g 1000 \
|
||||||
git && \
|
git && \
|
||||||
adduser \
|
adduser \
|
||||||
@@ -72,16 +27,16 @@ RUN addgroup \
|
|||||||
-u 1000 \
|
-u 1000 \
|
||||||
-G git \
|
-G git \
|
||||||
git && \
|
git && \
|
||||||
echo "git:*" | chpasswd -e
|
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
|
||||||
|
|
||||||
COPY --from=build-env /tmp/local /
|
ENV USER git
|
||||||
COPY --from=build-env /go/src/git.mokoconsulting.tech/MokoConsulting/MokoGitea/gitea /app/gitea/gitea
|
ENV GITEA_CUSTOM /data/gitea
|
||||||
|
ENV GODEBUG=netdns=go
|
||||||
ENV USER=git
|
|
||||||
ENV GITEA_CUSTOM=/data/gitea
|
|
||||||
|
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
# HINT: HEALTH-CHECK-ENDPOINT: don't use HEALTHCHECK, search this hint keyword for more information
|
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||||
CMD ["/usr/bin/s6-svscan", "/etc/s6"]
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||||
|
|
||||||
|
COPY docker /
|
||||||
|
COPY gitea /app/gitea/gitea
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
# syntax=docker/dockerfile:1
|
|
||||||
# Build frontend on the native platform to avoid QEMU-related issues with nodejs ecosystem
|
|
||||||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.26-alpine3.23 AS frontend-build
|
|
||||||
RUN apk --no-cache add build-base git nodejs pnpm
|
|
||||||
WORKDIR /src
|
|
||||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
|
||||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
|
|
||||||
COPY --exclude=.git/ . .
|
|
||||||
RUN make frontend
|
|
||||||
|
|
||||||
# Build backend for each target platform
|
|
||||||
FROM docker.io/library/golang:1.26-alpine3.23 AS build-env
|
|
||||||
|
|
||||||
ARG GITEA_VERSION
|
|
||||||
ARG TAGS=""
|
|
||||||
ENV TAGS="bindata timetzdata $TAGS"
|
|
||||||
ARG CGO_EXTRA_CFLAGS
|
|
||||||
|
|
||||||
# Build deps
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
build-base \
|
|
||||||
git
|
|
||||||
|
|
||||||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
# See the comments in Dockerfile
|
|
||||||
COPY --exclude=.git/ . .
|
|
||||||
COPY --from=frontend-build /src/public/assets public/assets
|
|
||||||
|
|
||||||
# Build gitea, .git mount is required for version data
|
|
||||||
RUN --mount=type=cache,target="/root/.cache/go-build" \
|
|
||||||
--mount=type=bind,source=".git/",target=".git/" \
|
|
||||||
make backend
|
|
||||||
|
|
||||||
COPY docker/rootless /tmp/local
|
|
||||||
|
|
||||||
# Set permissions for builds that made under windows which strips the executable bit from file
|
|
||||||
RUN chmod 755 /tmp/local/usr/local/bin/* \
|
|
||||||
/go/src/code.gitea.io/gitea/gitea
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.23 AS gitea-rootless
|
|
||||||
|
|
||||||
EXPOSE 2222 3000
|
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
bash \
|
|
||||||
ca-certificates \
|
|
||||||
dumb-init \
|
|
||||||
gettext \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
gnupg \
|
|
||||||
openssh-keygen
|
|
||||||
|
|
||||||
RUN addgroup \
|
|
||||||
-S -g 1000 \
|
|
||||||
git && \
|
|
||||||
adduser \
|
|
||||||
-S -H -D \
|
|
||||||
-h /var/lib/gitea/git \
|
|
||||||
-s /bin/bash \
|
|
||||||
-u 1000 \
|
|
||||||
-G git \
|
|
||||||
git
|
|
||||||
|
|
||||||
RUN mkdir -p /var/lib/gitea /etc/gitea
|
|
||||||
RUN chown git:git /var/lib/gitea /etc/gitea
|
|
||||||
|
|
||||||
COPY --from=build-env /tmp/local /
|
|
||||||
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
|
||||||
|
|
||||||
# git:git
|
|
||||||
USER 1000:1000
|
|
||||||
ENV GITEA_WORK_DIR=/var/lib/gitea
|
|
||||||
ENV GITEA_CUSTOM=/var/lib/gitea/custom
|
|
||||||
ENV GITEA_TEMP=/tmp/gitea
|
|
||||||
ENV TMPDIR=/tmp/gitea
|
|
||||||
|
|
||||||
# TODO add to docs the ability to define the ini to load (useful to test and revert a config)
|
|
||||||
ENV GITEA_APP_INI=/etc/gitea/app.ini
|
|
||||||
ENV HOME="/var/lib/gitea/git"
|
|
||||||
VOLUME ["/var/lib/gitea", "/etc/gitea"]
|
|
||||||
WORKDIR /var/lib/gitea
|
|
||||||
|
|
||||||
# HINT: HEALTH-CHECK-ENDPOINT: don't use HEALTHCHECK, search this hint keyword for more information
|
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
|
||||||
CMD []
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
FROM hypriot/rpi-alpine-scratch:v3.4
|
||||||
|
MAINTAINER Thomas Boerger <thomas@webhippie.de>
|
||||||
|
|
||||||
|
EXPOSE 22 3000
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add \
|
||||||
|
su-exec \
|
||||||
|
ca-certificates \
|
||||||
|
sqlite \
|
||||||
|
bash \
|
||||||
|
git \
|
||||||
|
linux-pam \
|
||||||
|
s6 \
|
||||||
|
curl \
|
||||||
|
openssh \
|
||||||
|
tzdata && \
|
||||||
|
rm -rf \
|
||||||
|
/var/cache/apk/* && \
|
||||||
|
addgroup \
|
||||||
|
-S -g 1000 \
|
||||||
|
git && \
|
||||||
|
adduser \
|
||||||
|
-S -H -D \
|
||||||
|
-h /data/git \
|
||||||
|
-s /bin/bash \
|
||||||
|
-u 1000 \
|
||||||
|
-G git \
|
||||||
|
git
|
||||||
|
|
||||||
|
ENV USER git
|
||||||
|
ENV GITEA_CUSTOM /data/gitea
|
||||||
|
ENV GODEBUG=netdns=go
|
||||||
|
|
||||||
|
VOLUME ["/data"]
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||||
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||||
|
|
||||||
|
COPY docker /
|
||||||
|
|
||||||
|
COPY public /app/gitea/public
|
||||||
|
COPY templates /app/gitea/templates
|
||||||
|
COPY gitea /app/gitea/gitea
|
||||||
+2
-57
@@ -1,67 +1,12 @@
|
|||||||
Alexey Makhov <amakhov@avito.ru> (@makhov)
|
Alexey Makhov <amakhov@avito.ru> (@makhov)
|
||||||
Bo-Yi Wu <appleboy.tw@gmail.com> (@appleboy)
|
Andrey Nering <andrey.nering@gmail.com> (@andreynering)
|
||||||
Ethan Koenig <ethantkoenig@gmail.com> (@ethantkoenig)
|
|
||||||
Kees de Vries <bouwko@gmail.com> (@Bwko)
|
Kees de Vries <bouwko@gmail.com> (@Bwko)
|
||||||
Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
|
Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
|
||||||
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
|
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
|
||||||
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
|
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
|
||||||
|
Matthias Loibl <mail@matthiasloibl.com> (@metalmatze)
|
||||||
Rachid Zarouali <nobody@nobody.tld> (@xinity)
|
Rachid Zarouali <nobody@nobody.tld> (@xinity)
|
||||||
Rémy Boulanouar <admin@dblk.org> (@DblK)
|
Rémy Boulanouar <admin@dblk.org> (@DblK)
|
||||||
Sandro Santilli <strk@kbt.io> (@strk)
|
Sandro Santilli <strk@kbt.io> (@strk)
|
||||||
Thibault Meyer <meyer.thibault@gmail.com> (@0xbaadf00d)
|
Thibault Meyer <meyer.thibault@gmail.com> (@0xbaadf00d)
|
||||||
Thomas Boerger <thomas@webhippie.de> (@tboerger)
|
Thomas Boerger <thomas@webhippie.de> (@tboerger)
|
||||||
Patrick G <geek1011@outlook.com> (@geek1011)
|
|
||||||
Antoine Girard <sapk@sapk.fr> (@sapk)
|
|
||||||
Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
|
|
||||||
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
|
|
||||||
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
|
|
||||||
Peter Žeby <morlinest@gmail.com> (@morlinest)
|
|
||||||
Matti Ranta <techknowlogick@gitea.io> (@techknowlogick)
|
|
||||||
Jonas Franz <info@jonasfranz.software> (@jonasfranz)
|
|
||||||
Alexey Terentyev <axifnx@gmail.com> (@axifive)
|
|
||||||
Lanre Adelowo <yo@lanre.wtf> (@adelowo)
|
|
||||||
Konrad Langenberg <k@knt.li> (@kolaente)
|
|
||||||
He-Long Zhang <outman99@hotmail.com> (@BetaCat0)
|
|
||||||
Andrew Thornton <art27@cantab.net> (@zeripath)
|
|
||||||
John Olheiser <john.olheiser@gmail.com> (@jolheiser)
|
|
||||||
Richard Mahn <rich.mahn@unfoldingword.org> (@richmahn)
|
|
||||||
Mrsdizzie <info@mrsdizzie.com> (@mrsdizzie)
|
|
||||||
silverwind <me@silverwind.io> (@silverwind)
|
|
||||||
Gary Kim <gary@garykim.dev> (@gary-kim)
|
|
||||||
Guillermo Prandi <gitea.maint@mailfilter.com.ar> (@guillep2k)
|
|
||||||
Mura Li <typeless@ctli.io> (@typeless)
|
|
||||||
6543 <6543@obermui.de> (@6543)
|
|
||||||
David Svantesson <davidsvantesson@gmail.com> (@davidsvantesson)
|
|
||||||
a1012112796 <1012112796@qq.com> (@a1012112796)
|
|
||||||
Karl Heinz Marbaise <kama@soebes.de> (@khmarbaise)
|
|
||||||
Norwin Roosen <git@nroo.de> (@noerw)
|
|
||||||
Kyle Dumont <kdumontnu@gmail.com> (@kdumontnu)
|
|
||||||
Janis Estelmann <admin@oldschoolhack.me> (@KN4CK3R)
|
|
||||||
Jimmy Praet <jimmy.praet@telenet.be> (@jpraet)
|
|
||||||
Leon Hofmeister <dev.lh@web.de> (@delvh)
|
|
||||||
Wim <wim@42.be> (@42wim)
|
|
||||||
Jason Song <i@wolfogre.com> (@wolfogre)
|
|
||||||
Yarden Shoham <git@yardenshoham.com> (@yardenshoham)
|
|
||||||
Yu Tian <zettat123@gmail.com> (@Zettat123)
|
|
||||||
Dong Ge <gedong_1994@163.com> (@sillyguodong)
|
|
||||||
Xinyi Gong <hestergong@gmail.com> (@HesterG)
|
|
||||||
wxiaoguang <wxiaoguang@gmail.com> (@wxiaoguang)
|
|
||||||
Gary Moon <gary@garymoon.net> (@garymoon)
|
|
||||||
Philip Peterson <philip.c.peterson@gmail.com> (@philip-peterson)
|
|
||||||
Denys Konovalov <kontakt@denyskon.de> (@denyskon)
|
|
||||||
Punit Inani <punitinani1@gmail.com> (@puni9869)
|
|
||||||
CaiCandong <1290147055@qq.com> (@caicandong)
|
|
||||||
Rui Chen <rui@chenrui.dev> (@chenrui333)
|
|
||||||
Nanguan Lin <nanguanlin6@gmail.com> (@lng2020)
|
|
||||||
kerwin612 <kerwin612@qq.com> (@kerwin612)
|
|
||||||
Gary Wang <git@blumia.net> (@BLumia)
|
|
||||||
Tim-Niclas Oelschläger <zokki.softwareschmiede@gmail.com> (@zokkis)
|
|
||||||
Yu Liu <1240335630@qq.com> (@HEREYUA)
|
|
||||||
Kemal Zebari <kemalzebra@gmail.com> (@kemzeb)
|
|
||||||
Rowan Bohde <rowan.bohde@gmail.com> (@bohde)
|
|
||||||
hiifong <i@hiif.ong> (@hiifong)
|
|
||||||
metiftikci <metiftikci@hotmail.com> (@metiftikci)
|
|
||||||
Christopher Homberger <christopher.homberger@web.de> (@ChristopherHX)
|
|
||||||
Tobias Balle-Petersen <tobiasbp@gmail.com> (@tobiasbp)
|
|
||||||
TheFox <thefox0x7@gmail.com> (@TheFox0x7)
|
|
||||||
Nicolas <bircni@icloud.com> (@bircni)
|
|
||||||
@@ -1,681 +1,134 @@
|
|||||||
DIST := dist
|
DIST := dist
|
||||||
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
EXECUTABLE := gitea
|
||||||
|
IMPORT := code.gitea.io/gitea
|
||||||
|
|
||||||
# By default use go's 1.25 experimental json v2 library when building
|
BINDATA := modules/{options,public,templates}/bindata.go
|
||||||
# TODO: remove when no longer experimental
|
STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less)
|
||||||
export GOEXPERIMENT ?= jsonv2
|
JAVASCRIPTS :=
|
||||||
|
|
||||||
GO ?= go
|
LDFLAGS += -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')"
|
||||||
SHASUM ?= shasum -a 256
|
|
||||||
COMMA := ,
|
|
||||||
|
|
||||||
XGO_VERSION := go-1.26.x
|
TARGETS ?= linux/*,darwin/*,windows/*
|
||||||
|
PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
|
||||||
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
|
SOURCES ?= $(shell find . -name "*.go" -type f)
|
||||||
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3 # renovate: datasource=go
|
|
||||||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4 # renovate: datasource=go
|
|
||||||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15 # renovate: datasource=go
|
|
||||||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.8.0 # renovate: datasource=go
|
|
||||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.33.1 # renovate: datasource=go
|
|
||||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
|
||||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
|
|
||||||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.7.11 # renovate: datasource=go
|
|
||||||
|
|
||||||
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
|
|
||||||
ifeq ($(HAS_GO), yes)
|
|
||||||
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
|
|
||||||
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
MAKE_EVIDENCE_DIR := .make_evidence
|
|
||||||
|
|
||||||
# Use sqlite as default database if running tests, only do so for local tests, not in CI.
|
|
||||||
# CI should explicitly set the database to avoid unexpected results.
|
|
||||||
ifneq ($(findstring test-,$(MAKECMDGOALS)),)
|
|
||||||
ifeq ($(CI),)
|
|
||||||
GITEA_TEST_DATABASE ?= sqlite
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
TAGS ?=
|
TAGS ?=
|
||||||
TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
|
|
||||||
|
|
||||||
CGO_ENABLED ?= 0
|
ifneq ($(DRONE_TAG),)
|
||||||
ifneq (,$(findstring sqlite_mattn,$(TAGS))$(findstring pam,$(TAGS)))
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||||
CGO_ENABLED = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
STATIC ?=
|
|
||||||
EXTLDFLAGS ?=
|
|
||||||
ifneq ($(STATIC),)
|
|
||||||
EXTLDFLAGS = -extldflags "-static"
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(GOOS),windows)
|
|
||||||
IS_WINDOWS := yes
|
|
||||||
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
|
|
||||||
ifeq ($(GOOS),)
|
|
||||||
IS_WINDOWS := yes
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# GOFLAGS and EXTRA_GOFLAGS are for the 'go build' command only
|
|
||||||
ifeq ($(IS_WINDOWS),yes)
|
|
||||||
GOFLAGS := -v -buildmode=exe
|
|
||||||
EXECUTABLE ?= gitea.exe
|
|
||||||
else
|
else
|
||||||
GOFLAGS := -v
|
ifneq ($(DRONE_BRANCH),)
|
||||||
EXECUTABLE ?= gitea
|
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||||
endif
|
|
||||||
EXTRA_GOFLAGS ?=
|
|
||||||
|
|
||||||
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
|
||||||
SED_INPLACE := sed -i
|
|
||||||
else
|
|
||||||
SED_INPLACE := sed -i ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
# GOTEST_FLAGS is for unit test and integration test
|
|
||||||
GOTEST_FLAGS ?= -timeout 40m
|
|
||||||
|
|
||||||
STORED_VERSION_FILE := VERSION
|
|
||||||
|
|
||||||
GITHUB_REF_TYPE ?= branch
|
|
||||||
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
|
||||||
|
|
||||||
ifneq ($(GITHUB_REF_TYPE),branch)
|
|
||||||
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
|
|
||||||
GITEA_VERSION ?= $(VERSION)
|
|
||||||
else
|
|
||||||
ifneq ($(GITHUB_REF_NAME),)
|
|
||||||
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))-nightly
|
|
||||||
else
|
else
|
||||||
VERSION ?= main
|
VERSION ?= master
|
||||||
endif
|
|
||||||
|
|
||||||
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
|
|
||||||
ifneq ($(STORED_VERSION),)
|
|
||||||
GITEA_VERSION ?= $(STORED_VERSION)
|
|
||||||
else
|
|
||||||
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# if version = "main" then update version to "nightly"
|
|
||||||
ifeq ($(VERSION),main)
|
|
||||||
VERSION := main-nightly
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDFLAGS := $(LDFLAGS) -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
|
|
||||||
|
|
||||||
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/riscv64
|
|
||||||
|
|
||||||
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration,$(shell $(GO) list ./... | grep -v /vendor/))
|
|
||||||
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)
|
|
||||||
|
|
||||||
FRONTEND_SOURCES := $(shell find web_src/js web_src/css -type f)
|
|
||||||
FRONTEND_CONFIGS := vite.config.ts tailwind.config.ts
|
|
||||||
FRONTEND_DEST := public/assets/.vite/manifest.json
|
|
||||||
FRONTEND_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/.vite
|
|
||||||
FRONTEND_DEV_LOG_LEVEL ?= warn
|
|
||||||
|
|
||||||
BINDATA_DEST_WILDCARD := modules/migration/bindata.* modules/public/bindata.* modules/options/bindata.* modules/templates/bindata.*
|
|
||||||
|
|
||||||
GENERATED_GO_DEST := modules/charset/invisible_gen.go modules/charset/ambiguous_gen.go
|
|
||||||
|
|
||||||
SVG_DEST_DIR := public/assets/img/svg
|
|
||||||
|
|
||||||
AIR_TMP_DIR := .air
|
|
||||||
|
|
||||||
GO_LICENSE_FILE := assets/go-licenses.json
|
|
||||||
|
|
||||||
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR)
|
|
||||||
|
|
||||||
GO_DIRS := build cmd models modules routers services tests tools
|
|
||||||
WEB_DIRS := web_src/js web_src/css
|
|
||||||
|
|
||||||
ESLINT_FILES := web_src/js tools *.ts tests/e2e
|
|
||||||
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
|
|
||||||
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.json .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml))
|
|
||||||
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.json
|
|
||||||
|
|
||||||
GO_SOURCES := $(wildcard *.go)
|
|
||||||
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go")
|
|
||||||
GO_SOURCES += $(GENERATED_GO_DEST)
|
|
||||||
|
|
||||||
ESLINT_CONCURRENCY ?= 2
|
|
||||||
|
|
||||||
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
|
|
||||||
SWAGGER_SPEC_INPUT := templates/swagger/v1_input.json
|
|
||||||
SWAGGER_EXCLUDE := code.gitea.io/sdk
|
|
||||||
OPENAPI3_SPEC := templates/swagger/v1_openapi3_json.tmpl
|
|
||||||
|
|
||||||
TEST_MYSQL_HOST ?= mysql:3306
|
|
||||||
TEST_MYSQL_DBNAME ?= testgitea
|
|
||||||
TEST_MYSQL_USERNAME ?= root
|
|
||||||
TEST_MYSQL_PASSWORD ?=
|
|
||||||
TEST_PGSQL_HOST ?= pgsql:5432
|
|
||||||
TEST_PGSQL_DBNAME ?= testgitea
|
|
||||||
TEST_PGSQL_USERNAME ?= postgres
|
|
||||||
TEST_PGSQL_PASSWORD ?= postgres
|
|
||||||
TEST_PGSQL_SCHEMA ?= gtestschema
|
|
||||||
TEST_MINIO_ENDPOINT ?= minio:9000
|
|
||||||
TEST_MSSQL_HOST ?= mssql:1433
|
|
||||||
TEST_MSSQL_DBNAME ?= testgitea
|
|
||||||
TEST_MSSQL_USERNAME ?= sa
|
|
||||||
TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
|
|
||||||
|
|
||||||
# Include local Makefile
|
|
||||||
# Makefile.local is listed in .gitignore
|
|
||||||
ifneq ("$(wildcard Makefile.local)","")
|
|
||||||
include Makefile.local
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(foreach v, $(filter TEST_%, $(.VARIABLES)), $(eval MAKEFILE_VARS+=$v=$($v)))
|
|
||||||
$(foreach v, $(filter GITEA_TEST_%, $(.VARIABLES)), $(eval MAKEFILE_VARS+=$v=$($v)))
|
|
||||||
export MAKEFILE_VARS
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
.PHONY: help
|
|
||||||
help: Makefile ## print Makefile help information.
|
|
||||||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m[TARGETS] default target: build\033[0m\n\n\033[35mTargets:\033[0m\n"} /^[0-9A-Za-z._-]+:.*?##/ { printf " \033[36m%-45s\033[0m %s\n", $$1, $$2 }' Makefile #$(MAKEFILE_LIST)
|
|
||||||
@printf " \033[36m%-46s\033[0m %s\n" "test-e2e" "test end to end using playwright"
|
|
||||||
@printf " \033[36m%-46s\033[0m %s\n" "test-backend[#TestSpecificName]" "run unit test (sqlite only)"
|
|
||||||
@printf " \033[36m%-46s\033[0m %s\n" "test-integration[#TestSpecificName]" "run integration test for GITEA_TEST_DATABASE (sqlite, mysql, pgsql, mssql)"
|
|
||||||
|
|
||||||
.PHONY: clean-all
|
|
||||||
clean-all: clean ## delete backend, frontend and integration files
|
|
||||||
rm -rf $(FRONTEND_DEST_ENTRIES) node_modules
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: ## delete backend and integration files
|
clean:
|
||||||
rm -f $(EXECUTABLE) test-*.test tests/*.ini
|
go clean -i ./...
|
||||||
rm -rf $(DIST) $(BINDATA_DEST_WILDCARD) man tests/integration/gitea-integration-*
|
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA)
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: ## format the Go and template code
|
fmt:
|
||||||
$(GO) run $(GOLANGCI_LINT_PACKAGE) fmt
|
go fmt $(PACKAGES)
|
||||||
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
|
|
||||||
@# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only
|
|
||||||
@# whitespace before it
|
|
||||||
@$(SED_INPLACE) \
|
|
||||||
-e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' \
|
|
||||||
-e 's/([ ]\{1,\}/(/g' -e '/^[ ]\{1,\})/! s/[ ]\{1,\})/)/g' \
|
|
||||||
$(TEMPLATES)
|
|
||||||
|
|
||||||
.PHONY: fmt-check
|
.PHONY: vet
|
||||||
fmt-check: fmt
|
vet:
|
||||||
@diff=$$(git diff --color=always $(GO_SOURCES) templates $(WEB_DIRS)); \
|
go vet $(PACKAGES)
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "Please run 'make fmt' and commit the result:"; \
|
.PHONY: generate
|
||||||
printf "%s" "$${diff}"; \
|
generate:
|
||||||
exit 1; \
|
@which go-bindata > /dev/null; if [ $$? -ne 0 ]; then \
|
||||||
|
go get -u github.com/jteeuwen/go-bindata/...; \
|
||||||
fi
|
fi
|
||||||
|
go generate $(PACKAGES)
|
||||||
|
|
||||||
.PHONY: $(TAGS_EVIDENCE)
|
.PHONY: errcheck
|
||||||
$(TAGS_EVIDENCE):
|
errcheck:
|
||||||
@mkdir -p $(MAKE_EVIDENCE_DIR)
|
@which errcheck > /dev/null; if [ $$? -ne 0 ]; then \
|
||||||
@echo "$(TAGS)" > $(TAGS_EVIDENCE)
|
go get -u github.com/kisielk/errcheck; \
|
||||||
|
|
||||||
ifneq "$(TAGS)" "$(shell cat $(TAGS_EVIDENCE) 2>/dev/null)"
|
|
||||||
TAGS_PREREQ := $(TAGS_EVIDENCE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: generate-swagger
|
|
||||||
generate-swagger: $(SWAGGER_SPEC) $(OPENAPI3_SPEC) ## generate the swagger spec from code comments
|
|
||||||
|
|
||||||
$(SWAGGER_SPEC): $(GO_SOURCES) $(SWAGGER_SPEC_INPUT)
|
|
||||||
$(GO) run $(SWAGGER_PACKAGE) generate spec --exclude "$(SWAGGER_EXCLUDE)" --input "$(SWAGGER_SPEC_INPUT)" --output './$(SWAGGER_SPEC)'
|
|
||||||
|
|
||||||
.PHONY: swagger-check
|
|
||||||
swagger-check: generate-swagger
|
|
||||||
@diff=$$(git diff --color=always '$(SWAGGER_SPEC)'); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "Please run 'make generate-swagger' and commit the result:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
fi
|
||||||
|
errcheck $(PACKAGES)
|
||||||
.PHONY: swagger-validate
|
|
||||||
swagger-validate: ## check if the swagger spec is valid
|
|
||||||
@# swagger "validate" requires that the "basePath" must start with a slash, but we are using Golang template "{{...}}"
|
|
||||||
@$(SED_INPLACE) -E -e 's|"basePath":( *)"(.*)"|"basePath":\1"/\2"|g' './$(SWAGGER_SPEC)' # add a prefix slash to basePath
|
|
||||||
@# FIXME: there are some warnings
|
|
||||||
$(GO) run $(SWAGGER_PACKAGE) validate './$(SWAGGER_SPEC)'
|
|
||||||
@$(SED_INPLACE) -E -e 's|"basePath":( *)"/(.*)"|"basePath":\1"\2"|g' './$(SWAGGER_SPEC)' # remove the prefix slash from basePath
|
|
||||||
|
|
||||||
.PHONY: generate-openapi3
|
|
||||||
generate-openapi3: $(OPENAPI3_SPEC) ## generate the OpenAPI 3.0 spec from the Swagger 2.0 spec
|
|
||||||
|
|
||||||
$(OPENAPI3_SPEC): $(SWAGGER_SPEC) build/generate-openapi.go $(wildcard build/openapi3gen/*.go)
|
|
||||||
$(GO) run build/generate-openapi.go
|
|
||||||
|
|
||||||
.PHONY: openapi3-check
|
|
||||||
openapi3-check: generate-openapi3
|
|
||||||
@diff=$$(git diff --color=always '$(OPENAPI3_SPEC)'); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "Please run 'make generate-openapi3' and commit the result:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
.PHONY: checks
|
|
||||||
checks: checks-frontend checks-backend ## run various consistency checks
|
|
||||||
|
|
||||||
.PHONY: checks-frontend
|
|
||||||
checks-frontend: lockfile-check svg-check ## check frontend files
|
|
||||||
|
|
||||||
.PHONY: checks-backend
|
|
||||||
checks-backend: tidy-check swagger-check openapi3-check fmt-check swagger-validate security-check ## check backend files
|
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: lint-frontend lint-backend lint-templates lint-swagger lint-spell lint-md lint-actions lint-json lint-yaml ## lint everything
|
lint:
|
||||||
|
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
|
||||||
.PHONY: lint-fix
|
go get -u github.com/golang/lint/golint; \
|
||||||
lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix ## lint everything and fix issues
|
|
||||||
|
|
||||||
.PHONY: lint-frontend
|
|
||||||
lint-frontend: lint-js lint-css ## lint frontend files
|
|
||||||
|
|
||||||
.PHONY: lint-frontend-fix
|
|
||||||
lint-frontend-fix: lint-js-fix lint-css-fix ## lint frontend files and fix issues
|
|
||||||
|
|
||||||
.PHONY: lint-backend
|
|
||||||
lint-backend: lint-go lint-editorconfig ## lint backend files
|
|
||||||
|
|
||||||
.PHONY: lint-backend-fix
|
|
||||||
lint-backend-fix: lint-go-fix lint-editorconfig ## lint backend files and fix issues
|
|
||||||
|
|
||||||
.PHONY: lint-js
|
|
||||||
lint-js: node_modules ## lint js and ts files
|
|
||||||
pnpm exec eslint --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) $(ESLINT_FILES)
|
|
||||||
pnpm exec vue-tsc
|
|
||||||
|
|
||||||
.PHONY: lint-js-fix
|
|
||||||
lint-js-fix: node_modules ## lint js and ts files and fix issues
|
|
||||||
pnpm exec eslint --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) $(ESLINT_FILES) --fix
|
|
||||||
pnpm exec vue-tsc
|
|
||||||
|
|
||||||
.PHONY: lint-css
|
|
||||||
lint-css: node_modules ## lint css files
|
|
||||||
pnpm exec stylelint --color --max-warnings=0 $(STYLELINT_FILES)
|
|
||||||
|
|
||||||
.PHONY: lint-css-fix
|
|
||||||
lint-css-fix: node_modules ## lint css files and fix issues
|
|
||||||
pnpm exec stylelint --color --max-warnings=0 $(STYLELINT_FILES) --fix
|
|
||||||
|
|
||||||
.PHONY: lint-swagger
|
|
||||||
lint-swagger: node_modules ## lint swagger files
|
|
||||||
pnpm exec spectral lint -q -F hint $(SWAGGER_SPEC)
|
|
||||||
|
|
||||||
.PHONY: lint-md
|
|
||||||
lint-md: node_modules ## lint markdown files
|
|
||||||
pnpm exec markdownlint *.md
|
|
||||||
|
|
||||||
.PHONY: lint-md-fix
|
|
||||||
lint-md-fix: node_modules ## lint markdown files and fix issues
|
|
||||||
pnpm exec markdownlint --fix *.md
|
|
||||||
|
|
||||||
.PHONY: lint-pr-title
|
|
||||||
lint-pr-title: ## lint PR title against Conventional Commits (set PR_TITLE=...)
|
|
||||||
@node ./tools/lint-pr-title.js
|
|
||||||
|
|
||||||
.PHONY: lint-spell
|
|
||||||
lint-spell: ## lint spelling
|
|
||||||
@git ls-files $(SPELLCHECK_FILES) | xargs go run $(MISSPELL_PACKAGE) -dict assets/misspellings.csv -error
|
|
||||||
|
|
||||||
.PHONY: lint-spell-fix
|
|
||||||
lint-spell-fix: ## lint spelling and fix issues
|
|
||||||
@git ls-files $(SPELLCHECK_FILES) | xargs go run $(MISSPELL_PACKAGE) -dict assets/misspellings.csv -w
|
|
||||||
|
|
||||||
.PHONY: lint-go
|
|
||||||
lint-go: ## lint go files
|
|
||||||
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
|
|
||||||
|
|
||||||
.PHONY: lint-go-fix
|
|
||||||
lint-go-fix: ## lint go files and fix issues
|
|
||||||
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix
|
|
||||||
|
|
||||||
# workaround step for the lint-go-windows CI task because 'go run' can not
|
|
||||||
# have distinct GOOS/GOARCH for its build and run steps
|
|
||||||
.PHONY: lint-go-windows
|
|
||||||
lint-go-windows:
|
|
||||||
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
|
|
||||||
golangci-lint run
|
|
||||||
|
|
||||||
.PHONY: lint-editorconfig
|
|
||||||
lint-editorconfig:
|
|
||||||
@echo "Running editorconfig check..."
|
|
||||||
@$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) $(EDITORCONFIG_FILES)
|
|
||||||
|
|
||||||
.PHONY: lint-actions
|
|
||||||
lint-actions: ## lint action workflow files
|
|
||||||
$(GO) run $(ACTIONLINT_PACKAGE)
|
|
||||||
|
|
||||||
.PHONY: lint-templates
|
|
||||||
lint-templates: .venv node_modules ## lint template files
|
|
||||||
@node tools/lint-templates-svg.ts
|
|
||||||
@uv run --frozen djlint $(shell find templates -type f -iname '*.tmpl')
|
|
||||||
|
|
||||||
.PHONY: lint-yaml
|
|
||||||
lint-yaml: .venv ## lint yaml files
|
|
||||||
@uv run --frozen yamllint -s .
|
|
||||||
|
|
||||||
.PHONY: lint-json
|
|
||||||
lint-json: node_modules ## lint json files
|
|
||||||
pnpm exec eslint -c eslint.json.config.ts --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY)
|
|
||||||
|
|
||||||
.PHONY: lint-json-fix
|
|
||||||
lint-json-fix: node_modules ## lint and fix json files
|
|
||||||
pnpm exec eslint -c eslint.json.config.ts --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) --fix
|
|
||||||
|
|
||||||
.PHONY: watch
|
|
||||||
watch: ## watch everything and continuously rebuild
|
|
||||||
@bash tools/watch.sh
|
|
||||||
|
|
||||||
.PHONY: watch-frontend
|
|
||||||
watch-frontend: node_modules ## start vite dev server for frontend
|
|
||||||
NODE_ENV=development pnpm exec vite --logLevel $(FRONTEND_DEV_LOG_LEVEL)
|
|
||||||
|
|
||||||
.PHONY: watch-backend
|
|
||||||
watch-backend: ## watch backend files and continuously rebuild
|
|
||||||
GITEA_RUN_MODE=dev $(GO) run $(AIR_PACKAGE) -c .air.toml
|
|
||||||
|
|
||||||
.PHONY: test-backend
|
|
||||||
test-backend: ## test backend files
|
|
||||||
@echo "Running go test with $(GOTEST_FLAGS) -tags '$(TAGS)'..."
|
|
||||||
@$(GO) test $(GOTEST_FLAGS) -tags='$(TAGS)' $(GO_TEST_PACKAGES)
|
|
||||||
|
|
||||||
.PHONY: test-frontend
|
|
||||||
test-frontend: node_modules ## test frontend files
|
|
||||||
pnpm exec vitest
|
|
||||||
|
|
||||||
.PHONY: test-check
|
|
||||||
test-check:
|
|
||||||
@echo "Running test-check...";
|
|
||||||
@diff=$$(git status -s); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "make test-backend has changed files in the source tree:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
echo "You should change the tests to create these files in a temporary directory."; \
|
|
||||||
echo "Do not simply add these files to .gitignore"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
fi
|
||||||
|
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
|
||||||
|
|
||||||
.PHONY: test-backend\#%
|
.PHONY: test
|
||||||
test-backend\#%:
|
test:
|
||||||
@echo "Running go test with -tags '$(TAGS)'..."
|
for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
|
||||||
@$(GO) test $(GOTEST_FLAGS) -tags='$(TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES)
|
|
||||||
|
|
||||||
.PHONY: coverage
|
.PHONY: test-mysql
|
||||||
coverage:
|
test-mysql:
|
||||||
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' coverage.out > coverage-bodged.out
|
@echo "Not integrated yet!"
|
||||||
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' integration.coverage.out > integration.coverage-bodged.out
|
|
||||||
$(GO) run tools/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all
|
|
||||||
|
|
||||||
.PHONY: unit-test-coverage
|
.PHONY: test-pgsql
|
||||||
unit-test-coverage:
|
test-pgsql:
|
||||||
@echo "Running unit-test-coverage $(GOTEST_FLAGS) -tags '$(TAGS)'..."
|
@echo "Not integrated yet!"
|
||||||
@$(GO) test $(GOTEST_FLAGS) -tags='$(TAGS)' -cover -coverprofile coverage.out $(GO_TEST_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
|
||||||
|
|
||||||
.PHONY: tidy
|
.PHONY: check
|
||||||
tidy: ## run go mod tidy
|
check: test
|
||||||
$(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
|
|
||||||
$(GO) mod tidy -compat=$(MIN_GO_VERSION)
|
|
||||||
@$(MAKE) --no-print-directory $(GO_LICENSE_FILE)
|
|
||||||
|
|
||||||
vendor: go.mod go.sum
|
.PHONY: install
|
||||||
$(GO) mod vendor
|
install: $(wildcard *.go)
|
||||||
@touch vendor
|
go install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
|
||||||
|
|
||||||
.PHONY: tidy-check
|
|
||||||
tidy-check: tidy
|
|
||||||
@diff=$$(git diff --color=always go.mod go.sum $(GO_LICENSE_FILE)); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "Please run 'make tidy' and commit the result:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
.PHONY: go-licenses
|
|
||||||
go-licenses: $(GO_LICENSE_FILE) ## regenerate go licenses
|
|
||||||
|
|
||||||
$(GO_LICENSE_FILE): go.mod go.sum
|
|
||||||
GO=$(GO) $(GO) run build/generate-go-licenses.go $(GO_LICENSE_FILE)
|
|
||||||
|
|
||||||
.PHONY: test-integration
|
|
||||||
test-integration:
|
|
||||||
@# Use a compiled binary: testlogger forwards gitea logs to t.Log, so `go test -v`
|
|
||||||
@# would flood output per passing test. testcache can't help these tests anyway —
|
|
||||||
@# they mutate the work directory, so cache inputs change between runs.
|
|
||||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' -c code.gitea.io/gitea/tests/integration -o ./test-integration-$(GITEA_TEST_DATABASE).test
|
|
||||||
./test-integration-$(GITEA_TEST_DATABASE).test
|
|
||||||
|
|
||||||
.PHONY: test-integration\#%
|
|
||||||
test-integration\#%:
|
|
||||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' -run $(subst .,/,$*) code.gitea.io/gitea/tests/integration
|
|
||||||
|
|
||||||
.PHONY: test-migration
|
|
||||||
test-migration: migrations.integration.test migrations.individual.test
|
|
||||||
|
|
||||||
.PHONY: migrations.integration.test
|
|
||||||
migrations.integration.test:
|
|
||||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' code.gitea.io/gitea/tests/integration/migration-test
|
|
||||||
|
|
||||||
.PHONY: migrations.individual.test
|
|
||||||
migrations.individual.test:
|
|
||||||
@# tests of multiple packages use the same database, don't run in parallel
|
|
||||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES)
|
|
||||||
|
|
||||||
.PHONY: migrations.individual.test\#%
|
|
||||||
migrations.individual.test\#%:
|
|
||||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' code.gitea.io/gitea/models/migrations/$*
|
|
||||||
|
|
||||||
.PHONY: playwright
|
|
||||||
playwright: deps-frontend
|
|
||||||
@# on GitHub Actions VMs, playwright's system deps are pre-installed
|
|
||||||
@pnpm exec playwright install $(if $(GITHUB_ACTIONS),,--with-deps) chromium firefox $(PLAYWRIGHT_FLAGS)
|
|
||||||
|
|
||||||
.PHONY: test-e2e
|
|
||||||
test-e2e: playwright frontend backend
|
|
||||||
@EXECUTABLE=$(EXECUTABLE) ./tools/test-e2e.sh $(GITEA_TEST_E2E_FLAGS)
|
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: frontend backend ## build everything
|
build: $(EXECUTABLE)
|
||||||
|
|
||||||
.PHONY: frontend
|
$(EXECUTABLE): $(SOURCES)
|
||||||
frontend: $(FRONTEND_DEST) ## build frontend files
|
go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
||||||
.PHONY: backend
|
.PHONY: docker
|
||||||
backend: generate-backend $(EXECUTABLE) ## build backend files
|
docker:
|
||||||
|
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="$(TAGS)" webhippie/golang:edge make clean generate build
|
||||||
# We generate the backend before the frontend in case we in future we want to generate things in the frontend from generated files in backend
|
docker build -t gitea/gitea:latest .
|
||||||
.PHONY: generate
|
|
||||||
generate: generate-backend ## run "go generate"
|
|
||||||
|
|
||||||
.PHONY: generate-backend
|
|
||||||
generate-backend: $(TAGS_PREREQ) generate-go
|
|
||||||
|
|
||||||
.PHONY: generate-go
|
|
||||||
generate-go: $(TAGS_PREREQ)
|
|
||||||
@echo "Running go generate..."
|
|
||||||
@CC= GOOS= GOARCH= CGO_ENABLED=0 $(GO) generate -tags '$(TAGS)' ./...
|
|
||||||
|
|
||||||
.PHONY: security-check
|
|
||||||
security-check:
|
|
||||||
GOEXPERIMENT= go run $(GOVULNCHECK_PACKAGE) -show color ./... || true
|
|
||||||
|
|
||||||
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
|
||||||
ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),)
|
|
||||||
$(error pam support set via TAGS does not support static builds)
|
|
||||||
endif
|
|
||||||
CGO_ENABLED="$(CGO_ENABLED)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
|
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check
|
release: release-dirs release-build release-copy release-check
|
||||||
|
|
||||||
$(DIST_DIRS):
|
.PHONY: release-dirs
|
||||||
mkdir -p $(DIST_DIRS)
|
release-dirs:
|
||||||
|
mkdir -p $(DIST)/binaries $(DIST)/release
|
||||||
|
|
||||||
.PHONY: release-windows
|
.PHONY: release-build
|
||||||
release-windows: | $(DIST_DIRS)
|
release-build:
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
|
@which xgo > /dev/null; if [ $$? -ne 0 ]; then \
|
||||||
ifeq (,$(findstring gogit,$(TAGS)))
|
go get -u github.com/karalabe/xgo; \
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo gogit $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
|
fi
|
||||||
|
xgo -dest $(DIST)/binaries -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets '$(TARGETS)' -out $(EXECUTABLE)-$(VERSION) $(IMPORT)
|
||||||
|
ifeq ($(CI),drone)
|
||||||
|
mv /build/* $(DIST)/binaries
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: release-linux
|
|
||||||
release-linux: | $(DIST_DIRS)
|
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
|
|
||||||
|
|
||||||
.PHONY: release-darwin
|
|
||||||
release-darwin: | $(DIST_DIRS)
|
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
|
|
||||||
|
|
||||||
.PHONY: release-freebsd
|
|
||||||
release-freebsd: | $(DIST_DIRS)
|
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
|
|
||||||
|
|
||||||
.PHONY: release-copy
|
.PHONY: release-copy
|
||||||
release-copy: | $(DIST_DIRS)
|
release-copy:
|
||||||
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;
|
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
|
||||||
|
|
||||||
.PHONY: release-check
|
.PHONY: release-check
|
||||||
release-check: | $(DIST_DIRS)
|
release-check:
|
||||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
|
||||||
|
|
||||||
.PHONY: release-compress
|
.PHONY: javascripts
|
||||||
release-compress: | $(DIST_DIRS)
|
javascripts: public/js/index.js
|
||||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PACKAGE) -k -9 $${file}; done;
|
|
||||||
|
|
||||||
.PHONY: release-sources
|
.IGNORE: public/js/index.js
|
||||||
release-sources: | $(DIST_DIRS)
|
public/js/index.js: $(JAVASCRIPTS)
|
||||||
echo $(VERSION) > $(STORED_VERSION_FILE)
|
cat $< >| $@
|
||||||
# bsdtar needs a ^ to prevent matching subdirectories
|
|
||||||
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
|
|
||||||
# use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
|
|
||||||
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
|
|
||||||
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
|
|
||||||
rm -f $(STORED_VERSION_FILE)
|
|
||||||
|
|
||||||
.PHONY: deps
|
.PHONY: stylesheets
|
||||||
deps: deps-frontend deps-backend deps-tools deps-py ## install dependencies
|
stylesheets: public/css/index.css
|
||||||
|
|
||||||
.PHONY: deps-py
|
.IGNORE: public/css/index.css
|
||||||
deps-py: .venv ## install python dependencies
|
public/css/index.css: $(STYLESHEETS)
|
||||||
|
lessc $< $@
|
||||||
|
|
||||||
.PHONY: deps-frontend
|
.PHONY: assets
|
||||||
deps-frontend: node_modules ## install frontend dependencies
|
assets: javascripts stylesheets
|
||||||
|
|
||||||
.PHONY: deps-backend
|
|
||||||
deps-backend: ## install backend dependencies
|
|
||||||
$(GO) mod download
|
|
||||||
|
|
||||||
.PHONY: deps-tools
|
|
||||||
deps-tools: ## install tool dependencies
|
|
||||||
$(GO) install $(AIR_PACKAGE) & \
|
|
||||||
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE) & \
|
|
||||||
$(GO) install $(GOLANGCI_LINT_PACKAGE) & \
|
|
||||||
$(GO) install $(GXZ_PACKAGE) & \
|
|
||||||
$(GO) install $(MISSPELL_PACKAGE) & \
|
|
||||||
$(GO) install $(SWAGGER_PACKAGE) & \
|
|
||||||
$(GO) install $(XGO_PACKAGE) & \
|
|
||||||
$(GO) install $(GOVULNCHECK_PACKAGE) & \
|
|
||||||
$(GO) install $(ACTIONLINT_PACKAGE) & \
|
|
||||||
wait
|
|
||||||
|
|
||||||
node_modules: pnpm-lock.yaml
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
@touch node_modules
|
|
||||||
|
|
||||||
.venv: uv.lock
|
|
||||||
uv sync
|
|
||||||
@touch .venv
|
|
||||||
|
|
||||||
.PHONY: update
|
|
||||||
update: update-go update-js update-py ## update dependencies
|
|
||||||
|
|
||||||
.PHONY: update-go
|
|
||||||
update-go: ## update go dependencies
|
|
||||||
$(GO) get -u ./...
|
|
||||||
$(MAKE) tidy
|
|
||||||
|
|
||||||
.PHONY: update-js
|
|
||||||
update-js: node_modules ## update js dependencies
|
|
||||||
pnpm exec updates -u -f package.json
|
|
||||||
rm -rf node_modules pnpm-lock.yaml
|
|
||||||
pnpm install
|
|
||||||
@touch node_modules
|
|
||||||
$(MAKE) --no-print-directory nolyfill
|
|
||||||
|
|
||||||
.PHONY: nolyfill
|
|
||||||
nolyfill: node_modules ## apply nolyfill overrides to package.json and relock
|
|
||||||
pnpm exec nolyfill install
|
|
||||||
pnpm install
|
|
||||||
@touch node_modules
|
|
||||||
|
|
||||||
.PHONY: update-py
|
|
||||||
update-py: node_modules ## update py dependencies
|
|
||||||
pnpm exec updates -u -f pyproject.toml
|
|
||||||
rm -rf .venv uv.lock
|
|
||||||
uv sync
|
|
||||||
@touch .venv
|
|
||||||
|
|
||||||
.PHONY: vite
|
|
||||||
vite: $(FRONTEND_DEST) ## build vite files
|
|
||||||
|
|
||||||
$(FRONTEND_DEST): $(FRONTEND_SOURCES) $(FRONTEND_CONFIGS) pnpm-lock.yaml
|
|
||||||
@$(MAKE) -s node_modules
|
|
||||||
@rm -rf $(FRONTEND_DEST_ENTRIES)
|
|
||||||
@echo "Running vite build..."
|
|
||||||
@pnpm exec vite build
|
|
||||||
@touch $(FRONTEND_DEST)
|
|
||||||
|
|
||||||
.PHONY: svg
|
|
||||||
svg: node_modules ## build svg files
|
|
||||||
rm -rf $(SVG_DEST_DIR)
|
|
||||||
node tools/generate-svg.ts
|
|
||||||
|
|
||||||
.PHONY: svg-check
|
|
||||||
svg-check: svg
|
|
||||||
@git add $(SVG_DEST_DIR)
|
|
||||||
@diff=$$(git diff --color=always --cached $(SVG_DEST_DIR)); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
.PHONY: lockfile-check
|
|
||||||
lockfile-check:
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
@diff=$$(git diff --color=always pnpm-lock.yaml); \
|
|
||||||
if [ -n "$$diff" ]; then \
|
|
||||||
echo "pnpm-lock.yaml is inconsistent with package.json"; \
|
|
||||||
echo "Please run 'pnpm install --frozen-lockfile' and commit the result:"; \
|
|
||||||
printf "%s" "$${diff}"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
.PHONY: generate-gitignore
|
|
||||||
generate-gitignore: ## update gitignore files
|
|
||||||
$(GO) run build/generate-gitignores.go
|
|
||||||
|
|
||||||
.PHONY: generate-images
|
|
||||||
generate-images: | node_modules ## generate images
|
|
||||||
cd tools && node generate-images.ts $(TAGS)
|
|
||||||
|
|
||||||
.PHONY: generate-manpage
|
|
||||||
generate-manpage: ## generate manpage
|
|
||||||
@[ -f gitea ] || make backend
|
|
||||||
@mkdir -p man/man1/ man/man5
|
|
||||||
@./gitea docs --man > man/man1/gitea.1
|
|
||||||
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
|
|
||||||
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
|
|
||||||
|
|
||||||
# Disable parallel execution because it would break some targets that don't
|
|
||||||
# specify exact dependencies like 'backend' which does currently not depend
|
|
||||||
# on 'frontend' to enable Node.js-less builds from source tarballs.
|
|
||||||
.NOTPARALLEL:
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"folders":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name":"MokoGitea",
|
|
||||||
"path": ".",
|
|
||||||
"folder_exclude_patterns":
|
|
||||||
[
|
|
||||||
".git",
|
|
||||||
".claude/worktree"
|
|
||||||
],
|
|
||||||
"file_exclude_patterns":
|
|
||||||
[
|
|
||||||
"*.sublime-workspace"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name":"Workspace",
|
|
||||||
"path": "E:\Documents\Workspace",
|
|
||||||
"folder_exclude_patterns":
|
|
||||||
[
|
|
||||||
".git",
|
|
||||||
".claude/worktree"
|
|
||||||
],
|
|
||||||
"file_exclude_patterns":
|
|
||||||
[
|
|
||||||
"*.sublime-workspace"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name":"Scripts",
|
|
||||||
"path": "J:\Shared drives\Knowledgebase\Scripts",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,43 +1,46 @@
|
|||||||
# MokoGitea
|
[简体中文](https://github.com/go-gitea/gitea/blob/master/README_ZH.md)
|
||||||
|
|
||||||
Moko fork of Gitea — adding project board REST API endpoints and custom enhancements
|
# Gitea - Git with a cup of tea
|
||||||
|
|
||||||
  
|
[](http://drone.gitea.io/go-gitea/gitea)
|
||||||
|
[](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
[](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
|
||||||
|
[](https://coverage.gitea.io/go-gitea/gitea)
|
||||||
|
[](https://goreportcard.com/report/code.gitea.io/gitea)
|
||||||
|
[](https://godoc.org/code.gitea.io/gitea)
|
||||||
|
[](https://github.com/go-gitea/gitea/releases/latest)
|
||||||
|
|
||||||
|
||||
|
||||||
|
|:-------------:|:-------:|:-------:|
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
|
||||||
Custom Gitea fork with Project Board API
|
## Purpose
|
||||||
|
|
||||||
---
|
The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. With Go, this can be done with an independent binary distribution across **all platforms** that Go supports, including Linux, macOS, and Windows on x86, amd64, ARM and PowerPC architectures. Want to try it before doing anything else? Do it [online](https://try.gitea.io/)!
|
||||||
|
|
||||||
## Pages
|
## Notes
|
||||||
|
|
||||||
- [Branding](https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/wiki/Branding)
|
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
|
||||||
- [Deployment](https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/wiki/Deployment)
|
2. If you found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
|
||||||
- [Project API](Project API)
|
3. If you're interested in using our APIs, we have experimental support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
|
||||||
- [roadmap](https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/wiki/roadmap)
|
|
||||||
|
|
||||||
---
|
## Docs
|
||||||
|
|
||||||
**Category:** Infrastructure | **Platform:** [moko-platform wiki](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki)
|
For further information or instructions how to install Gitea please take a look at our [documentation](https://docs.gitea.io/en-us/), if you can not find some specific information just head over to our [Gitter](https://gitter.im/go-gitea/gitea) channel to have a chat with us.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
Full documentation is available on the [Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/wiki).
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
See the wiki for development guidelines and contribution instructions.
|
Fork -> Patch -> Push -> Pull Request
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
* [Maintainers](https://github.com/orgs/go-gitea/people)
|
||||||
|
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
|
||||||
|
* [Translators](options/locale/TRANSLATORS)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the GNU General Public License v3.0 or later -- see the [LICENSE](LICENSE) file.
|
This project is under the MIT License. See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file for the full license text.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*[Moko Consulting](https://mokoconsulting.tech) -- [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|||||||
-201
@@ -1,201 +0,0 @@
|
|||||||
# Gitea
|
|
||||||
|
|
||||||
[](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain "Release Nightly")
|
|
||||||
[](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
|
|
||||||
[](https://goreportcard.com/report/code.gitea.io/gitea "Go Report Card")
|
|
||||||
[](https://pkg.go.dev/code.gitea.io/gitea "GoDoc")
|
|
||||||
[](https://github.com/go-gitea/gitea/releases/latest "GitHub release")
|
|
||||||
[](https://www.codetriage.com/go-gitea/gitea "Help Contribute to Open Source")
|
|
||||||
[](https://opencollective.com/gitea "Become a backer/sponsor of gitea")
|
|
||||||
[](https://opensource.org/licenses/MIT "License: MIT")
|
|
||||||
[](https://translate.gitea.com "Crowdin")
|
|
||||||
|
|
||||||
[English](./README.md) | [繁體中文](./README.zh-tw.md)
|
|
||||||
|
|
||||||
## 目的
|
|
||||||
|
|
||||||
这个项目的目标是提供最简单、最快速、最无痛的方式来设置自托管的 Git 服务。
|
|
||||||
|
|
||||||
由于 Gitea 是用 Go 语言编写的,它可以在 Go 支持的所有平台和架构上运行,包括 Linux、macOS 和 Windows 的 x86、amd64、ARM 和 PowerPC 架构。这个项目自 2016 年 11 月从 [Gogs](https://gogs.io) [分叉](https://blog.gitea.com/welcome-to-gitea/) 而来,但已经有了很多变化。
|
|
||||||
|
|
||||||
在线演示可以访问 [demo.gitea.com](https://demo.gitea.com)。
|
|
||||||
|
|
||||||
要访问免费的 Gitea 服务(有一定数量的仓库限制),可以访问 [gitea.com](https://gitea.com/user/login)。
|
|
||||||
|
|
||||||
要快速部署您自己的专用 Gitea 实例,可以在 [cloud.gitea.com](https://cloud.gitea.com) 开始免费试用。
|
|
||||||
|
|
||||||
## 文件
|
|
||||||
|
|
||||||
您可以在我们的官方 [文件网站](https://docs.gitea.com/) 上找到全面的文件。
|
|
||||||
|
|
||||||
它包括安装、管理、使用、开发、贡献指南等,帮助您快速入门并有效地探索所有功能。
|
|
||||||
|
|
||||||
如果您有任何建议或想要贡献,可以访问 [文件仓库](https://gitea.com/gitea/docs)
|
|
||||||
|
|
||||||
## 构建
|
|
||||||
|
|
||||||
从源代码树的根目录运行:
|
|
||||||
|
|
||||||
TAGS="bindata" make build
|
|
||||||
|
|
||||||
`build` 目标分为两个子目标:
|
|
||||||
|
|
||||||
- `make backend` 需要 [Go Stable](https://go.dev/dl/),所需版本在 [go.mod](/go.mod) 中定义。
|
|
||||||
- `make frontend` 需要 [Node.js LTS](https://nodejs.org/en/download/) 或更高版本以及 [pnpm](https://pnpm.io/installation)。
|
|
||||||
|
|
||||||
需要互联网连接来下载 go 和 npm 模块。从包含预构建前端文件的官方源代码压缩包构建时,不会触发 `frontend` 目标,因此可以在没有 Node.js 的情况下构建。
|
|
||||||
|
|
||||||
更多信息:https://docs.gitea.com/installation/install-from-source
|
|
||||||
|
|
||||||
## 使用
|
|
||||||
|
|
||||||
构建后,默认情况下会在源代码树的根目录生成一个名为 `gitea` 的二进制文件。要运行它,请使用:
|
|
||||||
|
|
||||||
./gitea web
|
|
||||||
|
|
||||||
> [!注意]
|
|
||||||
> 如果您对使用我们的 API 感兴趣,我们提供了实验性支持,并附有 [文件](https://docs.gitea.com/api)。
|
|
||||||
|
|
||||||
## 贡献
|
|
||||||
|
|
||||||
预期的工作流程是:Fork -> Patch -> Push -> Pull Request
|
|
||||||
|
|
||||||
> [!注意]
|
|
||||||
>
|
|
||||||
> 1. **在开始进行 Pull Request 之前,您必须阅读 [贡献者指南](CONTRIBUTING.md)。**
|
|
||||||
> 2. 如果您在项目中发现了漏洞,请私下写信给 **security@gitea.io**。谢谢!
|
|
||||||
|
|
||||||
## 翻译
|
|
||||||
|
|
||||||
[](https://translate.gitea.com)
|
|
||||||
|
|
||||||
翻译通过 [Crowdin](https://translate.gitea.com) 进行。如果您想翻译成新的语言,请在 Crowdin 项目中请求管理员添加新语言。
|
|
||||||
|
|
||||||
您也可以创建一个 issue 来添加语言,或者在 discord 的 #translation 频道上询问。如果您需要上下文或发现一些翻译问题,可以在字符串上留言或在 Discord 上询问。对于一般的翻译问题,文档中有一个部分。目前有点空,但我们希望随着问题的出现而填充它。
|
|
||||||
|
|
||||||
更多信息请参阅 [文件](https://docs.gitea.com/contributing/localization)。
|
|
||||||
|
|
||||||
## 官方和第三方项目
|
|
||||||
|
|
||||||
我们提供了一个官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一个名为 [tea](https://gitea.com/gitea/tea) 的 CLI 工具和一个 Gitea Action 的 [action runner](https://gitea.com/gitea/act_runner)。
|
|
||||||
|
|
||||||
我们在 [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea) 维护了一个 Gitea 相关项目的列表,您可以在那里发现更多的第三方项目,包括 SDK、插件、主题等。
|
|
||||||
|
|
||||||
## 通讯
|
|
||||||
|
|
||||||
[](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
|
|
||||||
|
|
||||||
如果您有任何文件未涵盖的问题,可以在我们的 [Discord 服务器](https://discord.gg/Gitea) 上与我们联系,或者在 [discourse 论坛](https://forum.gitea.com/) 上创建帖子。
|
|
||||||
|
|
||||||
## 作者
|
|
||||||
|
|
||||||
- [维护者](https://github.com/orgs/go-gitea/people)
|
|
||||||
- [贡献者](https://github.com/go-gitea/gitea/graphs/contributors)
|
|
||||||
- [翻译者](options/locale/TRANSLATORS)
|
|
||||||
|
|
||||||
## 支持者
|
|
||||||
|
|
||||||
感谢所有支持者! 🙏 [[成为支持者](https://opencollective.com/gitea#backer)]
|
|
||||||
|
|
||||||
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
|
|
||||||
|
|
||||||
## 赞助商
|
|
||||||
|
|
||||||
通过成为赞助商来支持这个项目。您的标志将显示在这里,并带有链接到您的网站。 [[成为赞助商](https://opencollective.com/gitea#sponsor)]
|
|
||||||
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
|
|
||||||
|
|
||||||
## 常见问题
|
|
||||||
|
|
||||||
**Gitea 怎么发音?**
|
|
||||||
|
|
||||||
Gitea 的发音是 [/ɡɪ’ti:/](https://youtu.be/EM71-2uDAoY),就像 "gi-tea" 一样,g 是硬音。
|
|
||||||
|
|
||||||
**为什么这个项目没有托管在 Gitea 实例上?**
|
|
||||||
|
|
||||||
我们正在 [努力](https://github.com/go-gitea/gitea/issues/1029)。
|
|
||||||
|
|
||||||
**在哪里可以找到安全补丁?**
|
|
||||||
|
|
||||||
在 [发布日志](https://github.com/go-gitea/gitea/releases) 或 [变更日志](https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md) 中,搜索关键词 `SECURITY` 以找到安全补丁。
|
|
||||||
|
|
||||||
## 许可证
|
|
||||||
|
|
||||||
这个项目是根据 MIT 许可证授权的。
|
|
||||||
请参阅 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件以获取完整的许可证文本。
|
|
||||||
|
|
||||||
## 进一步信息
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>寻找界面概述?查看这里!</summary>
|
|
||||||
|
|
||||||
### 登录/注册页面
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 用户仪表板
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 用户资料
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 探索
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 仓库
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 仓库问题
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 仓库拉取请求
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 仓库操作
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 仓库活动
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 组织
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
</details>
|
|
||||||
-201
@@ -1,201 +0,0 @@
|
|||||||
# Gitea
|
|
||||||
|
|
||||||
[](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain "Release Nightly")
|
|
||||||
[](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
|
|
||||||
[](https://goreportcard.com/report/code.gitea.io/gitea "Go Report Card")
|
|
||||||
[](https://pkg.go.dev/code.gitea.io/gitea "GoDoc")
|
|
||||||
[](https://github.com/go-gitea/gitea/releases/latest "GitHub release")
|
|
||||||
[](https://www.codetriage.com/go-gitea/gitea "Help Contribute to Open Source")
|
|
||||||
[](https://opencollective.com/gitea "Become a backer/sponsor of gitea")
|
|
||||||
[](https://opensource.org/licenses/MIT "License: MIT")
|
|
||||||
[](https://translate.gitea.com "Crowdin")
|
|
||||||
|
|
||||||
[English](./README.md) | [简体中文](./README.zh-cn.md)
|
|
||||||
|
|
||||||
## 目的
|
|
||||||
|
|
||||||
這個項目的目標是提供最簡單、最快速、最無痛的方式來設置自託管的 Git 服務。
|
|
||||||
|
|
||||||
由於 Gitea 是用 Go 語言編寫的,它可以在 Go 支援的所有平台和架構上運行,包括 Linux、macOS 和 Windows 的 x86、amd64、ARM 和 PowerPC 架構。這個項目自 2016 年 11 月從 [Gogs](https://gogs.io) [分叉](https://blog.gitea.com/welcome-to-gitea/) 而來,但已經有了很多變化。
|
|
||||||
|
|
||||||
在線演示可以訪問 [demo.gitea.com](https://demo.gitea.com)。
|
|
||||||
|
|
||||||
要訪問免費的 Gitea 服務(有一定數量的倉庫限制),可以訪問 [gitea.com](https://gitea.com/user/login)。
|
|
||||||
|
|
||||||
要快速部署您自己的專用 Gitea 實例,可以在 [cloud.gitea.com](https://cloud.gitea.com) 開始免費試用。
|
|
||||||
|
|
||||||
## 文件
|
|
||||||
|
|
||||||
您可以在我們的官方 [文件網站](https://docs.gitea.com/) 上找到全面的文件。
|
|
||||||
|
|
||||||
它包括安裝、管理、使用、開發、貢獻指南等,幫助您快速入門並有效地探索所有功能。
|
|
||||||
|
|
||||||
如果您有任何建議或想要貢獻,可以訪問 [文件倉庫](https://gitea.com/gitea/docs)
|
|
||||||
|
|
||||||
## 構建
|
|
||||||
|
|
||||||
從源代碼樹的根目錄運行:
|
|
||||||
|
|
||||||
TAGS="bindata" make build
|
|
||||||
|
|
||||||
`build` 目標分為兩個子目標:
|
|
||||||
|
|
||||||
- `make backend` 需要 [Go Stable](https://go.dev/dl/),所需版本在 [go.mod](/go.mod) 中定義。
|
|
||||||
- `make frontend` 需要 [Node.js LTS](https://nodejs.org/en/download/) 或更高版本以及 [pnpm](https://pnpm.io/installation)。
|
|
||||||
|
|
||||||
需要互聯網連接來下載 go 和 npm 模塊。從包含預構建前端文件的官方源代碼壓縮包構建時,不會觸發 `frontend` 目標,因此可以在沒有 Node.js 的情況下構建。
|
|
||||||
|
|
||||||
更多信息:https://docs.gitea.com/installation/install-from-source
|
|
||||||
|
|
||||||
## 使用
|
|
||||||
|
|
||||||
構建後,默認情況下會在源代碼樹的根目錄生成一個名為 `gitea` 的二進制文件。要運行它,請使用:
|
|
||||||
|
|
||||||
./gitea web
|
|
||||||
|
|
||||||
> [!注意]
|
|
||||||
> 如果您對使用我們的 API 感興趣,我們提供了實驗性支援,並附有 [文件](https://docs.gitea.com/api)。
|
|
||||||
|
|
||||||
## 貢獻
|
|
||||||
|
|
||||||
預期的工作流程是:Fork -> Patch -> Push -> Pull Request
|
|
||||||
|
|
||||||
> [!注意]
|
|
||||||
>
|
|
||||||
> 1. **在開始進行 Pull Request 之前,您必須閱讀 [貢獻者指南](CONTRIBUTING.md)。**
|
|
||||||
> 2. 如果您在項目中發現了漏洞,請私下寫信給 **security@gitea.io**。謝謝!
|
|
||||||
|
|
||||||
## 翻譯
|
|
||||||
|
|
||||||
[](https://translate.gitea.com)
|
|
||||||
|
|
||||||
翻譯通過 [Crowdin](https://translate.gitea.com) 進行。如果您想翻譯成新的語言,請在 Crowdin 項目中請求管理員添加新語言。
|
|
||||||
|
|
||||||
您也可以創建一個 issue 來添加語言,或者在 discord 的 #translation 頻道上詢問。如果您需要上下文或發現一些翻譯問題,可以在字符串上留言或在 Discord 上詢問。對於一般的翻譯問題,文檔中有一個部分。目前有點空,但我們希望隨著問題的出現而填充它。
|
|
||||||
|
|
||||||
更多信息請參閱 [文件](https://docs.gitea.com/contributing/localization)。
|
|
||||||
|
|
||||||
## 官方和第三方項目
|
|
||||||
|
|
||||||
我們提供了一個官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一個名為 [tea](https://gitea.com/gitea/tea) 的 CLI 工具和一個 Gitea Action 的 [action runner](https://gitea.com/gitea/act_runner)。
|
|
||||||
|
|
||||||
我們在 [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea) 維護了一個 Gitea 相關項目的列表,您可以在那裡發現更多的第三方項目,包括 SDK、插件、主題等。
|
|
||||||
|
|
||||||
## 通訊
|
|
||||||
|
|
||||||
[](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
|
|
||||||
|
|
||||||
如果您有任何文件未涵蓋的問題,可以在我們的 [Discord 服務器](https://discord.gg/Gitea) 上與我們聯繫,或者在 [discourse 論壇](https://forum.gitea.com/) 上創建帖子。
|
|
||||||
|
|
||||||
## 作者
|
|
||||||
|
|
||||||
- [維護者](https://github.com/orgs/go-gitea/people)
|
|
||||||
- [貢獻者](https://github.com/go-gitea/gitea/graphs/contributors)
|
|
||||||
- [翻譯者](options/locale/TRANSLATORS)
|
|
||||||
|
|
||||||
## 支持者
|
|
||||||
|
|
||||||
感謝所有支持者! 🙏 [[成為支持者](https://opencollective.com/gitea#backer)]
|
|
||||||
|
|
||||||
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
|
|
||||||
|
|
||||||
## 贊助商
|
|
||||||
|
|
||||||
通過成為贊助商來支持這個項目。您的標誌將顯示在這裡,並帶有鏈接到您的網站。 [[成為贊助商](https://opencollective.com/gitea#sponsor)]
|
|
||||||
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
|
|
||||||
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
|
|
||||||
|
|
||||||
## 常見問題
|
|
||||||
|
|
||||||
**Gitea 怎麼發音?**
|
|
||||||
|
|
||||||
Gitea 的發音是 [/ɡɪ’ti:/](https://youtu.be/EM71-2uDAoY),就像 "gi-tea" 一樣,g 是硬音。
|
|
||||||
|
|
||||||
**為什麼這個項目沒有託管在 Gitea 實例上?**
|
|
||||||
|
|
||||||
我們正在 [努力](https://github.com/go-gitea/gitea/issues/1029)。
|
|
||||||
|
|
||||||
**在哪裡可以找到安全補丁?**
|
|
||||||
|
|
||||||
在 [發佈日誌](https://github.com/go-gitea/gitea/releases) 或 [變更日誌](https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md) 中,搜索關鍵詞 `SECURITY` 以找到安全補丁。
|
|
||||||
|
|
||||||
## 許可證
|
|
||||||
|
|
||||||
這個項目是根據 MIT 許可證授權的。
|
|
||||||
請參閱 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件以獲取完整的許可證文本。
|
|
||||||
|
|
||||||
## 進一步信息
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>尋找界面概述?查看這裡!</summary>
|
|
||||||
|
|
||||||
### 登錄/註冊頁面
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 用戶儀表板
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 用戶資料
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 探索
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 倉庫
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 倉庫問題
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 倉庫拉取請求
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 倉庫操作
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
#### 倉庫活動
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
### 組織
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
</details>
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
[English](https://github.com/go-gitea/gitea/blob/master/README.md)
|
||||||
|
|
||||||
|
# Gitea - Git with a cup of tea
|
||||||
|
|
||||||
|
[](http://drone.gitea.io/go-gitea/gitea)
|
||||||
|
[](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
[](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
|
||||||
|
[](https://coverage.gitea.io/go-gitea/gitea)
|
||||||
|
[](https://goreportcard.com/report/code.gitea.io/gitea)
|
||||||
|
[](https://godoc.org/code.gitea.io/gitea)
|
||||||
|
[](https://github.com/go-gitea/gitea/releases/latest)
|
||||||
|
|
||||||
|
||||
|
||||||
|
|:-------------:|:-------:|:-------:|
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
||||
|
||||||
|
|
||||||
|
## 目标
|
||||||
|
|
||||||
|
Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了x86,amd64,还包括 ARM 和 PowerPC。
|
||||||
|
|
||||||
|
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)!
|
||||||
|
|
||||||
|
## 提示
|
||||||
|
|
||||||
|
1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**.
|
||||||
|
2. 所有的安全问题,请私下发送邮件给 **security@gitea.io**。谢谢!
|
||||||
|
3. 如果你要使用API,请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea).
|
||||||
|
|
||||||
|
## 文档
|
||||||
|
|
||||||
|
关于如何安装请访问我们的 [文档站](https://docs.gitea.io/zh-cn/),如果没有找到对应的文档,你也可以通过 [Gitter - 英文](https://gitter.im/go-gitea/gitea) 和 QQ群 328432459 来和我们交流。
|
||||||
|
|
||||||
|
## 贡献流程
|
||||||
|
|
||||||
|
Fork -> Patch -> Push -> Pull Request
|
||||||
|
|
||||||
|
## 作者
|
||||||
|
|
||||||
|
* [Maintainers](https://github.com/orgs/go-gitea/people)
|
||||||
|
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
|
||||||
|
* [Translators](options/locale/TRANSLATORS)
|
||||||
|
|
||||||
|
## 授权许可
|
||||||
|
|
||||||
|
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) 文件中。
|
||||||
-85
@@ -1,85 +0,0 @@
|
|||||||
# Reporting security issues
|
|
||||||
|
|
||||||
The Gitea maintainers take security seriously.
|
|
||||||
|
|
||||||
If you discover a security issue, please bring it to their attention right away!
|
|
||||||
|
|
||||||
Previous vulnerabilities are listed at https://about.gitea.com/security.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`.
|
|
||||||
|
|
||||||
## Protecting Security Information
|
|
||||||
|
|
||||||
Due to the sensitive nature of security information, you can use the below GPG public key to encrypt your mail body.
|
|
||||||
|
|
||||||
The PGP key is valid until July 4, 2026.
|
|
||||||
|
|
||||||
```
|
|
||||||
Key ID: 6FCD2D5B
|
|
||||||
Key Type: RSA
|
|
||||||
Expires: 7/4/2026
|
|
||||||
Key Size: 4096/4096
|
|
||||||
Fingerprint: 3DE0 3D1E 144A 7F06 9359 99DC AAFD 2381 6FCD 2D5B
|
|
||||||
```
|
|
||||||
|
|
||||||
UserID: Gitea Security <security@gitea.io>
|
|
||||||
|
|
||||||
```
|
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
|
|
||||||
mQINBGK1Z/4BEADFMqXA9DeeChmSxUjF0Be5sq99ZUhgrZjcN/wOzz0wuCJZC0l8
|
|
||||||
4uC+d6mfv7JpJYlzYzOK97/x5UguKHkYNZ6mm1G9KHaXmoIBDLKDzfPdJopVNv2r
|
|
||||||
OajijaE0uMCnMjadlg5pbhMLRQG8a9J32yyaz7ZEAw72Ab31fvvcA53NkuqO4j2w
|
|
||||||
k7dtFQzhbNOYV0VffQT90WDZdalYHB1JHyEQ+70U9OjVD5ggNYSzX98Eu3Hjn7V7
|
|
||||||
kqFrcAxr5TE1elf0IXJcuBJtFzQSTUGlQldKOHtGTGgGjj9r/FFAE5ioBgVD05bV
|
|
||||||
rEEgIMM/GqYaG/nbNpWE6P3mEc2Mnn3pZaRJL0LuF26TLjnqEcMMDp5iIhLdFzXR
|
|
||||||
3tMdtKgQFu+Mtzs3ipwWARYgHyU09RJsI2HeBx7RmZO/Xqrec763Z7zdJ7SpCn0Z
|
|
||||||
q+pHZl24JYR0Kf3T/ZiOC0cGd2QJqpJtg5J6S/OqfX9NH6MsCczO8pUC1N/aHH2X
|
|
||||||
CTme2nF56izORqDWKoiICteL3GpYsCV9nyCidcCmoQsS+DKvE86YhIhVIVWGRY2F
|
|
||||||
lzpAjnN9/KLtQroutrm+Ft0mdjDiJUeFVl1cOHDhoyfCsQh62HumoyZoZvqzQd6e
|
|
||||||
AbN11nq6aViMe2Q3je1AbiBnRnQSHxt1Tc8X4IshO3MQK1Sk7oPI6LA5oQARAQAB
|
|
||||||
tCJHaXRlYSBTZWN1cml0eSA8c2VjdXJpdHlAZ2l0ZWEuaW8+iQJXBBMBCABBAhsD
|
|
||||||
BQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAFiEEPeA9HhRKfwaTWZncqv0jgW/N
|
|
||||||
LVsFAmhoHmkFCQeT6esACgkQqv0jgW/NLVuFLRAAmjBQSKRAgs2bFIEj7HLAbDp4
|
|
||||||
f+XkdH+GsT3jRPOZ9QZgmtM+TfoE4yNgIVfOl+s4RdjM/W4QzqZuPQ55hbEHd056
|
|
||||||
cJmm7B+6GsHFcdrPmh65sOCEIyh4+t45dUfeWpFsDPqm9j1UHXAJQIpB8vDEVAPH
|
|
||||||
t+3wLCk8GMPJs1o5tIyMmaO23ngvkwn8eG7KgY+rp2PzObrb5g7ppci0ILzILkrp
|
|
||||||
HVjZsEfUWRgSVF7LuU5ppqDKrlcqwUpQq6n3kGMZcLrCp6ACKP04TBmTfUxNwdL7
|
|
||||||
I0N7apI2Pbct9T1Gv/lYAUFWyU2c3gh/EBLbO6BukaLOFRQHrtNfdJV/YnMPlcXr
|
|
||||||
LUJjK9K4eAH9DsrZqrisz/LthsC2BaNIN3KRMTk5YTYgmIh8GXzSgihORmtDFELC
|
|
||||||
RroID3pTuS0zjXh+wpY9GuPTh7UW23p42Daxca4fAT4k5EclvDRUrL21xMopPMiL
|
|
||||||
HuNdELz4FVchRTy05PjzKVyjVInDNojE2KUxnjxZDzYJ6aT/g+coD5yfntYm8BEj
|
|
||||||
+ZzL0ndZES54hzKLpv7zwBQwFzam68clZYmDPILOPTflQDfpGEWmJK4undFU5obz
|
|
||||||
ZsQRz0R3ulspChATbZxO0d5LX2obLpKO9X3b5VoO1KF+R8Vjw1Y0KxrNZ6rIcfqH
|
|
||||||
Z50QVQKSe9dm08K0ON+5Ag0EYrVn/gEQALrFLQjCR3GjuHSindz0rd3Fnx/t7Sen
|
|
||||||
T+p07yCSSoSlmnJHCQmwh4vfg1blyz0zZ4vkIhtpHsEgc+ZAG+WQXSsJ2iRz+eSN
|
|
||||||
GwoOQl4XC3n+QWkc1ws+btr48+6UqXIQU+F8TPQyx/PIgi2nZXJB7f5+mjCqsk46
|
|
||||||
XvH4nTr4kJjuqMSR/++wvre2qNQRa/q/dTsK0OaN/mJsdX6Oi+aGNaQJUhIG7F+E
|
|
||||||
ZDMkn/O6xnwWNzy/+bpg43qH/Gk0eakOmz5NmQLRkV58SZLiJvuCUtkttf6CyhnX
|
|
||||||
03OcWaajv5W8qA39dBYQgDrrPbBWUnwfO3yMveqhwV4JjDoe8sPAyn1NwzakNYqP
|
|
||||||
RzsWyLrLS7R7J9s3FkZXhQw/QQcsaSMcGNQO047dm1P83N8JY5aEpiRo9zSWjoiw
|
|
||||||
qoExANj5lUTZPe8M50lI182FrcjAN7dClO3QI6pg7wy0erMxfFly3j8UQ91ysS9T
|
|
||||||
s+GsP9I3cmWWQcKYxWHtE8xTXnNCVPFZQj2nwhJzae8ypfOtulBRA3dUKWGKuDH/
|
|
||||||
axFENhUsT397aOU3qkP/od4a64JyNIEo4CTTSPVeWd7njsGqli2U3A4xL2CcyYvt
|
|
||||||
D/MWcMBGEoLSNTswwKdom4FaJpn5KThnK/T0bQcmJblJhoCtppXisbexZnCpuS0x
|
|
||||||
Zdlm2T14KJ3LABEBAAGJAjwEGAEIACYCGwwWIQQ94D0eFEp/BpNZmdyq/SOBb80t
|
|
||||||
WwUCaGgeJAUJB5PppgAKCRCq/SOBb80tW/NWEACB6Jrf0gWlk7e+hNCdnbM0ZVWU
|
|
||||||
f2sHNFfXxxsdhpcDgKbNHtkZb8nZgv8AX+5fTtUwMVa3vKcdw30xFiIM5N7cCIPV
|
|
||||||
vg/5z5BtfEaitnabEUG2iiVDIy8IHXIcK10rX+7BosA3QDl2PsiBHwyi5G13lRk8
|
|
||||||
zGTSNDuOalug33h5/lr2dPigamkq74Aoy29q8Rjad6GfWHipL2bFimgtY+Zdi0BH
|
|
||||||
NLk4EJXxj1SgVx5dtkQzWJReBA5M+FQ4QYQZBO+f4TDoOLmjui152uhkoLBQbGAa
|
|
||||||
WWJFTVxm0bG5MXloEL3gA8DfU7XDwuW/sHJC5pBko8RpQViooOhckMepZV3Y83DK
|
|
||||||
bwLYa3JmPgj2rEv4993dvrJbQhpGd082HOxOsllCs8pgNq1SnXpWYfcGTgGKC3ts
|
|
||||||
U8YZUUJUQ7mi2L8Tv3ix20c9EiGmA30JAmA8eZTC3cWup91ZkkVBFRml2czTXajd
|
|
||||||
RWZ6GbHV5503ueDQcB8yBVgF3CSixs67+dGSbD3p86OqGrjAcJzM5TFbNKcnGLdE
|
|
||||||
kGbZpNwAISy750lXzXKmyrh5RTCeTOQerbwCMBvHZO+HAevA/LXDTw2OAiSIQlP5
|
|
||||||
sYA4sFYLQ30OAkgJcmdp/pSgVj/erNtSN07ClrOpDb/uFpQymO6K2h0Pst3feNVK
|
|
||||||
9M2VbqL9C51z/wyHLg==
|
|
||||||
=SfZA
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it.
|
|
||||||
-11483
File diff suppressed because it is too large
Load Diff
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
|
||||||
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
|
|
||||||
<g>
|
|
||||||
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
|
|
||||||
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
|
|
||||||
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
|
|
||||||
<g>
|
|
||||||
<g>
|
|
||||||
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
|
|
||||||
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
|
|
||||||
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
|
|
||||||
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
|
|
||||||
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
|
|
||||||
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
|
|
||||||
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
|
|
||||||
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
|
|
||||||
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
|
|
||||||
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
|
|
||||||
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
|
|
||||||
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
|
|
||||||
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
|
|
||||||
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
|
|
||||||
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
|
|
||||||
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
|
|
||||||
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
|
|
||||||
C343.2,346.5,335,363.3,326.8,380.1z"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB |
File diff suppressed because one or more lines are too long
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
|
||||||
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
|
|
||||||
<g>
|
|
||||||
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
|
|
||||||
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
|
|
||||||
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
|
|
||||||
<g>
|
|
||||||
<g>
|
|
||||||
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
|
|
||||||
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
|
|
||||||
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
|
|
||||||
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
|
|
||||||
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
|
|
||||||
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
|
|
||||||
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
|
|
||||||
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
|
|
||||||
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
|
|
||||||
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
|
|
||||||
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
|
|
||||||
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
|
|
||||||
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
|
|
||||||
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
|
|
||||||
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
|
|
||||||
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
|
|
||||||
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
|
|
||||||
C343.2,346.5,335,363.3,326.8,380.1z"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1,21 +0,0 @@
|
|||||||
acounts,accounts
|
|
||||||
canidate,candidate
|
|
||||||
comfirm,confirm
|
|
||||||
converage,coverage
|
|
||||||
currrently,currently
|
|
||||||
delimeter,delimiter
|
|
||||||
differrent,different
|
|
||||||
exclusing,excluding
|
|
||||||
finshed,finished
|
|
||||||
formated,formatted
|
|
||||||
inderect,indirect
|
|
||||||
insuficient,insufficient
|
|
||||||
likly,likely
|
|
||||||
mergable,mergeable
|
|
||||||
overrided,overridden
|
|
||||||
priortized,prioritized
|
|
||||||
registeration,registration
|
|
||||||
reuqest,request
|
|
||||||
reviwer,reviewer
|
|
||||||
superceded,superseded
|
|
||||||
underlaying,underlying
|
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
//go:build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/assetfs"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
if len(os.Args) != 3 {
|
|
||||||
fmt.Println("usage: ./generate-bindata {local-directory} {bindata-filename}")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
dir, filename := os.Args[1], os.Args[2]
|
|
||||||
fmt.Printf("generating bindata for %s to %s\n", dir, filename)
|
|
||||||
if err := assetfs.GenerateEmbedBindata(dir, filename); err != nil {
|
|
||||||
fmt.Printf("failed: %s\n", err.Error())
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
||||||
// Copyright 2015 Kenneth Shaw
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
//go:build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"flag"
|
|
||||||
"fmt"
|
|
||||||
"go/format"
|
|
||||||
"io"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"regexp"
|
|
||||||
"sort"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"unicode/utf8"
|
|
||||||
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/json"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
gemojiURL = "https://raw.githubusercontent.com/rhysd/gemoji/537ff2d7e0496e9964824f7f73ec7ece88c9765a/db/emoji.json"
|
|
||||||
maxUnicodeVersion = 16
|
|
||||||
)
|
|
||||||
|
|
||||||
var flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")
|
|
||||||
|
|
||||||
// Gemoji is a set of emoji data.
|
|
||||||
type Gemoji []Emoji
|
|
||||||
|
|
||||||
// Emoji represents a single emoji and associated data.
|
|
||||||
type Emoji struct {
|
|
||||||
Emoji string `json:"emoji"`
|
|
||||||
Description string `json:"description,omitempty"`
|
|
||||||
Aliases []string `json:"aliases"`
|
|
||||||
UnicodeVersion string `json:"unicode_version,omitempty"`
|
|
||||||
SkinTones bool `json:"skin_tones,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't include some fields in JSON
|
|
||||||
func (e Emoji) MarshalJSON() ([]byte, error) {
|
|
||||||
type emoji Emoji
|
|
||||||
x := emoji(e)
|
|
||||||
x.UnicodeVersion = ""
|
|
||||||
x.Description = ""
|
|
||||||
x.SkinTones = false
|
|
||||||
return json.Marshal(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
// generate data
|
|
||||||
buf, err := generate()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("generate err: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// write
|
|
||||||
err = os.WriteFile(*flagOut, buf, 0o644)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("WriteFile err: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var replacer = strings.NewReplacer(
|
|
||||||
"main.Gemoji", "Gemoji",
|
|
||||||
"main.Emoji", "\n",
|
|
||||||
"}}", "},\n}",
|
|
||||||
", Description:", ", ",
|
|
||||||
", Aliases:", ", ",
|
|
||||||
", UnicodeVersion:", ", ",
|
|
||||||
", SkinTones:", ", ",
|
|
||||||
)
|
|
||||||
|
|
||||||
var emojiRE = regexp.MustCompile(`\{Emoji:"([^"]*)"`)
|
|
||||||
|
|
||||||
func generate() ([]byte, error) {
|
|
||||||
// load gemoji data
|
|
||||||
res, err := http.Get(gemojiURL)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer res.Body.Close()
|
|
||||||
|
|
||||||
// read all
|
|
||||||
body, err := io.ReadAll(res.Body)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// unmarshal
|
|
||||||
var data Gemoji
|
|
||||||
err = json.Unmarshal(body, &data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
skinTones := make(map[string]string)
|
|
||||||
|
|
||||||
skinTones["\U0001f3fb"] = "Light Skin Tone"
|
|
||||||
skinTones["\U0001f3fc"] = "Medium-Light Skin Tone"
|
|
||||||
skinTones["\U0001f3fd"] = "Medium Skin Tone"
|
|
||||||
skinTones["\U0001f3fe"] = "Medium-Dark Skin Tone"
|
|
||||||
skinTones["\U0001f3ff"] = "Dark Skin Tone"
|
|
||||||
|
|
||||||
var tmp Gemoji
|
|
||||||
|
|
||||||
// filter out emoji that require greater than max unicode version
|
|
||||||
for i := range data {
|
|
||||||
val, _ := strconv.ParseFloat(data[i].UnicodeVersion, 64)
|
|
||||||
if int(val) <= maxUnicodeVersion {
|
|
||||||
tmp = append(tmp, data[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data = tmp
|
|
||||||
|
|
||||||
sort.Slice(data, func(i, j int) bool {
|
|
||||||
return data[i].Aliases[0] < data[j].Aliases[0]
|
|
||||||
})
|
|
||||||
|
|
||||||
aliasMap := make(map[string]int, len(data))
|
|
||||||
|
|
||||||
for i, e := range data {
|
|
||||||
if e.Emoji == "" || len(e.Aliases) == 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, a := range e.Aliases {
|
|
||||||
if a == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
aliasMap[a] = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// gitea customizations
|
|
||||||
i, ok := aliasMap["tada"]
|
|
||||||
if ok {
|
|
||||||
data[i].Aliases = append(data[i].Aliases, "hooray")
|
|
||||||
}
|
|
||||||
i, ok = aliasMap["laughing"]
|
|
||||||
if ok {
|
|
||||||
data[i].Aliases = append(data[i].Aliases, "laugh")
|
|
||||||
}
|
|
||||||
|
|
||||||
// write a JSON file to use with tribute (write before adding skin tones since we can't support them there yet)
|
|
||||||
file, _ := json.MarshalIndent(data, "", " ")
|
|
||||||
_ = os.WriteFile("assets/emoji.json", append(file, '\n'), 0o644)
|
|
||||||
|
|
||||||
// Add skin tones to emoji that support it
|
|
||||||
var (
|
|
||||||
s []string
|
|
||||||
newEmoji string
|
|
||||||
newDescription string
|
|
||||||
newData Emoji
|
|
||||||
)
|
|
||||||
|
|
||||||
for i := range data {
|
|
||||||
if data[i].SkinTones {
|
|
||||||
for k, v := range skinTones {
|
|
||||||
s = strings.Split(data[i].Emoji, "")
|
|
||||||
|
|
||||||
if utf8.RuneCountInString(data[i].Emoji) == 1 {
|
|
||||||
s = append(s, k)
|
|
||||||
} else {
|
|
||||||
// insert into slice after first element because all emoji that support skin tones
|
|
||||||
// have that modifier placed at this spot
|
|
||||||
s = append(s, "")
|
|
||||||
copy(s[2:], s[1:])
|
|
||||||
s[1] = k
|
|
||||||
}
|
|
||||||
|
|
||||||
newEmoji = strings.Join(s, "")
|
|
||||||
newDescription = data[i].Description + ": " + v
|
|
||||||
newAlias := data[i].Aliases[0] + "_" + strings.ReplaceAll(v, " ", "_")
|
|
||||||
|
|
||||||
newData = Emoji{newEmoji, newDescription, []string{newAlias}, "12.0", false}
|
|
||||||
data = append(data, newData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(data, func(i, j int) bool {
|
|
||||||
return data[i].Aliases[0] < data[j].Aliases[0]
|
|
||||||
})
|
|
||||||
|
|
||||||
// add header
|
|
||||||
str := replacer.Replace(fmt.Sprintf(hdr, gemojiURL, data))
|
|
||||||
|
|
||||||
// change the format of the unicode string
|
|
||||||
str = emojiRE.ReplaceAllStringFunc(str, func(s string) string {
|
|
||||||
var err error
|
|
||||||
s, err = strconv.Unquote(s[len("{Emoji:"):])
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return "{" + strconv.QuoteToASCII(s)
|
|
||||||
})
|
|
||||||
|
|
||||||
// format
|
|
||||||
return format.Source([]byte(str))
|
|
||||||
}
|
|
||||||
|
|
||||||
const hdr = `
|
|
||||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
|
|
||||||
package emoji
|
|
||||||
|
|
||||||
// Code generated by build/generate-emoji.go. DO NOT EDIT.
|
|
||||||
// Sourced from %s
|
|
||||||
var GemojiData = %#v
|
|
||||||
`
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
//go:build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"archive/tar"
|
|
||||||
"compress/gzip"
|
|
||||||
"flag"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"path"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
var (
|
|
||||||
prefix = "gitea-gitignore"
|
|
||||||
url = "https://api.github.com/repos/github/gitignore/tarball"
|
|
||||||
githubApiToken = ""
|
|
||||||
githubUsername = ""
|
|
||||||
destination = ""
|
|
||||||
)
|
|
||||||
|
|
||||||
flag.StringVar(&destination, "dest", "options/gitignore/", "destination for the gitignores")
|
|
||||||
flag.StringVar(&githubUsername, "username", "", "github username")
|
|
||||||
flag.StringVar(&githubApiToken, "token", "", "github api token")
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
file, err := os.CreateTemp(os.TempDir(), prefix)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to create temp file. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
defer util.Remove(file.Name())
|
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to download archive. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(githubApiToken) > 0 && len(githubUsername) > 0 {
|
|
||||||
req.SetBasicAuth(githubUsername, githubApiToken)
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to download archive. %s", err)
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if _, err := io.Copy(file, resp.Body); err != nil {
|
|
||||||
log.Fatalf("Failed to copy archive to file. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := file.Seek(0, 0); err != nil {
|
|
||||||
log.Fatalf("Failed to reset seek on archive. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
gz, err := gzip.NewReader(file)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to gunzip the archive. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
tr := tar.NewReader(gz)
|
|
||||||
|
|
||||||
filesToCopy := make(map[string]string, 0)
|
|
||||||
|
|
||||||
for {
|
|
||||||
hdr, err := tr.Next()
|
|
||||||
|
|
||||||
if err == io.EOF {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to iterate archive. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if filepath.Ext(hdr.Name) != ".gitignore" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if hdr.Typeflag == tar.TypeSymlink {
|
|
||||||
fmt.Printf("Found symlink %s -> %s\n", hdr.Name, hdr.Linkname)
|
|
||||||
filesToCopy[strings.TrimSuffix(filepath.Base(hdr.Name), ".gitignore")] = strings.TrimSuffix(filepath.Base(hdr.Linkname), ".gitignore")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := os.Create(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".gitignore")))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to create new file. %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
defer out.Close()
|
|
||||||
|
|
||||||
if _, err := io.Copy(out, tr); err != nil {
|
|
||||||
log.Fatalf("Failed to write new file. %s", err)
|
|
||||||
} else {
|
|
||||||
fmt.Printf("Written %s\n", out.Name())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for dst, src := range filesToCopy {
|
|
||||||
// Read all content of src to data
|
|
||||||
src = path.Join(destination, src)
|
|
||||||
data, err := os.ReadFile(src)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to read src file. %s", err)
|
|
||||||
}
|
|
||||||
// Write data to dst
|
|
||||||
dst = path.Join(destination, dst)
|
|
||||||
err = os.WriteFile(dst, data, 0o644)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed to write new file. %s", err)
|
|
||||||
}
|
|
||||||
fmt.Printf("Written (copy of %s) %s\n", src, dst)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("Done")
|
|
||||||
}
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
//go:build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
|
||||||
"regexp"
|
|
||||||
"slices"
|
|
||||||
"sort"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// regexp is based on go-license, excluding README and NOTICE
|
|
||||||
// https://github.com/google/go-licenses/blob/master/licenses/find.go
|
|
||||||
// also defined in vite.config.ts
|
|
||||||
var licenseRe = regexp.MustCompile(`^(?i)((UN)?LICEN(S|C)E|COPYING).*$`)
|
|
||||||
|
|
||||||
// primaryLicenseRe matches exact primary license filenames without suffixes.
|
|
||||||
// When a directory has both primary and variant files (e.g. LICENSE and
|
|
||||||
// LICENSE.docs), only the primary files are kept.
|
|
||||||
var primaryLicenseRe = regexp.MustCompile(`^(?i)(LICEN[SC]E|COPYING)$`)
|
|
||||||
|
|
||||||
// ignoredNames are LicenseEntry.Name values to exclude from the output.
|
|
||||||
var ignoredNames = map[string]bool{
|
|
||||||
"code.gitea.io/gitea": true,
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/options/license": true,
|
|
||||||
}
|
|
||||||
|
|
||||||
var excludedExt = map[string]bool{
|
|
||||||
".gitignore": true,
|
|
||||||
".go": true,
|
|
||||||
".mod": true,
|
|
||||||
".sum": true,
|
|
||||||
".toml": true,
|
|
||||||
".yaml": true,
|
|
||||||
".yml": true,
|
|
||||||
}
|
|
||||||
|
|
||||||
type ModuleInfo struct {
|
|
||||||
Path string
|
|
||||||
Dir string
|
|
||||||
PkgDirs []string // directories of packages imported from this module
|
|
||||||
}
|
|
||||||
|
|
||||||
type LicenseEntry struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Path string `json:"path"`
|
|
||||||
LicenseText string `json:"licenseText"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// getModules returns all dependency modules with their local directory paths
|
|
||||||
// and the package directories used from each module.
|
|
||||||
func getModules(goCmd string) []ModuleInfo {
|
|
||||||
cmd := exec.Command(goCmd, "list", "-deps", "-f",
|
|
||||||
"{{if .Module}}{{.Module.Path}}\t{{.Module.Dir}}\t{{.Dir}}{{end}}", "./...")
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
// Use GOOS=linux with CGO to ensure we capture all platform-specific
|
|
||||||
// dependencies, matching the CI environment.
|
|
||||||
cmd.Env = append(os.Environ(), "GOOS=linux", "GOARCH=amd64", "CGO_ENABLED=1")
|
|
||||||
output, err := cmd.Output()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "failed to run 'go list -deps': %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
var modules []ModuleInfo
|
|
||||||
seen := make(map[string]int) // module path -> index in modules
|
|
||||||
for _, line := range strings.Split(string(output), "\n") {
|
|
||||||
line = strings.TrimSpace(line)
|
|
||||||
if line == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
parts := strings.Split(line, "\t")
|
|
||||||
if len(parts) != 3 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
modPath, modDir, pkgDir := parts[0], parts[1], parts[2]
|
|
||||||
if idx, ok := seen[modPath]; ok {
|
|
||||||
modules[idx].PkgDirs = append(modules[idx].PkgDirs, pkgDir)
|
|
||||||
} else {
|
|
||||||
seen[modPath] = len(modules)
|
|
||||||
modules = append(modules, ModuleInfo{
|
|
||||||
Path: modPath,
|
|
||||||
Dir: modDir,
|
|
||||||
PkgDirs: []string{pkgDir},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return modules
|
|
||||||
}
|
|
||||||
|
|
||||||
// findLicenseFiles scans a module's root directory and its used package
|
|
||||||
// directories for license files. It also walks up from each package directory
|
|
||||||
// to the module root, scanning intermediate directories. Subdirectory licenses
|
|
||||||
// are only included if their text differs from the root license(s).
|
|
||||||
func findLicenseFiles(mod ModuleInfo) []LicenseEntry {
|
|
||||||
var entries []LicenseEntry
|
|
||||||
seenTexts := make(map[string]bool)
|
|
||||||
|
|
||||||
// First, collect root-level license files.
|
|
||||||
entries = append(entries, scanDirForLicenses(mod.Dir, mod.Path, "")...)
|
|
||||||
for _, e := range entries {
|
|
||||||
seenTexts[e.LicenseText] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Then check each package directory and all intermediate parent directories
|
|
||||||
// up to the module root for license files with unique text.
|
|
||||||
seenDirs := map[string]bool{mod.Dir: true}
|
|
||||||
for _, pkgDir := range mod.PkgDirs {
|
|
||||||
for dir := pkgDir; dir != mod.Dir && strings.HasPrefix(dir, mod.Dir); dir = filepath.Dir(dir) {
|
|
||||||
if seenDirs[dir] {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
seenDirs[dir] = true
|
|
||||||
for _, e := range scanDirForLicenses(dir, mod.Path, mod.Dir) {
|
|
||||||
if !seenTexts[e.LicenseText] {
|
|
||||||
seenTexts[e.LicenseText] = true
|
|
||||||
entries = append(entries, e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return entries
|
|
||||||
}
|
|
||||||
|
|
||||||
// scanDirForLicenses reads a single directory for license files and returns entries.
|
|
||||||
// If moduleRoot is non-empty, paths are made relative to it.
|
|
||||||
func scanDirForLicenses(dir, modulePath, moduleRoot string) []LicenseEntry {
|
|
||||||
dirEntries, err := os.ReadDir(dir)
|
|
||||||
if err != nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var entries []LicenseEntry
|
|
||||||
for _, entry := range dirEntries {
|
|
||||||
if entry.IsDir() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
name := entry.Name()
|
|
||||||
if !licenseRe.MatchString(name) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if excludedExt[strings.ToLower(filepath.Ext(name))] {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
content, err := os.ReadFile(filepath.Join(dir, name))
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
entryName := modulePath
|
|
||||||
entryPath := modulePath + "/" + name
|
|
||||||
if moduleRoot != "" {
|
|
||||||
rel, _ := filepath.Rel(moduleRoot, dir)
|
|
||||||
if rel != "." {
|
|
||||||
relSlash := filepath.ToSlash(rel)
|
|
||||||
entryName = modulePath + "/" + relSlash
|
|
||||||
entryPath = modulePath + "/" + relSlash + "/" + name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
entries = append(entries, LicenseEntry{
|
|
||||||
Name: entryName,
|
|
||||||
Path: entryPath,
|
|
||||||
LicenseText: string(content),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// When multiple license files exist, prefer primary files (e.g. LICENSE)
|
|
||||||
// over variants with suffixes (e.g. LICENSE.docs, LICENSE-2.0.txt).
|
|
||||||
// If no primary file exists, keep only the first variant.
|
|
||||||
if len(entries) > 1 {
|
|
||||||
var primary []LicenseEntry
|
|
||||||
for _, e := range entries {
|
|
||||||
fileName := e.Path[strings.LastIndex(e.Path, "/")+1:]
|
|
||||||
if primaryLicenseRe.MatchString(fileName) {
|
|
||||||
primary = append(primary, e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(primary) > 0 {
|
|
||||||
return primary
|
|
||||||
}
|
|
||||||
return entries[:1]
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
if len(os.Args) != 2 {
|
|
||||||
fmt.Println("usage: go run generate-go-licenses.go <out-json-file>")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
out := os.Args[1]
|
|
||||||
|
|
||||||
goCmd := "go"
|
|
||||||
if env := os.Getenv("GO"); env != "" {
|
|
||||||
goCmd = env
|
|
||||||
}
|
|
||||||
|
|
||||||
modules := getModules(goCmd)
|
|
||||||
|
|
||||||
var entries []LicenseEntry
|
|
||||||
for _, mod := range modules {
|
|
||||||
entries = append(entries, findLicenseFiles(mod)...)
|
|
||||||
}
|
|
||||||
|
|
||||||
entries = slices.DeleteFunc(entries, func(e LicenseEntry) bool {
|
|
||||||
return ignoredNames[e.Name]
|
|
||||||
})
|
|
||||||
|
|
||||||
sort.Slice(entries, func(i, j int) bool {
|
|
||||||
return entries[i].Path < entries[j].Path
|
|
||||||
})
|
|
||||||
|
|
||||||
jsonBytes, err := json.MarshalIndent(entries, "", " ")
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure file has a final newline
|
|
||||||
if jsonBytes[len(jsonBytes)-1] != '\n' {
|
|
||||||
jsonBytes = append(jsonBytes, '\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
err = os.WriteFile(out, jsonBytes, 0o644)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
// generate-openapi converts Gitea's Swagger 2.0 spec into an OpenAPI 3.0 spec.
|
|
||||||
//
|
|
||||||
// Gitea generates a Swagger 2.0 spec from code annotations (make generate-swagger).
|
|
||||||
// This tool converts it to OAS3 so that SDK generators and tools that require
|
|
||||||
// OAS3 (e.g. progenitor for Rust) can consume it directly. The conversion also
|
|
||||||
// deduplicates inline enum definitions into named schema components, producing
|
|
||||||
// cleaner SDK output with proper enum types instead of anonymous strings.
|
|
||||||
//
|
|
||||||
// Run: go run build/generate-openapi.go
|
|
||||||
// Output: templates/swagger/v1_openapi3_json.tmpl
|
|
||||||
|
|
||||||
//go:build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"regexp"
|
|
||||||
"sort"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/build/openapi3gen"
|
|
||||||
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
swaggerSpecPath = "templates/swagger/v1_json.tmpl"
|
|
||||||
openapi3OutPath = "templates/swagger/v1_openapi3_json.tmpl"
|
|
||||||
|
|
||||||
appSubUrlVar = "{{.SwaggerAppSubUrl}}"
|
|
||||||
appVerVar = "{{.SwaggerAppVer}}"
|
|
||||||
appNameVar = "{{.SwaggerAppName}}"
|
|
||||||
|
|
||||||
appSubUrlPlaceholder = "GITEA_APP_SUB_URL_PLACEHOLDER"
|
|
||||||
appVerPlaceholder = "0.0.0-gitea-placeholder"
|
|
||||||
appNamePlaceholder = "GiteaAppNamePlaceholder"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
appSubUrlRe = regexp.MustCompile(regexp.QuoteMeta(appSubUrlVar))
|
|
||||||
appVerRe = regexp.MustCompile(regexp.QuoteMeta(appVerVar))
|
|
||||||
appNameRe = regexp.MustCompile(regexp.QuoteMeta(appNameVar))
|
|
||||||
|
|
||||||
enumScanDirs = []string{
|
|
||||||
"modules/structs",
|
|
||||||
"modules/commitstatus",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
astEnumMap, err := openapi3gen.ScanSwaggerEnumTypes(enumScanDirs)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("scanning swagger:enum annotations: %v", err)
|
|
||||||
}
|
|
||||||
names := make([]string, 0, len(astEnumMap))
|
|
||||||
for _, n := range astEnumMap {
|
|
||||||
names = append(names, n)
|
|
||||||
}
|
|
||||||
sort.Strings(names)
|
|
||||||
fmt.Fprintf(os.Stderr, "discovered %d swagger:enum types: %s\n", len(names), strings.Join(names, ", "))
|
|
||||||
|
|
||||||
data, err := os.ReadFile(swaggerSpecPath)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("reading swagger spec: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
cleaned := appSubUrlRe.ReplaceAll(data, []byte(appSubUrlPlaceholder))
|
|
||||||
cleaned = appVerRe.ReplaceAll(cleaned, []byte(appVerPlaceholder))
|
|
||||||
cleaned = appNameRe.ReplaceAll(cleaned, []byte(appNamePlaceholder))
|
|
||||||
|
|
||||||
oas3, err := openapi3gen.Convert(cleaned, astEnumMap)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("converting to openapi 3.0: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
oas3.Servers = openapi3.Servers{
|
|
||||||
{URL: appSubUrlPlaceholder + "/api/v1"},
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := json.MarshalIndent(oas3, "", " ")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("marshaling openapi 3.0: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
result := strings.ReplaceAll(string(out), appSubUrlPlaceholder, appSubUrlVar)
|
|
||||||
result = strings.ReplaceAll(result, appVerPlaceholder, appVerVar)
|
|
||||||
result = strings.ReplaceAll(result, appNamePlaceholder, appNameVar)
|
|
||||||
result = strings.TrimSpace(result)
|
|
||||||
|
|
||||||
if err := os.WriteFile(openapi3OutPath, []byte(result), 0o644); err != nil {
|
|
||||||
log.Fatalf("writing openapi 3.0 spec: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("Generated %s\n", openapi3OutPath)
|
|
||||||
}
|
|
||||||
@@ -1,281 +0,0 @@
|
|||||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package openapi3gen
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"regexp"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/json"
|
|
||||||
|
|
||||||
"github.com/getkin/kin-openapi/openapi2"
|
|
||||||
"github.com/getkin/kin-openapi/openapi2conv"
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
|
||||||
)
|
|
||||||
|
|
||||||
// rxDeprecated matches "deprecated" as a word at the start of a description
|
|
||||||
// or preceded by whitespace/punctuation that indicates a leading marker (e.g.
|
|
||||||
// "Deprecated: true", "deprecated (use X instead)"). Rejects negated phrases
|
|
||||||
// like "not deprecated" or "previously deprecated, now supported".
|
|
||||||
var rxDeprecated = regexp.MustCompile(`(?i)(?:^|[\n.;])\s*deprecated\b`)
|
|
||||||
|
|
||||||
// Convert parses a Swagger 2.0 spec and returns an OAS3 spec, applying
|
|
||||||
// Gitea-specific post-processing: file-schema fixups, URI formats,
|
|
||||||
// deprecated flags, and shared-enum extraction.
|
|
||||||
//
|
|
||||||
// astEnumMap is a value-set-key → Go-type-name map (built by
|
|
||||||
// ScanSwaggerEnumTypes). If a shared enum in the spec has no entry in the
|
|
||||||
// map, Convert returns an error — no fallback naming.
|
|
||||||
func Convert(swaggerJSON []byte, astEnumMap map[string]string) (*openapi3.T, error) {
|
|
||||||
var swagger2 openapi2.T
|
|
||||||
if err := json.Unmarshal(swaggerJSON, &swagger2); err != nil {
|
|
||||||
return nil, fmt.Errorf("parsing swagger 2.0: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
oas3, err := openapi2conv.ToV3(&swagger2)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("converting to openapi 3.0: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fixFileSchemas(oas3)
|
|
||||||
addURIFormats(oas3)
|
|
||||||
addDeprecatedFlags(oas3)
|
|
||||||
if err := extractSharedEnums(oas3, astEnumMap); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return oas3, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func fixFileSchemas(doc *openapi3.T) {
|
|
||||||
for _, pathItem := range doc.Paths.Map() {
|
|
||||||
for _, op := range []*openapi3.Operation{
|
|
||||||
pathItem.Get, pathItem.Post, pathItem.Put, pathItem.Patch,
|
|
||||||
pathItem.Delete, pathItem.Head, pathItem.Options, pathItem.Trace,
|
|
||||||
} {
|
|
||||||
if op == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, resp := range op.Responses.Map() {
|
|
||||||
if resp.Value == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, mediaType := range resp.Value.Content {
|
|
||||||
fixSchema(mediaType.Schema)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if op.RequestBody != nil && op.RequestBody.Value != nil {
|
|
||||||
for _, mediaType := range op.RequestBody.Value.Content {
|
|
||||||
fixSchema(mediaType.Schema)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// fixSchema rewrites any "type: file" schemas to the OAS3 equivalent
|
|
||||||
// (type: string, format: binary), recursing into Properties, Items, and
|
|
||||||
// AllOf/OneOf/AnyOf/Not branches. $ref nodes are skipped so shared schemas
|
|
||||||
// are rewritten exactly once when visited through their declaration.
|
|
||||||
func fixSchema(ref *openapi3.SchemaRef) {
|
|
||||||
if ref == nil || ref.Value == nil || ref.Ref != "" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
s := ref.Value
|
|
||||||
if s.Type.Is("file") {
|
|
||||||
s.Type = &openapi3.Types{"string"}
|
|
||||||
s.Format = "binary"
|
|
||||||
}
|
|
||||||
for _, p := range s.Properties {
|
|
||||||
fixSchema(p)
|
|
||||||
}
|
|
||||||
fixSchema(s.Items)
|
|
||||||
for _, sub := range s.AllOf {
|
|
||||||
fixSchema(sub)
|
|
||||||
}
|
|
||||||
for _, sub := range s.OneOf {
|
|
||||||
fixSchema(sub)
|
|
||||||
}
|
|
||||||
for _, sub := range s.AnyOf {
|
|
||||||
fixSchema(sub)
|
|
||||||
}
|
|
||||||
fixSchema(s.Not)
|
|
||||||
}
|
|
||||||
|
|
||||||
// addURIFormats sets format: uri on string properties whose names indicate
|
|
||||||
// they hold URLs. This information is lost in Swagger 2.0 but is valuable
|
|
||||||
// for code generators.
|
|
||||||
func addURIFormats(doc *openapi3.T) {
|
|
||||||
if doc.Components == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, schemaRef := range doc.Components.Schemas {
|
|
||||||
if schemaRef.Value == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for propName, propRef := range schemaRef.Value.Properties {
|
|
||||||
if propRef == nil || propRef.Value == nil || propRef.Ref != "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
prop := propRef.Value
|
|
||||||
if !prop.Type.Is("string") || prop.Format != "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if isURLProperty(propName) {
|
|
||||||
prop.Format = "uri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func isURLProperty(name string) bool {
|
|
||||||
if strings.HasSuffix(name, "_url") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
switch name {
|
|
||||||
case "url", "html_url", "clone_url":
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// addDeprecatedFlags sets deprecated: true on schema properties whose
|
|
||||||
// description starts with a "deprecated" marker (e.g. "Deprecated: true"
|
|
||||||
// or "deprecated (use X instead)"). Does not match negated phrases.
|
|
||||||
func addDeprecatedFlags(doc *openapi3.T) {
|
|
||||||
if doc.Components == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, schemaRef := range doc.Components.Schemas {
|
|
||||||
if schemaRef.Value == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, propRef := range schemaRef.Value.Properties {
|
|
||||||
if propRef == nil || propRef.Value == nil || propRef.Ref != "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if rxDeprecated.MatchString(propRef.Value.Description) {
|
|
||||||
propRef.Value.Deprecated = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type enumUsage struct {
|
|
||||||
schemaName string
|
|
||||||
propName string
|
|
||||||
propRef *openapi3.SchemaRef
|
|
||||||
inItems bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// extractSharedEnums finds identical enum arrays used by multiple schema
|
|
||||||
// properties, creates a standalone named schema for each, and replaces
|
|
||||||
// the inline enums with $ref pointers.
|
|
||||||
//
|
|
||||||
// If the derived enum name collides with an existing component schema, or
|
|
||||||
// no // swagger:enum annotation matches the value set, generation aborts
|
|
||||||
// with an actionable error — there are no silent fallbacks.
|
|
||||||
func extractSharedEnums(doc *openapi3.T, astEnumMap map[string]string) error {
|
|
||||||
if doc.Components == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
enumGroups := map[string][]enumUsage{}
|
|
||||||
|
|
||||||
for schemaName, schemaRef := range doc.Components.Schemas {
|
|
||||||
if schemaRef.Value == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for propName, propRef := range schemaRef.Value.Properties {
|
|
||||||
if propRef == nil || propRef.Value == nil || propRef.Ref != "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if len(propRef.Value.Enum) > 1 && propRef.Value.Type.Is("string") {
|
|
||||||
key := EnumKey(propRef.Value.Enum)
|
|
||||||
enumGroups[key] = append(enumGroups[key], enumUsage{schemaName, propName, propRef, false})
|
|
||||||
}
|
|
||||||
if propRef.Value.Type.Is("array") && propRef.Value.Items != nil &&
|
|
||||||
propRef.Value.Items.Value != nil && propRef.Value.Items.Ref == "" &&
|
|
||||||
len(propRef.Value.Items.Value.Enum) > 1 && propRef.Value.Items.Value.Type.Is("string") {
|
|
||||||
key := EnumKey(propRef.Value.Items.Value.Enum)
|
|
||||||
enumGroups[key] = append(enumGroups[key], enumUsage{schemaName, propName, propRef, true})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for key, usages := range enumGroups {
|
|
||||||
if len(usages) < 2 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
enumName, err := deriveEnumName(key, usages, astEnumMap)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, exists := doc.Components.Schemas[enumName]; exists {
|
|
||||||
return fmt.Errorf("enum name collision: %s already exists as a component schema", enumName)
|
|
||||||
}
|
|
||||||
|
|
||||||
var enumValues []any
|
|
||||||
if usages[0].inItems {
|
|
||||||
enumValues = usages[0].propRef.Value.Items.Value.Enum
|
|
||||||
} else {
|
|
||||||
enumValues = usages[0].propRef.Value.Enum
|
|
||||||
}
|
|
||||||
|
|
||||||
doc.Components.Schemas[enumName] = &openapi3.SchemaRef{
|
|
||||||
Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"string"},
|
|
||||||
Enum: enumValues,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
ref := "#/components/schemas/" + enumName
|
|
||||||
|
|
||||||
for _, usage := range usages {
|
|
||||||
if usage.inItems {
|
|
||||||
usage.propRef.Value.Items = &openapi3.SchemaRef{Ref: ref}
|
|
||||||
} else {
|
|
||||||
old := usage.propRef.Value
|
|
||||||
if old.Description == "" && !old.Deprecated && old.Format == "" {
|
|
||||||
usage.propRef.Ref = ref
|
|
||||||
usage.propRef.Value = nil
|
|
||||||
} else {
|
|
||||||
usage.propRef.Value = &openapi3.Schema{
|
|
||||||
AllOf: openapi3.SchemaRefs{
|
|
||||||
{Ref: ref},
|
|
||||||
},
|
|
||||||
Description: old.Description,
|
|
||||||
Deprecated: old.Deprecated,
|
|
||||||
Format: old.Format,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// deriveEnumName looks up a shared enum's Go type name from astEnumMap by
|
|
||||||
// value-set key. If no annotation matches, returns an error identifying the
|
|
||||||
// offending properties and the fix.
|
|
||||||
func deriveEnumName(key string, usages []enumUsage, astEnumMap map[string]string) (string, error) {
|
|
||||||
if name, ok := astEnumMap[key]; ok {
|
|
||||||
return name, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
props := map[string]bool{}
|
|
||||||
for _, u := range usages {
|
|
||||||
props[fmt.Sprintf("%s.%s", u.schemaName, u.propName)] = true
|
|
||||||
}
|
|
||||||
propList := make([]string, 0, len(props))
|
|
||||||
for p := range props {
|
|
||||||
propList = append(propList, p)
|
|
||||||
}
|
|
||||||
return "", fmt.Errorf(
|
|
||||||
"no swagger:enum annotation matches value-set %q used by %d properties: %v; "+
|
|
||||||
"fix by adding a named string type with // swagger:enum to modules/structs or modules/commitstatus",
|
|
||||||
key, len(usages), propList,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package openapi3gen
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestDeriveEnumName_hit(t *testing.T) {
|
|
||||||
key := EnumKey([]any{"red", "green", "blue"})
|
|
||||||
astMap := map[string]string{key: "Color"}
|
|
||||||
usages := []enumUsage{{schemaName: "Paint", propName: "color"}}
|
|
||||||
got, err := deriveEnumName(key, usages, astMap)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected error: %v", err)
|
|
||||||
}
|
|
||||||
if got != "Color" {
|
|
||||||
t.Fatalf("got %q, want %q", got, "Color")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDeriveEnumName_miss(t *testing.T) {
|
|
||||||
key := EnumKey([]any{"x", "y"})
|
|
||||||
usages := []enumUsage{{schemaName: "Thing", propName: "kind"}}
|
|
||||||
_, err := deriveEnumName(key, usages, map[string]string{})
|
|
||||||
if err == nil {
|
|
||||||
t.Fatal("expected miss error, got nil")
|
|
||||||
}
|
|
||||||
msg := err.Error()
|
|
||||||
if !strings.Contains(msg, "Thing.kind") {
|
|
||||||
t.Fatalf("error %q should list the missing usage", msg)
|
|
||||||
}
|
|
||||||
if !strings.Contains(msg, "swagger:enum") {
|
|
||||||
t.Fatalf("error %q should hint at the fix", msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestExtractSharedEnums_usesASTMap(t *testing.T) {
|
|
||||||
doc := &openapi3.T{
|
|
||||||
Components: &openapi3.Components{
|
|
||||||
Schemas: openapi3.Schemas{
|
|
||||||
"A": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"object"},
|
|
||||||
Properties: openapi3.Schemas{
|
|
||||||
"color": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"string"},
|
|
||||||
Enum: []any{"red", "green", "blue"},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
"B": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"object"},
|
|
||||||
Properties: openapi3.Schemas{
|
|
||||||
"color": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"string"},
|
|
||||||
Enum: []any{"red", "green", "blue"},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
astMap := map[string]string{EnumKey([]any{"red", "green", "blue"}): "Color"}
|
|
||||||
if err := extractSharedEnums(doc, astMap); err != nil {
|
|
||||||
t.Fatalf("extractSharedEnums: %v", err)
|
|
||||||
}
|
|
||||||
if _, ok := doc.Components.Schemas["Color"]; !ok {
|
|
||||||
t.Fatalf("expected Color schema to be extracted")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestFixFileSchemas_recursesIntoNested(t *testing.T) {
|
|
||||||
fileType := func() *openapi3.SchemaRef {
|
|
||||||
return &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"file"}}}
|
|
||||||
}
|
|
||||||
doc := &openapi3.T{
|
|
||||||
Paths: openapi3.NewPaths(),
|
|
||||||
}
|
|
||||||
doc.Paths.Set("/upload", &openapi3.PathItem{
|
|
||||||
Post: &openapi3.Operation{
|
|
||||||
RequestBody: &openapi3.RequestBodyRef{
|
|
||||||
Value: &openapi3.RequestBody{
|
|
||||||
Content: openapi3.Content{
|
|
||||||
"multipart/form-data": {
|
|
||||||
Schema: &openapi3.SchemaRef{Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"object"},
|
|
||||||
Properties: openapi3.Schemas{
|
|
||||||
"attachment": fileType(),
|
|
||||||
"items": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"array"},
|
|
||||||
Items: fileType(),
|
|
||||||
}},
|
|
||||||
"alt": {Value: &openapi3.Schema{
|
|
||||||
AllOf: openapi3.SchemaRefs{fileType()},
|
|
||||||
}},
|
|
||||||
"one": {Value: &openapi3.Schema{
|
|
||||||
OneOf: openapi3.SchemaRefs{fileType()},
|
|
||||||
}},
|
|
||||||
"any": {Value: &openapi3.Schema{
|
|
||||||
AnyOf: openapi3.SchemaRefs{fileType()},
|
|
||||||
}},
|
|
||||||
"not": {Value: &openapi3.Schema{
|
|
||||||
Not: fileType(),
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Responses: openapi3.NewResponses(),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
fixFileSchemas(doc)
|
|
||||||
|
|
||||||
props := doc.Paths.Value("/upload").Post.RequestBody.Value.Content["multipart/form-data"].Schema.Value.Properties
|
|
||||||
if !props["attachment"].Value.Type.Is("string") || props["attachment"].Value.Format != "binary" {
|
|
||||||
t.Errorf("nested property not fixed: %+v", props["attachment"].Value)
|
|
||||||
}
|
|
||||||
if !props["items"].Value.Items.Value.Type.Is("string") || props["items"].Value.Items.Value.Format != "binary" {
|
|
||||||
t.Errorf("array items not fixed: %+v", props["items"].Value.Items.Value)
|
|
||||||
}
|
|
||||||
if !props["alt"].Value.AllOf[0].Value.Type.Is("string") || props["alt"].Value.AllOf[0].Value.Format != "binary" {
|
|
||||||
t.Errorf("allOf branch not fixed: %+v", props["alt"].Value.AllOf[0].Value)
|
|
||||||
}
|
|
||||||
if !props["one"].Value.OneOf[0].Value.Type.Is("string") || props["one"].Value.OneOf[0].Value.Format != "binary" {
|
|
||||||
t.Errorf("oneOf branch not fixed: %+v", props["one"].Value.OneOf[0].Value)
|
|
||||||
}
|
|
||||||
if !props["any"].Value.AnyOf[0].Value.Type.Is("string") || props["any"].Value.AnyOf[0].Value.Format != "binary" {
|
|
||||||
t.Errorf("anyOf branch not fixed: %+v", props["any"].Value.AnyOf[0].Value)
|
|
||||||
}
|
|
||||||
if !props["not"].Value.Not.Value.Type.Is("string") || props["not"].Value.Not.Value.Format != "binary" {
|
|
||||||
t.Errorf("not branch not fixed: %+v", props["not"].Value.Not.Value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestExtractSharedEnums_missReturnsError(t *testing.T) {
|
|
||||||
doc := &openapi3.T{
|
|
||||||
Components: &openapi3.Components{
|
|
||||||
Schemas: openapi3.Schemas{
|
|
||||||
"A": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"object"},
|
|
||||||
Properties: openapi3.Schemas{
|
|
||||||
"color": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"string"},
|
|
||||||
Enum: []any{"red", "green"},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
"B": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"object"},
|
|
||||||
Properties: openapi3.Schemas{
|
|
||||||
"color": {Value: &openapi3.Schema{
|
|
||||||
Type: &openapi3.Types{"string"},
|
|
||||||
Enum: []any{"red", "green"},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
if err := extractSharedEnums(doc, map[string]string{}); err == nil {
|
|
||||||
t.Fatal("expected miss error")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user