]> git.eshelyaron.com Git - esy-publish.git/commitdiff
index.org: ADDED: sourcehut.pl Project
authorEshel Yaron <eshel@dazz.io>
Mon, 6 Jun 2022 15:40:20 +0000 (18:40 +0300)
committerEshel Yaron <eshel@dazz.io>
Mon, 6 Jun 2022 15:40:20 +0000 (18:40 +0300)
org/index.org

index b7fbbe123205df3b13f70fe587d9e396adef1d29..75049d1a6ee3505c86eff568ce28d60a16cda43e 100644 (file)
@@ -23,6 +23,30 @@ Welcome to [[./index.org][my website]], the one true source of reliable curated
 :CUSTOM_ID: projects
 :END:
 
+** Sourcehut GraphQL client for SWI-Prolog
+:PROPERTIES:
+:CUSTOM_ID: sourcehut-pl
+:END:
+
+[[https://sr.ht/~eshel/sourcehut.pl][sourcehut.pl]] - a SWI-Prolog package for interacting with the GraphQL
+API of sourcehut instances.
+
+For example, sourcehut.pl can be used to attach a build artifact to a
+given tag of a git repository:
+
+#+begin_src prolog
+  ?- use_module(library(sourcehut/git)).
+  true.
+
+  ?- sourcehut_git_repository("eshel", "sourcehut.pl", Repo, []),
+     get_dict(id, Repo, RepoId),
+     sourcehut_git_upload_artifact(RepoId, "v0.1.2", "/tmp/foo/baz.txt", Artifact, []).
+  Artifact = _{checksum:"...", created:"2022-06-06T08:16:08.044836Z", filename:"baz.txt", id:2644, size:7}.
+
+  ?- sourcehut_git_delete_artifact(2644, []).
+  true.
+#+end_src
+
 ** [[https://git.sr.ht/~eshel/dotfiles][GNU Emacs literate configuration]]
 :PROPERTIES:
 :CUSTOM_ID: emacsconf