Skip to content

Commit 7f37f64

Browse files
authored
Merge branch 'main' into uitweaks2
2 parents f418e14 + 0ab9b7f commit 7f37f64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+621
-4689
lines changed

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Gitea DevContainer",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.20",
4+
"features": {
5+
// installs nodejs into container
6+
"ghcr.io/devcontainers/features/node:1": {
7+
"version":"20"
8+
}
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"settings": {},
13+
// same extensions as Gitpod, should match /.gitpod.yml
14+
"extensions": [
15+
"editorconfig.editorconfig",
16+
"dbaeumer.vscode-eslint",
17+
"golang.go",
18+
"stylelint.vscode-stylelint",
19+
"DavidAnson.vscode-markdownlint",
20+
"Vue.volar",
21+
"ms-azuretools.vscode-docker",
22+
"zixuanchen.vitest-explorer",
23+
"alexcvzz.vscode-sqlite"
24+
]
25+
}
26+
},
27+
"portsAttributes": {
28+
"3000": {
29+
"label": "Gitea Web",
30+
"onAutoForward": "notify"
31+
}
32+
},
33+
"postCreateCommand": "make deps"
34+
}

.drone.yml

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,3 @@
1-
---
2-
kind: pipeline
3-
type: docker
4-
name: release-latest
5-
6-
platform:
7-
os: linux
8-
arch: amd64
9-
10-
workspace:
11-
base: /source
12-
path: /
13-
14-
trigger:
15-
branch:
16-
- main
17-
- "release/*"
18-
event:
19-
- push
20-
paths:
21-
exclude:
22-
- "docs/**"
23-
24-
volumes:
25-
- name: deps
26-
temp: {}
27-
28-
steps:
29-
- name: fetch-tags
30-
image: docker:git
31-
pull: always
32-
commands:
33-
- git fetch --tags --force
34-
35-
- name: deps-frontend
36-
image: node:20
37-
pull: always
38-
commands:
39-
- make deps-frontend
40-
41-
- name: deps-backend
42-
image: gitea/test_env:linux-1.20-amd64
43-
pull: always
44-
commands:
45-
- make deps-backend
46-
volumes:
47-
- name: deps
48-
path: /go
49-
50-
- name: static
51-
image: techknowlogick/xgo:go-1.20.x
52-
pull: always
53-
commands:
54-
# Upgrade to node 20 once https://github.com/techknowlogick/xgo/issues/163 is resolved
55-
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
56-
- export PATH=$PATH:$GOPATH/bin
57-
- make release
58-
environment:
59-
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
60-
TAGS: bindata sqlite sqlite_unlock_notify
61-
DEBIAN_FRONTEND: noninteractive
62-
volumes:
63-
- name: deps
64-
path: /go
65-
66-
- name: gpg-sign
67-
image: plugins/gpgsign:1
68-
pull: always
69-
settings:
70-
detach_sign: true
71-
excludes:
72-
- "dist/release/*.sha256"
73-
files:
74-
- "dist/release/*"
75-
environment:
76-
GPGSIGN_KEY:
77-
from_secret: gpgsign_key
78-
GPGSIGN_PASSPHRASE:
79-
from_secret: gpgsign_passphrase
80-
81-
- name: release-branch
82-
image: woodpeckerci/plugin-s3:latest
83-
pull: always
84-
settings:
85-
acl:
86-
from_secret: aws_s3_acl
87-
region:
88-
from_secret: aws_s3_region
89-
bucket:
90-
from_secret: aws_s3_bucket
91-
endpoint:
92-
from_secret: aws_s3_endpoint
93-
path_style:
94-
from_secret: aws_s3_path_style
95-
source: "dist/release/*"
96-
strip_prefix: dist/release/
97-
target: "/gitea/${DRONE_BRANCH##release/v}"
98-
environment:
99-
AWS_ACCESS_KEY_ID:
100-
from_secret: aws_access_key_id
101-
AWS_SECRET_ACCESS_KEY:
102-
from_secret: aws_secret_access_key
103-
when:
104-
branch:
105-
- "release/*"
106-
event:
107-
- push
108-
109-
- name: release-main
110-
image: woodpeckerci/plugin-s3:latest
111-
settings:
112-
acl:
113-
from_secret: aws_s3_acl
114-
region:
115-
from_secret: aws_s3_region
116-
bucket:
117-
from_secret: aws_s3_bucket
118-
endpoint:
119-
from_secret: aws_s3_endpoint
120-
path_style:
121-
from_secret: aws_s3_path_style
122-
source: "dist/release/*"
123-
strip_prefix: dist/release/
124-
target: /gitea/main
125-
environment:
126-
AWS_ACCESS_KEY_ID:
127-
from_secret: aws_access_key_id
128-
AWS_SECRET_ACCESS_KEY:
129-
from_secret: aws_secret_access_key
130-
when:
131-
branch:
132-
- main
133-
event:
134-
- push
135-
1361
---
1372
kind: pipeline
1383
name: release-version

.github/workflows/cron-licenses.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: cron-licenses
33
on:
44
schedule:
55
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
6+
workflow_dispatch:
67

78
jobs:
89
cron-licenses:

.github/workflows/cron-translations.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: cron-translations
33
on:
44
schedule:
55
- cron: "7 0 * * *" # every day at 00:07 UTC
6+
workflow_dispatch:
67

78
jobs:
89
crowdin-pull:

.github/workflows/release-nightly.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: release-nightly-assets
2+
3+
on:
4+
push:
5+
branches: [ main, release/v* ]
6+
7+
jobs:
8+
nightly-binary:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
13+
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
14+
- run: git fetch --unshallow --quiet --tags --force
15+
- uses: actions/setup-go@v4
16+
with:
17+
go-version: ">=1.20"
18+
check-latest: true
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 20
22+
- run: make deps-frontend deps-backend
23+
# xgo build
24+
- run: make release
25+
env:
26+
TAGS: bindata sqlite sqlite_unlock_notify
27+
- name: import gpg key
28+
id: import_gpg
29+
uses: crazy-max/ghaction-import-gpg@v5
30+
with:
31+
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
32+
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
33+
- name: sign binaries
34+
run: |
35+
for f in dist/release/*; do
36+
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"
37+
done
38+
# clean branch name to get the folder name in S3
39+
- name: Get cleaned branch name
40+
id: clean_name
41+
run: |
42+
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
43+
echo "Cleaned name is ${REF_NAME}"
44+
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
45+
- name: upload binaries to s3
46+
uses: jakejarvis/s3-sync-action@master
47+
env:
48+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
49+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
50+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
51+
AWS_REGION: ${{ secrets.AWS_REGION }}
52+
SOURCE_DIR: dist/release
53+
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
54+
nightly-docker:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
- uses: docker/setup-buildx-action@v1
59+
# build for linux/amd64, and linux/arm64 (possibly include linux/arm/v7 later. not included now because it adds significant amount to the build time)

Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -837,30 +837,18 @@ release-windows: | $(DIST_DIRS)
837837
ifeq (,$(findstring gogit,$(TAGS)))
838838
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
839839
endif
840-
ifeq ($(CI),true)
841-
cp /build/* $(DIST)/binaries
842-
endif
843840

844841
.PHONY: release-linux
845842
release-linux: | $(DIST_DIRS)
846843
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
847-
ifeq ($(CI),true)
848-
cp /build/* $(DIST)/binaries
849-
endif
850844

851845
.PHONY: release-darwin
852846
release-darwin: | $(DIST_DIRS)
853847
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
854-
ifeq ($(CI),true)
855-
cp /build/* $(DIST)/binaries
856-
endif
857848

858849
.PHONY: release-freebsd
859850
release-freebsd: | $(DIST_DIRS)
860851
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
861-
ifeq ($(CI),true)
862-
cp /build/* $(DIST)/binaries
863-
endif
864852

865853
.PHONY: release-copy
866854
release-copy: | $(DIST_DIRS)

docs/content/doc/help/support.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ menu:
1717

1818
# Support Options
1919

20+
- [Paid Commercial Support](https://about.gitea.com/)
2021
- [Discord](https://discord.gg/Gitea)
2122
- [Discourse Forum](https://discourse.gitea.io/)
2223

docs/content/doc/usage/actions/act-runner.en-us.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ The default configuration is safe to use without any modification, so you can ju
7676
./act_runner --config config.yaml [command]
7777
```
7878

79+
You could also generate config file with docker:
80+
81+
```bash
82+
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
83+
```
84+
7985
When you are using the docker image, you can specify the configuration file by using the `CONFIG_FILE` environment variable. Make sure that the file is mounted into the container as a volume:
8086

8187
```bash
@@ -172,6 +178,27 @@ It is because the act runner will run jobs in docker containers, so it needs to
172178
As mentioned, you can remove it if you want to run jobs in the host directly.
173179
To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine.
174180

181+
### Set up the runner using docker compose
182+
183+
You could also set up the runner using the following `docker-compose.yml`:
184+
185+
```yml
186+
version: "3.8"
187+
services:
188+
runner:
189+
image: gitea/act_runner:nightly
190+
environment:
191+
CONFIG_FILE: /config.yaml
192+
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
193+
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
194+
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
195+
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
196+
volumes:
197+
- ./config.yaml:/config.yaml
198+
- ./data:/data
199+
- /var/run/docker.sock:/var/run/docker.sock
200+
```
201+
175202
### Configuring cache when starting a Runner using docker image
176203
177204
If you do not intend to use `actions/cache` in workflow, you can ignore this section.

docs/content/doc/usage/actions/act-runner.zh-cn.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ docker pull gitea/act_runner:nightly # for the latest nightly build
7676
./act_runner --config config.yaml [command]
7777
```
7878

79+
您亦可以如下使用 docker 创建配置文件:
80+
81+
```bash
82+
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
83+
```
84+
7985
当使用Docker镜像时,可以使用`CONFIG_FILE`环境变量指定配置文件。确保将文件作为卷挂载到容器中:
8086

8187
```bash
@@ -169,6 +175,27 @@ docker run \
169175
如前所述,如果要在主机上直接运行Job,可以将其移除。
170176
需要明确的是,这里的 "主机" 实际上指的是当前运行 Act Runner的容器,而不是主机机器本身。
171177

178+
### 使用 Docker compose 运行 Runner
179+
180+
您亦可使用如下的 `docker-compose.yml`:
181+
182+
```yml
183+
version: "3.8"
184+
services:
185+
runner:
186+
image: gitea/act_runner:nightly
187+
environment:
188+
CONFIG_FILE: /config.yaml
189+
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
190+
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
191+
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
192+
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
193+
volumes:
194+
- ./config.yaml:/config.yaml
195+
- ./data:/data
196+
- /var/run/docker.sock:/var/run/docker.sock
197+
```
198+
172199
### 当您使用 Docker 镜像启动 Runner,如何配置 Cache
173200
174201
如果你不打算在工作流中使用 `actions/cache`,你可以忽略本段。

0 commit comments

Comments
 (0)