summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-04 20:24:56 +0500
committerEgor Tensin <egor@tensin.name>2026-10-04 20:24:56 +0500
commitc9e5790c9f1b0104695f7f6def820a176a2336d8 (patch)
tree9a7bb533d651fc84664dbb19eed29b937e7ca2e8
parentremove Vagrantfile (diff)
downloadconfig-links-c9e5790c9f1b0104695f7f6def820a176a2336d8.tar.gz
config-links-c9e5790c9f1b0104695f7f6def820a176a2336d8.zip
Makefile: move the setup steps from GitHub Actions workflow here
-rw-r--r--Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c58e716..e556803 100644
--- a/Makefile
+++ b/Makefile
@@ -57,3 +57,44 @@ maintenance: pkgver
echo '-----------------------------------------------------------------'; \
exit 1; \
fi
+
+.PHONY: ci/deps
+ci/deps:
+ @echo '============================================ CI: dependencies ==='
+ pacman -Syu --noconfirm git openssh
+
+# makepkg for no reason hard-forbids running as root. Kill me now.
+.PHONY: ci/user
+ci/user:
+ @echo '============================================ CI: builder user ==='
+ useradd -m -s /bin/bash builder
+ passwd -d builder
+ echo 'builder ALL=(ALL) ALL' >> /etc/sudoers
+ chown -R builder:builder -- "$$GITHUB_WORKSPACE"
+
+.PHONY: ci/ssh
+ci/ssh:
+ @echo '=========================================== CI: configure SSH ==='
+ mkdir -p /home/builder/.ssh/
+ echo 'StrictHostKeyChecking no' > /home/builder/.ssh/config
+ echo "$$SSH_KEY" > /home/builder/.ssh/id_ed25519
+ chown -R builder:builder /home/builder/.ssh
+ chmod 0600 /home/builder/.ssh/id_ed25519
+
+# See https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
+.PHONY: ci/git
+ci/git:
+ @echo '=========================================== CI: configure git ==='
+ runuser -u builder -- git -C "$$GITHUB_WORKSPACE" config user.name "github-actions[bot]"
+ runuser -u builder -- git -C "$$GITHUB_WORKSPACE" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+
+.PHONY: ci/setup
+ci/setup: ci/deps
+ci/setup: ci/user
+ci/setup: ci/ssh
+ci/setup: ci/git
+
+.PHONY: ci
+ci: ci/setup
+ci:
+ runuser -u builder -- $(MAKE) -C "$$GITHUB_WORKSPACE" maintenance