summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Wienke2021-10-02 19:18:29 +0200
committerJohannes Wienke2021-10-02 19:18:29 +0200
commit4711bb2fabc68940fd07afa522397e885132d26d (patch)
tree30cc21b4b4337be8a5de18555ea7084e4487dc94
parent2a9ce3b803201b486763299dd7a5cdef57d85c0d (diff)
downloadaur-4711bb2fabc68940fd07afa522397e885132d26d.tar.gz
ci: add a renovate config
-rwxr-xr-xpost-update.sh24
-rw-r--r--renovate.json25
2 files changed, 49 insertions, 0 deletions
diff --git a/post-update.sh b/post-update.sh
new file mode 100755
index 000000000000..c2516ee42c40
--- /dev/null
+++ b/post-update.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -exuo pipefail
+
+uid="$(id -u)"
+
+# Move pkgrel back to 1 after a version bump
+sed -i 's/pkgrel=.*/pkgrel=1/' ./PKGBUILD
+
+# Update checksums and the .SRCINFO file to match the new version.
+# The easiest and most consistent way to do this is by using the
+# archlinux-provided tools for this. Because renovate doesn't run in an arch
+# container, use docker to spin up a temporary container for this purpose.
+# makepkg in this container cannot be run as root. Therefore, create a
+# temporary user for this. This used need to use the UID of the host's user to
+# avoid file access problems when using bind mounts in docker.
+docker run --rm -v "$(pwd):/pkg" archlinux:latest bash -c "
+set -exuo pipefail
+pacman -Syu --noconfirm pacman-contrib binutils
+useradd -u ${uid} builder
+cd /pkg
+su builder -c updpkgsums
+su builder -c 'makepkg --printsrcinfo > .SRCINFO'
+"
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 000000000000..f364a7e2a385
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+
+ "extends": ["config:base"],
+
+ "assignees": ["languitar"],
+ "reviewers": ["languitar"],
+
+ "postUpgradeTasks": {
+ "commands": ["./post-update.sh"],
+ "fileFilters": ["PKGBUILD", ".SRCINFO"],
+ "executionMode": "branch"
+ },
+
+ "regexManagers": [
+ {
+ "fileMatch": ["^PKGBUILD$"],
+ "matchStrings": [
+ "pkgver=(?<currentValue>.*?)\n"
+ ],
+ "depNameTemplate": "tkem/uritools",
+ "datasourceTemplate": "github-tags"
+ }
+ ]
+}