aboutsummaryrefslogtreecommitdiff
path: root/yeetfile.js
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-04-04 08:15:04 -0400
committerGitHub <noreply@github.com>2025-04-04 08:15:04 -0400
commit878b37178d5b55046871ce53371eec5efb52cc78 (patch)
tree28341ab6cfb79a465f0e72318bfcb7cccb13d627 /yeetfile.js
parenta230a58a1d6d11d50846c6f788d3c04a42f2c6ce (diff)
downloadanubis-878b37178d5b55046871ce53371eec5efb52cc78.tar.xz
anubis-878b37178d5b55046871ce53371eec5efb52cc78.zip
implement packaging proof of concept with yeet (#194)
* implement packaging proof of concept with yeet Signed-off-by: Xe Iaso <me@xeiaso.net> * docs/developer: add local dev docs for yeet Signed-off-by: Xe Iaso <me@xeiaso.net> * apply review feedback Signed-off-by: Xe Iaso <me@xeiaso.net> * build package artifacts in CI Signed-off-by: Xe Iaso <me@xeiaso.net> * tell CI to fetch all git metadata Signed-off-by: Xe Iaso <me@xeiaso.net> * rename package builds job Signed-off-by: Xe Iaso <me@xeiaso.net> * upload each package individually Signed-off-by: Xe Iaso <me@xeiaso.net> * split package build CI jobs Signed-off-by: Xe Iaso <me@xeiaso.net> * fix code injection? Signed-off-by: Xe Iaso <me@xeiaso.net> * fix ci? Signed-off-by: Xe Iaso <me@xeiaso.net> * fix security alert Signed-off-by: Xe Iaso <me@xeiaso.net> * docs/local-dev: point people to yeet v1.13.3 Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'yeetfile.js')
-rw-r--r--yeetfile.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/yeetfile.js b/yeetfile.js
index 0dc9503..94388be 100644
--- a/yeetfile.js
+++ b/yeetfile.js
@@ -1,5 +1,7 @@
+$`npm run assets`;
+
["amd64", "arm64", "riscv64"].forEach(goarch => {
- [deb, rpm].forEach(method => method.build({
+ [deb, rpm, tarball].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://anubis.techaro.lol",
@@ -10,19 +12,16 @@
"./README.md": "README.md",
"./LICENSE": "LICENSE",
"./docs/docs/CHANGELOG.md": "CHANGELOG.md",
+ "./docs/docs/admin/policies.md": "policies.md",
+ "./docs/docs/admin/native-install.mdx": "native-install.mdx",
+ "./data/botPolicies.json": "botPolicies.json",
},
- 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`);
+ build: ({ bin, etc, systemd, out }) => {
+ $`go build -o ${bin}/anubis -ldflags '-s -w -extldflags "-static" -X "github.com/TecharoHQ/anubis.Version=${git.tag()}"' ./cmd/anubis`;
- // install default config
- yeet.run("mkdir", "-p", `${out}/etc/anubis`);
- yeet.run("cp", "run/anubis.env.default", `${out}/etc/anubis/anubis-default.env`);
+ file.install("./run/anubis@.service", `${systemd}/anubis@.service`);
+ file.install("./run/default.env", `${etc}/default.env`);
},
}));
}); \ No newline at end of file