Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Show if File is Executable (go-gitea#25287)
  Add devcontainer config for developing Gitea (go-gitea#24781)
  Add link to support page for commercial support (go-gitea#25293)
  Docs about how to generate config for act runner with docker and setup it with docker-compose (go-gitea#25256)
  Fix some UI alignments (go-gitea#25277)
  Remove fomantic inverted variations (go-gitea#25286)
  Fix issue and commit status popup padding (go-gitea#25254)
  • Loading branch information
zjjhot committed Jun 16, 2023
2 parents de2c98c + a305c37 commit 9b5b943
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 4,475 deletions.
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Gitea DevContainer",
"image": "mcr.microsoft.com/devcontainers/go:1.20",
"features": {
// installs nodejs into container
"ghcr.io/devcontainers/features/node:1": {
"version":"20"
}
},
"customizations": {
"vscode": {
"settings": {},
// same extensions as Gitpod, should match /.gitpod.yml
"extensions": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"golang.go",
"stylelint.vscode-stylelint",
"DavidAnson.vscode-markdownlint",
"Vue.volar",
"ms-azuretools.vscode-docker",
"zixuanchen.vitest-explorer",
"alexcvzz.vscode-sqlite"
]
}
},
"portsAttributes": {
"3000": {
"label": "Gitea Web",
"onAutoForward": "notify"
}
},
"postCreateCommand": "make deps"
}
1 change: 1 addition & 0 deletions docs/content/doc/help/support.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu:

# Support Options

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

Expand Down
27 changes: 27 additions & 0 deletions docs/content/doc/usage/actions/act-runner.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ The default configuration is safe to use without any modification, so you can ju
./act_runner --config config.yaml [command]
```

You could also generate config file with docker:

```bash
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
```

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:

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

### Set up the runner using docker compose

You could also set up the runner using the following `docker-compose.yml`:

```yml
version: "3.8"
services:
runner:
image: gitea/act_runner:nightly
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
volumes:
- ./config.yaml:/config.yaml
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock
```
### Configuring cache when starting a Runner using docker image
If you do not intend to use `actions/cache` in workflow, you can ignore this section.
Expand Down
27 changes: 27 additions & 0 deletions docs/content/doc/usage/actions/act-runner.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ docker pull gitea/act_runner:nightly # for the latest nightly build
./act_runner --config config.yaml [command]
```

您亦可以如下使用 docker 创建配置文件:

```bash
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
```

当使用Docker镜像时,可以使用`CONFIG_FILE`环境变量指定配置文件。确保将文件作为卷挂载到容器中:

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

### 使用 Docker compose 运行 Runner

您亦可使用如下的 `docker-compose.yml`:

```yml
version: "3.8"
services:
runner:
image: gitea/act_runner:nightly
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
volumes:
- ./config.yaml:/config.yaml
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock
```
### 当您使用 Docker 镜像启动 Runner,如何配置 Cache
如果你不打算在工作流中使用 `actions/cache`,你可以忽略本段。
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@ video_not_supported_in_browser = Your browser does not support the HTML5 'video'
audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag.
stored_lfs = Stored with Git LFS
symbolic_link = Symbolic link
executable_file = Executable File
commit_graph = Commit Graph
commit_graph.select = Select branches
commit_graph.hide_pr_refs = Hide Pull Requests
Expand Down
1 change: 1 addition & 0 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
ctx.Data["IsDisplayingSource"] = isDisplayingSource
ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
ctx.Data["IsExecutable"] = entry.IsExecutable()

isTextSource := fInfo.isTextFile || isDisplayingSource
ctx.Data["IsTextSource"] = isTextSource
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/commits.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/sub_menu" .}}
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw gt-mb-4 gt-mt-3">
<div class="repo-button-row">
<div class="gt-df gt-ac">
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
<a href="{{.RepoLink}}/graph" class="ui basic small compact button">
Expand Down
5 changes: 5 additions & 0 deletions templates/repo/file_info.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@
{{.LexerName}}
</div>
{{end}}
{{if .IsExecutable}}
<div class="file-info-entry">
{{.locale.Tr "repo.executable_file"}}
</div>
{{end}}
</div>
8 changes: 4 additions & 4 deletions templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
{{end}}
{{template "repo/sub_menu" .}}
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
<div class="repo-button-row">
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
Expand All @@ -84,8 +84,9 @@
{{end}}

{{if and .CanWriteCode .IsViewBranch (not .Repository.IsArchived)}}
<button class="ui basic compact dropdown jump icon button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
<span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
<button class="ui dropdown basic compact jump button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
{{.locale.Tr "repo.editor.add_file"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
{{.locale.Tr "repo.editor.new_file"}}
Expand All @@ -99,7 +100,6 @@
{{.locale.Tr "repo.editor.patch"}}
</a>
</div>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</button>
{{end}}

Expand Down
2 changes: 1 addition & 1 deletion templates/repo/wiki/view.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{template "repo/header" .}}
{{$title := .title}}
<div class="ui container">
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
<div class="repo-button-row">
<div class="gt-df gt-ac">
<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
<div class="ui basic small button">
Expand Down
4 changes: 2 additions & 2 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2099,8 +2099,8 @@ a.ui.basic.label:hover {
}

/* if a .top.attached.header is followed by a .segment, add some margin */
.ui.segments ~ .ui.top.attached.header,
.ui.attached.segment ~ .ui.top.attached.header {
.ui.segments + .ui.top.attached.header,
.ui.attached.segment + .ui.top.attached.header {
margin-top: 1rem;
}

Expand Down
23 changes: 10 additions & 13 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -2693,26 +2693,23 @@
}

.repo-button-row {
margin-bottom: 10px;
}

.repo-button-row > * {
margin-top: 8px;
}

.wiki .repo-button-row {
margin-bottom: 0;
}

.wiki .repo-button-row > * {
margin-top: 0;
margin: 10px 0;
display: flex;
align-items: center;
gap: 0.5em;
flex-wrap: wrap;
justify-content: space-between;
}

.repo-button-row .button {
padding: 6px 10px !important;
height: 30px;
}

.repo-button-row .button.dropdown {
padding-right: 22px !important; /* normal buttons have !important paddings, so we need to override it for dropdown (Add File) icons */
}

.repo-button-row input {
height: 30px;
}
Expand Down
38 changes: 38 additions & 0 deletions web_src/fomantic/_site/globals/site.variables
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,41 @@
@linkHoverUnderline: underline;
@variationButtonSocial: false;
@pageOverflowX: visible;

/* disable all inverted variations */
@variationAccordionInverted: false;
@variationBreadcrumbInverted: false;
@variationButtonAttached: false;
@variationButtonInverted: false;
@variationCalendarInverted: false;
@variationCardInverted: false;
@variationCheckboxInverted: false;
@variationCommentInverted: false;
@variationDimmerInverted: false;
@variationDividerInverted: false;
@variationDropdownInverted: false;
@variationFeedInverted: false;
@variationFlyoutInverted: false;
@variationFormInverted: false;
@variationGridInverted: false;
@variationHeaderInverted: false;
@variationIconInverted: false;
@variationInputInverted: false;
@variationItemInverted: false;
@variationLabelInverted: false;
@variationListInverted: false;
@variationMenuInverted: false;
@variationMessageInverted: false;
@variationModalInverted: false;
@variationNagInverted: false;
@variationPlaceholderInverted: false;
@variationPopupInverted: false;
@variationProgressInverted: false;
@variationSegmentInverted: false;
@variationSliderInverted: false;
@variationStatisticInverted: false;
@variationStepInverted: false;
@variationTableInverted: false;
@variationTextInverted: false;
@variationToastInverted: false;
@variationTransitionInverted: false;
Loading

0 comments on commit 9b5b943

Please sign in to comment.