feat: Add support for service on Windows, Linux, and macOS

Introduce functionality to support the execution of the `act_runner` daemon as a service on various operating systems, including Windows, Linux, and macOS. This enhancement includes the ability to set the working directory using the `--working-directory` flag.

Details:
- The daemon can be installed and enabled with the command `act_runner daemon install`.
- The service can be stopped and uninstalled using `act_runner daemon uninstall`.
- The default working directory is set to the directory containing the `act_runner` executable.
- During the installation process (`act_runner daemon install`), the service checks for the existence of `.runner` and `config.yaml` files in the same directory. If found, these files are loaded into the service.

Note: Prior to running `act_runner daemon install`, ensure registration of `act_runner` with the command `act_runner register` to generate the required `.runner` file.
This commit is contained in:
cachito-worker
2023-11-28 01:33:27 +00:00
parent 91bfe4c186
commit c9ec99c632
5 changed files with 292 additions and 111 deletions

1
go.mod
View File

@@ -9,6 +9,7 @@ require (
github.com/bufbuild/connect-go v1.10.0
github.com/docker/docker v24.0.7+incompatible
github.com/joho/godotenv v1.5.1
github.com/kardianos/service v1.2.2
github.com/mattn/go-isatty v0.0.20
github.com/nektos/act v0.2.51
github.com/sirupsen/logrus v1.9.3