Release 1.0.0 (#9)
Build and provide rpm of the Gitea runner / Start build on COPR (f44) (release) Successful in 2m11s
Build and provide rpm of the Gitea runner / Start build on COPR (rawhide) (release) Successful in 2m25s

Rename from act-runner to gitea-runner.
The upstream projects changed name from act_runner to runner.

Reviewed-on: http://git.demus.dk/demus/gitea-runner-rpm/pulls/9
Co-authored-by: Daniel Demus <daniel@demus.dk>
Co-committed-by: Daniel Demus <daniel@demus.dk>
This commit was merged in pull request #9.
This commit is contained in:
2026-05-29 00:53:11 +02:00
committed by demus
parent c80f174afb
commit ab72743bcc
17 changed files with 120 additions and 102 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
name: Build and provide rpm of the Gitea act_runner
run-name: Build act_runner from ${{ gitea.repository }} on COPR
name: Build and provide rpm of the Gitea runner
run-name: Build gitea-runner from ${{ gitea.repository }} on COPR
on: [release]
jobs:
coprbuild:
+2 -2
View File
@@ -1,5 +1,5 @@
name: Build and provide rpm of Gitea act_runner
run-name: Rpmbuild act_runner at ${{ gitea.repository }} by ${{ github.actor }}
name: Build and provide rpm of Gitea runner
run-name: Rpmbuild gitea-runner at ${{ gitea.repository }} by ${{ github.actor }}
on:
workflow_dispatch:
inputs:
+2 -2
View File
@@ -1,5 +1,5 @@
name: Build and provide rpm of the Gitea act_runner
run-name: Rpmbuild act_runner by @${{ github.actor }}
name: Build and provide rpm of the Gitea runner
run-name: Rpmbuild gitea-runner by @${{ github.actor }}
on: [release]
jobs:
rpmbuild:
+1
View File
@@ -27,3 +27,4 @@ go.work
RPMS/
BUILD/
SRPMS/
+13 -15
View File
@@ -1,6 +1,6 @@
# Gitea act runner
Act runner is a runner for Gitea based on Gitea fork of act.
Gitea runner is a runner for Gitea based on the Gitea fork of act.
## Quickstart
@@ -17,7 +17,7 @@ ENABLED=true
Before the runner can be started you need to register it on the Gitea server:
```bash
/usr/share/gitea-act-runner/act_runner-register.sh
/usr/share/gitea-runner/register.sh
```
And you will be asked to input:
@@ -53,24 +53,24 @@ The script is not on the path to avoid accidentally overwriting a working regist
You can also register manually with command line arguments.
```bash
cd ~act-runner
sudo -u act-runner -H act_runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --no-interactive
cd ~gitea-runner
sudo -u gitea-runner -H gitea-runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --no-interactive
```
If the registry succeeds, it will run immediately. Next time, you can run the runner directly by enabling the systemd service.
If the registration succeeds, it will run immediately. Next time, you can run the runner directly by enabling the systemd service.
### Run
Enable the systemd service:
```bash
systemctl enable --now gitea-act-runner.service
systemctl enable --now gitea-runner.service
```
You can also manually start the daemon:
```bash
act_runner daemon
gitea-runner daemon
```
This is mostly useful to debugging, when the systemd service fails to start.
@@ -79,7 +79,7 @@ This is mostly useful to debugging, when the systemd service fails to start.
### Configuration
The runner can be configured with a configuration file.
The systemd service file expects the file to be `/etc/gitea-act-runner/config.yaml`.
The systemd service file expects the file to be `/etc/gitea-runner/config.yaml`.
The config file installed by the package has removed the example `envs:` and `labels:` values.
> **NB**: The value of `labels:` in the config file, if they are specified, override any labels configured during registration on the next startup.
@@ -89,17 +89,15 @@ The log level is set to debug, to assist first setup and should be changed to `i
The configuration file is a YAML file, which can also generated as a sample configuration file with `./act_runner generate-config`.
```bash
act_runner generate-config > /etc/gitea-act-runner/config.yaml
chmod 0640 /etc/gitea-act-runner/config.yaml
gitea-runner generate-config > /etc/gitea-runner/config.yaml
chmod 0640 /etc/gitea-runner/config.yaml
```
You can specify the configuration file path with `-c`/`--config` argument.
```bash
act_runner -c /etc/gitea-act-runner/config.yaml register # register with config file
act_runner -c /etc/gitea-act-runner/config.yaml daemon # run with config file
gitea-runner -c /etc/gitea-runner/config.yaml register # register with config file
gitea-runner -c /etc/gitea-runner/config.yaml daemon # run with config file
```
You can read the latest version of the configuration file online at [config.example.yaml](internal/pkg/config/config.example.yaml).
https://gitea.com/gitea/runner
You can read the latest version of the configuration file online at [config.example.yaml](https://gitea.com/gitea/runner/src/branch/main/internal/pkg/config/config.example.yaml).
+9 -9
View File
@@ -8,9 +8,9 @@ to enable gitea actions in a non-root docker environment.
You have to start and register the docker instance with Gitea:
```bash
systemctl -M act-runner-rootless@ --user enable --now dockerd-rootless-user
/usr/share/gitea-act-runner/rootless-act_runner-register.sh
systemctl -M act-runner-rootless@ --user enable --now gitea-act-runner-rootless
systemctl -M gitea-runner-rootless@ --user enable --now dockerd-rootless-user
/usr/share/gitea-runner/register-rootless.sh
systemctl -M gitea-runner-rootless@ --user enable --now gitea-runner-rootless
```
You will be asked to input:
@@ -25,23 +25,23 @@ Apart from registering the docker instance, the script also produces a default c
### Configuration
The runner can be configured with a configuration file.
The systemd user service file expects the file to be `/home/gitea-act-runner/act_runner/config.yaml`.
The systemd user service file expects the file to be `/home/gitea-runner/runner/config.yaml`.
The registration script generates a default config file with the `envs:` and `labels:` values removed in the above-mentioned directory.
> **NB**: The value of `labels:` in the config file, if they are specified, override any labels configured during registration on the next startup.
The log level is set to debug, to assist first setup and should be changed to `info` during normal operation.
The configuration file is a YAML file, which can also generated as a sample configuration file with `./act_runner generate-config`.
The configuration file is a YAML file, which can also generated as a sample configuration file with `gitea-runner generate-config`.
```bash
cd ~act-runner-rootless/act_runner
act_runner generate-config > config.yaml
chown act-runner-rootless:act-runner-rootless config.yaml
cd ~gitea-runner-rootless/runner
gitea-runner generate-config > config.yaml
chown gitea-runner-rootless:gitea-runner-rootless config.yaml
chmod 0640 config.yaml
```
> **NB**: The generated config file has the default values of `labels:`, which override any labels configured during registration on the next startup. There are also some default `envs:` values, that result in environment variables in all runs.
## Uninstallation
If you uninstall the package, you need to manually remove the registration in the Gitea UI and remove the /home/gitea-act-runner directory, if required.
If you uninstall the package, you need to manually remove the registration in the Gitea UI and remove the /home/gitea-runner-rootless directory, if required.
+3 -3
View File
@@ -1,4 +1,4 @@
# gitea-act-runner-rpm
# gitea-runner-rpm
Spec file to copr build the gitea act_runner binary
from https://gitea.com/gitea/act_runner.git
Spec file to copr build the gitea-runner binary
from https://gitea.com/gitea/runner.git
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
sudo -u act-runner act_runner register -c "$(rpm --eval '%{_sysconfdir}')/gitea-act-runner/config.yaml"
-2
View File
@@ -1,2 +0,0 @@
#Type Name ID GECOS Home directory Shell
m act-runner docker
-2
View File
@@ -1,2 +0,0 @@
#Type Name ID GECOS Home directory Shell
u! act-runner - "act_runner user" /var/lib/act-runner -
@@ -1,15 +1,15 @@
[Unit]
Description=Gitea Actions runner using docker
Documentation=https://gitea.com/gitea/act_runner
Description=Gitea Actions runner using rootless docker
Documentation=https://gitea.com/gitea/runner
After=dockerd-rootless-user.service gitea.service
[Service]
Environment=XDG_RUNTIME_DIR=/run/user/%U
Environment=DOCKER_HOST=unix:///run/user/%U/docker.sock
ExecStart=/usr/bin/act_runner daemon -c %h/act_runner/config.yaml
ExecStart=/usr/bin/gitea-runner daemon -c %h/runner/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID
Type=exec
WorkingDirectory=%h/act_runner
WorkingDirectory=%h/gitea-runner
TimeoutStartSec=30
TimeoutStopSec=120
Restart=always
+2
View File
@@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
m gitea-runner docker
+2
View File
@@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u! gitea-runner - "Gitea action runner user" /var/lib/gitea-runner -
@@ -1,11 +1,11 @@
[Unit]
Description=Gitea Actions runner using docker
Documentation=https://gitea.com/gitea/act_runner
Documentation=https://gitea.com/gitea/runner
After=docker.service gitea.service
[Service]
User=act-runner
ExecStart=/usr/bin/act_runner daemon -c /etc/gitea-act-runner/config.yaml
ExecStart=/usr/bin/gitea-runner daemon -c /etc/gitea-runner/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=~
Environment=DOCKER_HOST=unix:///run/docker.sock
+72 -53
View File
@@ -1,47 +1,49 @@
%global dockerd dockerd
%global rootless rootless
%global shim docker-group-shim
%global dockerd_rootless %{dockerd}-%{rootless}
%global dockerd_rootless_service %{dockerd}-%{rootless}-user.service
%global runner_bin act_runner
%global runner_user act-runner
%global runner_user_rootless %{runner_user}-%{rootless}
%global rootless_dockerd %{dockerd}-%{rootless}
%global rootless_dockerd_service %{dockerd}-%{rootless}-user.service
%global debug_package %{nil}
%global golicenses LICENSE
%global godocs examples README.md
%global goipath gitea.com/gitea/act_runner
%global goipath gitea.com/gitea/runner
%global common_description %{expand:
A runner for Gitea based on nectos/act.
}
%global major 0
%global minor 6
%global revision 1
%global major 1
%global minor 0
%global revision 0
Name: gitea-runner
%global rootless_user %{name}-%{rootless}
%global obsolete_user act-runner-%{rootless}
Name: gitea-act-runner
Version: %{major}.%{minor}.%{revision}
Release: %autorelease
Summary: A runner for Gitea based on act.
Summary: A runner for Gitea
%global act_runner_service %{name}.service
%global act_runner_rootless_service %{name}-%{rootless}.service
%global runner_service %{name}.service
%global rootless_runner_service %{name}-%{rootless}.service
License: MIT
URL: https://gitea.com/gitea/runner
Source0: https://gitea.com/gitea/runner/archive/v%{version}.tar.gz
Source1: %{act_runner_service}
Source2: %{act_runner_rootless_service}
Source3: %{dockerd_rootless_service}
Source1: %{runner_service}
Source2: %{rootless_runner_service}
Source3: %{rootless_dockerd_service}
Source4: README-%{dockerd}.md
Source5: README-%{rootless}-%{dockerd}.md
Source6: rootless-act_runner-register.sh
Source6: register-rootless.sh
Source7: %{name}-sysusers.conf
Source8: act_runner-register.sh
Source8: register.sh
Source9: %{name}-sysusers-%{dockerd}.conf
BuildRequires: go >= 1.26 go-rpm-macros git-core sed systemd-rpm-macros
Conflicts: gitea-act-runner
Obsoletes: gitea-act-runner < 1.0.0
%gometa -L -f
@@ -53,7 +55,8 @@ BuildRequires: go >= 1.26 go-rpm-macros git-core sed systemd-rpm-macros
Summary: Enable running gitea actions in docker containers
Requires: %{name}
Requires: ( moby-engine or docker-ce )
Conflicts: %{name}-%{dockerd_rootless}
Conflicts: %{name}-%{rootless_dockerd} gitea-act-runner-%{rootless_dockerd}
Obsoletes: gitea-act-runner-%{dockerd} < 1.0.0
%{?%systemd_requires}
%description %{dockerd}
@@ -61,20 +64,25 @@ Conflicts: %{name}-%{dockerd_rootless}
Run gitea actions in docker containers
%pre %{dockerd}
# Check if we are replacing the gitea-act-runner package
if [ $1 -eq 1 ]; then
getent group act-runner >/dev/null || groupmod -n %{name} act-runner || :
getent passwd act-runner >/dev/null || usermod -l %{name} -m -d %{_sharedstatedir}/%{name} act-runner || :
fi
%sysusers_create_package %{name} %{SOURCE7}
%sysusers_create_package %{name} %{SOURCE9}
%post %{dockerd}
%systemd_post %{act_runner_service}
if [ $1 -eq 1 ] || [ ! -d %{_sharedstatedir}/%{runner_user}/act_runner ]; then
%systemd_post %{runner_service}
if [ $1 -eq 1 ] || [ ! -d %{_sharedstatedir}/%{name}/runner ]; then
echo ' INFO Please read README-%{dockerd}.md to finish the installation'
fi
%preun %{dockerd}
%systemd_preun %{act_runner_service}
%systemd_preun %{runner_service}
%postun %{dockerd}
%systemd_postun %{act_runner_service}
%systemd_postun %{runner_service}
# #############################################################
@@ -95,38 +103,49 @@ using the act-runner with the non-rootless docker-ce.
# #############################################################
# act_runner with rootless dockerd package
%package %{dockerd_rootless}
%package %{rootless_dockerd}
Summary: Enable running gitea actions in non-root docker containers
Requires: %{name} iptables sed shadow-utils
Requires: ( moby-engine-rootless-extras or docker-ce-rootless-extras )
Conflicts: %{name}-%{dockerd}
Conflicts: %{name}-%{dockerd} gitea-act-runner-%{dockerd}
Obsoletes: gitea-act-runner-%{rootless_dockerd} < 1.0.0
%{?%systemd_requires}
%description %{dockerd_rootless}
%description %{rootless_dockerd}
%{common_description}
Run gitea actions in non-root docker containers
%pre %{dockerd_rootless}
%pre %{rootless_dockerd}
# sysusers.d doesn't handle either home directory creation or subuid/subgid configuration
if [ $1 -eq 1 ]; then
getent group '%{runner_user_rootless}' >/dev/null || groupadd -r '%{runner_user_rootless}' || :
getent passwd '%{runner_user_rootless}' >/dev/null || \
CREATE_MAIL_SPOOL=false useradd -r -m -F -g '%{runner_user_rootless}' -s '/sbin/nologin' -c 'Rootless act_runner docker user' '%{runner_user_rootless}' || :
# Modify the existing user and group if we are upgrade obsoleting the package with the old naming
if getent passwd %{obsolete_user} >/dev/null; then
loginctl disable-linger %{obsolete_user} &
systemctl --user -M %{obsolete_user}@ disable --now --no-warn %{rootless_dockerd_service} gitea-act-runner-rootless.service &
loginctl terminate-user %{obsolete_user} &
wait
getent group %{obsolete_user} >/dev/null && groupmod -n %{rootless_user} %{obsolete_user} || :
getent passwd %{obsolete_user} >/dev/null && usermod -l %{rootless_user} -m -d /home/%{rootless_user} %{obsolete_user} || :
%{__mv} /home/%{rootless_user}/act_runner /home/%{rootless_user}/runner >/dev/null
fi
getent group '%{rootless_user}' >/dev/null || groupadd -r '%{rootless_user}' || :
getent passwd '%{rootless_user}' >/dev/null || \
CREATE_MAIL_SPOOL=false useradd -r -m -F -g '%{rootless_user}' -s '/sbin/nologin' -c 'Rootless act_runner docker user' '%{rootless_user}' || :
fi
%post %{dockerd_rootless}
%systemd_user_post %{act_runner_rootless_service} %{dockerd_rootless_service}
loginctl enable-linger %{runner_user_rootless}
%post %{rootless_dockerd}
%systemd_user_post %{rootless_runner_service} %{rootless_dockerd_service}
loginctl enable-linger %{rootless_user}
%preun %{dockerd_rootless}
%preun %{rootless_dockerd}
if [ $1 -eq 0 ]; then
loginctl disable-linger %{runner_user_rootless}
loginctl disable-linger %{rootless_user}
fi
%systemd_user_preun %{dockerd_rootless_service} %{act_runner_rootless_service}
%systemd_user_preun %{rootless_dockerd_service} %{rootless_runner_service}
%postun %{dockerd_rootless}
%systemd_user_postun %{dockerd_rootless_service} %{act_runner_rootless_service}
%postun %{rootless_dockerd}
%systemd_user_postun %{rootless_dockerd_service} %{rootless_runner_service}
# #############################################################
@@ -136,7 +155,7 @@ fi
%{__cp} %{SOURCE4} %{SOURCE5} .
%build
go build %{gobuild_baseflags} -o bin/%{runner_bin} %{goipath}
go build %{gobuild_baseflags} -o bin/%{name} %{goipath}
%install
# The binary
@@ -147,25 +166,25 @@ install -m 0755 -vp bin/* %{buildroot}%{_bindir}
install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}
install -m 0700 -vd %{buildroot}%{_sharedstatedir}/%{name}
install -D -m 0644 -vp %{SOURCE1} %{buildroot}%{_unitdir}/%{act_runner_service}
install -D -m 0644 -vp %{SOURCE1} %{buildroot}%{_unitdir}/%{runner_service}
install -D -m 0644 %{SOURCE7} %{buildroot}%{_sysusersdir}/%{name}.conf
install -D -m 0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/%{name}-%{dockerd}.conf
bin/%{runner_bin} generate-config | \
bin/%{name} generate-config | \
sed -e '/^ A_TEST_ENV/d' -e '/^ - "ubuntu-/d' -e 's:file\: .runner:file\: %{_sharedstatedir}/%{name}/.runner:' -e 's/level: info/level: debug/' \
> %{buildroot}%{_sysconfdir}/%{name}/config.yaml
install -D -m 0755 -vp %{SOURCE8} %{buildroot}%{_datadir}/%{name}/act_runner-register.sh
install -D -m 0755 -vp %{SOURCE8} %{buildroot}%{_datadir}/%{name}/register.sh
# dockerd-rootless
install -m 0755 -vd %{buildroot}%{_userunitdir}
install -m 0755 -vd %{buildroot}%{_datadir}/%{name}
install -D -m 0644 -vp %{SOURCE2} %{buildroot}%{_userunitdir}/%{act_runner_rootless_service}
install -D -m 0644 -vp %{SOURCE3} %{buildroot}%{_userunitdir}/%{dockerd_rootless_service}
install -D -m 0755 -vp %{SOURCE6} %{buildroot}%{_datadir}/%{name}/rootless-act_runner-register.sh
install -D -m 0644 -vp %{SOURCE2} %{buildroot}%{_userunitdir}/%{rootless_runner_service}
install -D -m 0644 -vp %{SOURCE3} %{buildroot}%{_userunitdir}/%{rootless_dockerd_service}
install -D -m 0755 -vp %{SOURCE6} %{buildroot}%{_datadir}/%{name}/register-rootless.sh
%files
%license LICENSE
%doc README.md
%{_bindir}/%{runner_bin}
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%files %{dockerd}
@@ -173,19 +192,19 @@ install -D -m 0755 -vp %{SOURCE6} %{buildroot}%{_datadir}/%{name}/rootless-act_r
%doc README-%{dockerd}.md
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/config.yaml
%attr(0700, %{runner_user}, %{runner_user}) %dir %{_sharedstatedir}/%{name}
%attr(0700, %{name}, %{name}) %dir %{_sharedstatedir}/%{name}
%ghost %config(noreplace) %{_sharedstatedir}/%{name}/.runner
%{_unitdir}/%{act_runner_service}
%{_unitdir}/%{runner_service}
%{_sysusersdir}/%{name}.conf
%{_sysusersdir}/%{name}-%{dockerd}.conf
%{_datadir}/%{name}/act_runner-register.sh
%{_datadir}/%{name}/register.sh
%files %{dockerd_rootless}
%files %{rootless_dockerd}
%license LICENSE
%doc README-%{rootless}-%{dockerd}.md
%{_userunitdir}/%{act_runner_rootless_service}
%{_userunitdir}/%{dockerd_rootless_service}
%{_datadir}/%{name}/rootless-act_runner-register.sh
%{_userunitdir}/%{rootless_runner_service}
%{_userunitdir}/%{rootless_dockerd_service}
%{_datadir}/%{name}/register-rootless.sh
%files %{shim}
@@ -1,10 +1,10 @@
#!/bin/bash
mkdir -p -m 0750 ~act-runner-rootless/act_runner
cd ~act-runner-rootless/act_runner
mkdir -p -m 0750 ~gitea-runner-rootless/runner
cd ~gitea-runner-rootless/runner
act_runner register
act_runner generate-config | \
sed -e '/^ A_TEST_ENV/d' -e '/^ - "ubuntu-/d' -e "s:file\: .runner:file\: ${PWD}/.runner:" -e 's/level: info/level: debug/' \
> config.yaml
chmod 0640 config.yaml
chown -R act-runner-rootless:act-runner-rootless ~act-runner-rootless/act_runner
chown -R gitea-runner-rootless:gitea-runner-rootless ~gitea-runner-rootless/runner
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
sudo -u gitea-runner gitea-runner register -c "$(rpm --eval '%{_sysconfdir}')/gitea-runner/config.yaml"