浏览代码

yeetfile: build debian packages

Signed-off-by: Xe Iaso <me@xeiaso.net>
Xe Iaso 2 月之前
父节点
当前提交
bb4f49cfd9
共有 2 个文件被更改,包括 20 次插入17 次删除
  1. 1 0
      .gitignore
  2. 19 17
      yeetfile.js

+ 1 - 0
.gitignore

@@ -1,4 +1,5 @@
 .env
 .env
+*.deb
 *.rpm
 *.rpm
 
 
 # Go binaries and test artifacts
 # Go binaries and test artifacts

+ 19 - 17
yeetfile.js

@@ -1,22 +1,24 @@
 go.install();
 go.install();
 
 
-["amd64", "arm64"].forEach(goarch => rpm.build({
-    name: "anubis",
-    description: "Anubis weighs the souls of incoming HTTP requests and uses a sha256 proof-of-work challenge in order to protect upstream resources from scraper bots.",
-    homepage: "https://xeiaso.net/blog/2025/anubis",
-    license: "MIT",
-    goarch,
+["amd64", "arm64"].forEach(goarch => {
+    [deb, rpm].forEach(method => method.build({
+        name: "anubis",
+        description: "Anubis weighs the souls of incoming HTTP requests and uses a sha256 proof-of-work challenge in order to protect upstream resources from scraper bots.",
+        homepage: "https://xeiaso.net/blog/2025/anubis",
+        license: "MIT",
+        goarch,
 
 
-    build: (out) => {
-        // install Anubis binary
-        go.build("-o", `${out}/usr/bin/anubis`);
+        build: (out) => {
+            // install Anubis binary
+            go.build("-o", `${out}/usr/bin/anubis`, "./cmd/anubis");
 
 
-        // install systemd unit
-        yeet.run("mkdir", "-p", `${out}/usr/lib/systemd/system`);
-        yeet.run("cp", "run/anubis@.service", `${out}/usr/lib/systemd/system/anubis@.service`);
+            // install systemd unit
+            yeet.run("mkdir", "-p", `${out}/usr/lib/systemd/system`);
+            yeet.run("cp", "run/anubis@.service", `${out}/usr/lib/systemd/system/anubis@.service`);
 
 
-        // install default config
-        yeet.run("mkdir", "-p", `${out}/etc/anubis`);
-        yeet.run("cp", "run/anubis.env.default", `${out}/etc/anubis/anubis-default.env`);
-    },
-}));
+            // install default config
+            yeet.run("mkdir", "-p", `${out}/etc/anubis`);
+            yeet.run("cp", "run/anubis.env.default", `${out}/etc/anubis/anubis-default.env`);
+        },
+    }));
+});