From ba5d9c29f3defd28c5973d257a86f910deb78986 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 23 Mar 2022 19:05:29 -0700 Subject: [PATCH] Set up automated builds on Sourcehut This builds both a package archive and the readme. --- .build/pages.yml | 17 +++++++++++++++++ .build/readme.yml | 20 ++++++++++++++++++++ .gitignore | 3 +++ Makefile | 29 +++++++++++++++++++++++++++++ README.org | 17 +++++++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 .build/pages.yml create mode 100644 .build/readme.yml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.org diff --git a/.build/pages.yml b/.build/pages.yml new file mode 100644 index 0000000..c86a3ee --- /dev/null +++ b/.build/pages.yml @@ -0,0 +1,17 @@ +image: alpine/latest +oauth: pages.sr.ht/PAGES:RW +packages: + - make + - emacs-nox + - git +tasks: + - stamp-version: | + cd tekuti-el + make stamp-version + - package: | + cd tekuti-el + make package + - upload: | + cd tekuti-el + acurl -f "https://pages.sr.ht/publish/ryuslash.srht.site/pcomplete-p4/elpa/" \ + -Fcontent=@pcomplete-p4.tar.gz diff --git a/.build/readme.yml b/.build/readme.yml new file mode 100644 index 0000000..32deacc --- /dev/null +++ b/.build/readme.yml @@ -0,0 +1,20 @@ +image: alpine/latest +packages: + - make + - emacs-nox +secrets: + - 71a00305-bdc9-4108-84a0-2d42d5f824d6 +tasks: + - build: | + cd tekuti-el + make README.html + - readme: | + cd tekuti-el + set +x + curl --fail-with-body \ + -H "Content-Type: text/html" \ + -H "Authorization: Bearer $(cat ~/.pcomplete-p4-auth)" \ + -XPUT \ + --data-binary @README.html \ + 'https://git.sr.ht/api/repos/tekuti-el/readme' \ + && echo "README set" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cff565e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/dist/ +/*.tar.gz +/README.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4cbef87 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +SITE := ryuslash.srht.site +CURL := curl + +.PHONY: stamp-version + +stamp-version: + version=$$(git log -1 --format="%cd" --date=format:%Y.%m%d.%H%M); \ + sed -i "s/\(;; Version\): .*/\1: $$version/" tekuti.el + +package: + mkdir -p dist + emacs --batch --quick \ + --eval "(require 'package-x)" \ + --eval "(setq package-archive-upload-base \"dist\")" \ + --eval "(package-upload-file \"tekuti.el\")" + cd dist && tar cvzf ../tekuti.tar.gz . + +README.html: README.org + emacs --batch --quick \ + --eval "(require 'ox-html)" \ + --visit $< \ + --eval "(org-html-export-to-html nil nil nil t)" \ + +upload: + $(CURL) -f "https://pages.sr.ht/publish/$(SITE)/tekuti/elpa/" \ + -Fcontent=@tekuti.tar.gz + +clean: + rm -rfv README.html dist tekuti.tar.gz diff --git a/README.org b/README.org new file mode 100644 index 0000000..25d0f7d --- /dev/null +++ b/README.org @@ -0,0 +1,17 @@ +#+TITLE: tekuti-el +#+SUBTITLE: Emacs interface to tekuti +#+OPTIONS: num:nil + +This project is meant to help make posting and maintaining blog posts from Emacs to [[https://wingolog.org/projects/tekuti/][tekuti]]. + +* Installation + +If you want to try out this project, you can install it in Emacs through ELPA by adding the development archive for this project into your =package-archives=: + +#+begin_src emacs-lisp + (add-to-list 'package-archives + '("tekuti-el" + . "https://ryuslash.srht.site/tekuti/elpa/")) +#+end_src + +Then run =list-packages= in Emacs and the package should pop up.