1
Service:Gitea Runner
系統管理員 edited this page 2026-03-06 05:58:29 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

從 Github Release Page 下載 Gitea Runner並重新命名成 act_runner.exe

Github Release Page: https://gitea.com/gitea/act_runner/releases

v0.2.11: https://gitea.com/gitea/act_runner/releases/download/v0.2.11/act_runner-0.2.11-windows-amd64.exe

Invoke-WebRequest https://gitea.com/gitea/act_runner/releases/download/v0.2.11/act_runner-0.2.11-windows-amd64.exe -OutFile act_runner.exe

註冊 Gitea Runner 到 Gitea Server 產生 .runner 檔

$instance="<Gitea instance URL>"
$token="<Runner token>"
$labels="<Runner labels>"
$name="<Runner name>"
.\act_runner.exe register --no-interactive --instance $instance --token $token --labels $labels --name $name

從 Github Release Page 下載 WinSW並重新命名成 winsw.exe

Github Release Page: https://github.com/winsw/winsw/releases

v2.12.0: https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe

Invoke-WebRequest https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe -OutFile winsw.exe

建立配置檔,且檔案名稱需要跟 WinSW 一樣,如 winsw.xml

<service>
  <id>gitea_runner</id>
  <name>Gitea Runner</name>
  <description>This service runs Gitea Runner.</description>
  <executable>act_runner.exe</executable>
  <arguments>daemon</arguments>
</service>

安裝並啟動服務

.\winsw.exe install
.\winsw.exe start