This commit is contained in:
Brian Zalewski 2024-01-16 05:19:56 +00:00
parent ac42b6e136
commit 77e976c1ff

View file

@ -12818,6 +12818,7 @@ softwarePackages:
_name: AI Shell
npm: '@builder.io/ai-shell'
github-runner:
_bin: false
_desc: '[GitHub Runner](https://docs.github.com/en/actions/hosting-your-own-runners) is a system that you deploy and manage to execute jobs from GitHub Actions on GitHub.com.'
_docs: https://docs.github.com/en/actions/hosting-your-own-runners
_github: https://github.com/actions/runner
@ -12844,12 +12845,11 @@ softwarePackages:
#
# * [Secrets / Environment variables documentation](https://install.doctor/docs/customization/secrets)
GH_RUNNER_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
### Check if GitHub runner is installed
if [ -f "$GH_RUNNER_PATH/config.sh" ]; then
if [ -f "$GH_RUNNER_PATH/.runner" ]; then
logg info "GitHub Actions runner is already configured ($GH_RUNNER_PATH/.runner file is present)"
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/github-runnerconfig.sh" ]; then
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/github-runner/.runner" ]; then
logg info "GitHub Actions runner is already configured (${XDG_DATA_HOME:-$HOME/.local/share}/github-runner/.runner file is present)"
else
logg info 'Creating runner configuration'
### Configure labels
@ -12871,15 +12871,15 @@ softwarePackages:
RUNNER_TOKEN="$(curl -sSL -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/orgs/{{ .user.github.runnerOrg }}/actions/runners/registration-token | jq -r '.token')"
### Generate the configuration
logg info 'Joining GitHub runner to https://github.com/{{ .user.github.runnerOrg }}'
"$GH_RUNNER_PATH/config.sh" --unattended --url https://github.com/{{ .user.github.runnerOrg }} --token "$RUNNER_TOKEN" --labels "$LABELS" || EXIT_CODE=$?
"${XDG_DATA_HOME:-$HOME/.local/share}/github-runner/config.sh" --unattended --url https://github.com/{{ .user.github.runnerOrg }} --token "$RUNNER_TOKEN" --labels "$LABELS" || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg error 'GitHub runner configuration failed' && exit 1
fi
### Install / start the service
logg info 'Configuring runner service'
"$GH_RUNNER_PATH/svc.sh" install && logg success 'Successfully installed the GitHub Actions runner service'
"${XDG_DATA_HOME:-$HOME/.local/share}/github-runner/svc.sh" install && logg success 'Successfully installed the GitHub Actions runner service'
logg info 'Starting runner service'
"$GH_RUNNER_PATH/svc.sh" start && logg success 'Started the GitHub Actions runner service'
"${XDG_DATA_HOME:-$HOME/.local/share}/github-runner/svc.sh" start && logg success 'Started the GitHub Actions runner service'
else
logg warn 'jq is required by the GitHub runner configuration script'
fi
@ -12888,7 +12888,7 @@ softwarePackages:
fi
fi
else
logg info "The GitHub Actions runner installation is not present at $GH_RUNNER_PATH"
logg info "The GitHub Actions runner installation is not present at ${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
fi
script: |
#!/usr/bin/env bash
@ -13954,6 +13954,7 @@ softwarePackages:
cargo:darwin: boringtun-cli
cargo:linux: boringtun-cli
wireguard-client:
_bin: wireguard-client
_deps:
- wireguard-tools
_desc: null