Clone
4
6.3 Gitea Runner
jsc-wiki edited this page 2026-10-14 06:27: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.

Gitea Runner(Windows)

第6章 開發與持續整合 · 來源:JSC 知識庫

簡介

在 Windows 安裝 Gitea Runner,並以 WinSW 註冊為系統服務。

步驟

1. 從 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

2. 註冊 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

3. 從 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

← 6.2 GiteaRunner(Ubuntu) · 本章目錄 · 全書目錄 · 6.4 GiteaRunner(Alpine) →