laminar-config: Fix uploading package to forgejo

‘with-env’ doesn't appear to work, so I had to implement my own interpretation
of it.
This commit is contained in:
Tom Willemse 2025-01-04 00:59:37 -08:00
parent a149e642e3
commit 7413f453c9

View file

@ -7,12 +7,13 @@ exec scsh -e main -s "$0" "$@"
(run (git clone --depth 1 https://code.ryuslash.org/ryuslash/laminar-config.git)) (run (git clone --depth 1 https://code.ryuslash.org/ryuslash/laminar-config.git))
(with-cwd "laminar-config" (with-cwd "laminar-config"
(run (makepkg)) (run (makepkg))
(with-env (call-with-input-file "../secrets/laminar-config" (for-each (lambda (pair) (setenv (car pair) (cdr pair)))
(call-with-input-file "/var/lib/laminar/cfg/secrets/laminar-config"
(lambda (port) (lambda (port)
(read port))) (read port))))
(run (curl -X PUT "https://code.ryuslash.org/api/packages/ryuslash/arch/extras" (run (curl -X PUT "https://code.ryuslash.org/api/packages/ryuslash/arch/laminar-config"
--user ,(format #f "~a:~a" --user ,(format #f "~a:~a"
(getenv "UPLOAD_USER") (getenv "UPLOAD_USER")
(getenv "UPLOAD_TOKEN")) (getenv "UPLOAD_TOKEN"))
--header "Content-Type: application/octet-stream" --header "Content-Type: application/octet-stream"
--data-binary ,(format #f "@~a" (car (glob "*.pkg.tar.zst")))))))) --data-binary ,(format #f "@~a" (car (glob "*.pkg.tar.zst")))))))