Commit 7159f3c1bf
7159f3c1bfc61ef36f3dc60396a155280cbfa536
parent: bf27b6228f
Verified · cmc
cmc <hello@cleberg.net> · 2026-03-23 16:24 UTC
attempt to fix builds
Layout: unified · split
.build.yml
+5 −1
| @@ -4,6 +4,9 @@ packages: |
| 4 | - emacs-nox |
4 | - emacs-nox |
| 5 | - rsync |
5 | - rsync |
| 6 | - openssh-client |
6 | - openssh-client |
| |
7 | - git |
| |
8 | - curl |
| |
9 | - tar |
| 7 | |
10 | |
| 8 | sources: |
11 | sources: |
| 9 | - https://git.sr.ht/~ccleberg/cleberg.net |
12 | - https://git.sr.ht/~ccleberg/cleberg.net |
| @@ -18,6 +21,7 @@ environment: |
| 18 | tasks: |
21 | tasks: |
| 19 | - setup: | |
22 | - setup: | |
| 20 | curl -LsSf https://astral.sh/uv/install.sh | sh |
23 | curl -LsSf https://astral.sh/uv/install.sh | sh |
| |
24 | mkdir -p ~/.local/bin |
| 21 | curl -sSfL https://github.com/tdewolff/minify/releases/latest/download/minify_linux_amd64.tar.gz \ |
25 | curl -sSfL https://github.com/tdewolff/minify/releases/latest/download/minify_linux_amd64.tar.gz \ |
| 22 | | tar -xz -C ~/.local/bin minify |
26 | | tar -xz -C ~/.local/bin minify |
| 23 | mkdir -p ~/.config/emacs/.local/straight/repos |
27 | mkdir -p ~/.config/emacs/.local/straight/repos |
| @@ -30,7 +34,7 @@ tasks: |
| 30 | - build: | |
34 | - build: | |
| 31 | source ~/.local/bin/env |
35 | source ~/.local/bin/env |
| 32 | cd cleberg.net |
36 | cd cleberg.net |
| 33 | uv run build.py |
37 | uv run python3 -u build.py |
| 34 | - deploy: | |
38 | - deploy: | |
| 35 | cd cleberg.net |
39 | cd cleberg.net |
| 36 | chmod 600 ~/.ssh/id_rsa |
40 | chmod 600 ~/.ssh/id_rsa |
build.py
+11 −18
| @@ -247,26 +247,19 @@ def minify_html(src_html, dest_html): |
| 247 | |
247 | |
| 248 | |
248 | |
| 249 | def run_emacs_publish(dev_mode=True): |
249 | def run_emacs_publish(dev_mode=True): |
| 250 | if dev_mode: |
250 | mode = "development" if dev_mode else "production" |
| 251 | print("Running Emacs publish script (development)...") |
251 | print(f"Running Emacs publish script ({mode})...") |
| 252 | result = subprocess.run( |
252 | |
| 253 | ["emacs", "--script", "publish.el"], |
253 | result = subprocess.run( |
| 254 | stdout=subprocess.PIPE, |
254 | ["emacs", "--script", "publish.el"], |
| 255 | stderr=subprocess.PIPE, |
255 | stdout=subprocess.PIPE, |
| 256 | text=True, |
256 | stderr=subprocess.STDOUT, |
| 257 | ) |
257 | text=True, |
| 258 | else: |
258 | ) |
| 259 | print("Running Emacs publish script (production)...") |
| |
| 260 | result = subprocess.run( |
| |
| 261 | ["emacs", "--script", "publish.el"], |
| |
| 262 | stdout=subprocess.DEVNULL, |
| |
| 263 | stderr=subprocess.DEVNULL, |
| |
| 264 | text=True, |
| |
| 265 | ) |
| |
| 266 | |
259 | |
| 267 | if result.returncode != 0: |
260 | if result.returncode != 0: |
| 268 | print("Error running publish.el:") |
261 | print("Error running publish.el output:") |
| 269 | print(result.stderr, file=sys.stderr) |
262 | print(result.stdout) |
| 270 | sys.exit(1) |
263 | sys.exit(1) |
| 271 | |
264 | |
| 272 | annoying_file = Path(".build/cleberg-net.html") |
265 | annoying_file = Path(".build/cleberg-net.html") |
publish.el
+3
| @@ -1,4 +1,6 @@ |
| 1 | ;;; -*- lexical-binding: t -*- |
1 | ;;; -*- lexical-binding: t -*- |
| |
2 | (setq debug-on-error t) |
| |
3 | |
| 2 | ;; Allow for macOS (dev machine) & Linux (GitHub Actions) execution |
4 | ;; Allow for macOS (dev machine) & Linux (GitHub Actions) execution |
| 3 | (defvar site-lisp-base |
5 | (defvar site-lisp-base |
| 4 | (expand-file-name "~/.config/emacs/.local/straight/repos")) |
6 | (expand-file-name "~/.config/emacs/.local/straight/repos")) |
| @@ -9,6 +11,7 @@ |
| 9 | (add-to-list 'load-path (expand-file-name "templatel" site-lisp-base)) |
11 | (add-to-list 'load-path (expand-file-name "templatel" site-lisp-base)) |
| 10 | |
12 | |
| 11 | (require 'htmlize) |
13 | (require 'htmlize) |
| |
14 | (require 'templatel) |
| 12 | (require 'weblorg) |
15 | (require 'weblorg) |
| 13 | |
16 | |
| 14 | ;; Set default URL for Weblorg |
17 | ;; Set default URL for Weblorg |