From a54a0810429a585ea736076b1f84034726f8907d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 4 Feb 2023 18:27:55 -0800 Subject: [PATCH] Add a build manifest for generating the README for sourcehut --- .builds/readme.yml | 27 +++++++++++++++++++++++++++ Makefile | 6 ++++++ 2 files changed, 33 insertions(+) create mode 100644 .builds/readme.yml diff --git a/.builds/readme.yml b/.builds/readme.yml new file mode 100644 index 0000000..9ff788f --- /dev/null +++ b/.builds/readme.yml @@ -0,0 +1,27 @@ +image: alpine/latest +packages: + - make + - emacs-nox + - jq +secrets: + - 45c41227-eb85-4831-942f-12b840504f6c +tasks: + - build: | + cd vc-p4 + make README.html + - readme: | + cd vc-p4 + set +x + repo_id=264869 + readme=README.html + jq -sR '{ + "query": "mutation UpdateRepo($id: Int!, $readme: String!) { + updateRepository(id: $id, input: { readme: $readme }) { id } + }", "variables": { + "id": '$repo_id', + "readme": . + } + }' < $readme \ + | curl --oauth2-bearer <(~/.vc-p4-auth) \ + -H "Content-Type: application/json" \ + -d@- https://git.sr.ht/query diff --git a/Makefile b/Makefile index 28eb8d5..03ad1ff 100644 --- a/Makefile +++ b/Makefile @@ -21,3 +21,9 @@ $(NAME)-pkg.el: clean: rm -rf $(NAME)-pkg.el $(NAME)-$(VERSION).tar $(FULLNAME)/ + +README.html: README.org + emacs --batch --quick \ + --eval "(require 'ox-html)" \ + --visit $< \ + --eval "(org-html-export-to-html nil nil nil t)"