diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 914d771..6f5222c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,29 +5,58 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Setup + - name: Restore cache + id: cache + uses: actions/cache@v3 + with: + path: | + ~/quicklisp/ + ~/.wine/ + ~/trial-deproyment/ + key: ${{ runner.os }} + restore-keys: ${{ runner.os }} + - name: Install packages run: | git config --global user.name "CI" git config --global user.email "shinmera@tymoon.eu" - sudo apt-get -qq install sbcl curl fontforge imagemagick inkscape + sudo apt-get -qq install wine curl fontforge imagemagick inkscape --no-install-recommends + - name: Install env + if: steps.cache.outputs.cache-hit != 'true' + run: | + git clone --depth 1 https://gitea.tymoon.eu/Shirakumo/trial-deployment.git ~/trial-deployment curl -o ~/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp - sbcl --load ~/quicklisp.lisp \ + ~/trial-deployment/sbcl-lin \ + --load ~/quicklisp.lisp \ + --eval '(quicklisp-quickstart:install)' \ + --eval '(ql-util:without-prompting (ql:add-to-init-file))' \ + --eval '(ql:quickload :shasht)' \ + --eval '(ql:quickload :clip)' \ + --eval '(ql:quickload :pathname-utils)' \ + --quit + ~/trial-deployment/sbcl-win \ + --load ~/quicklisp.lisp \ --eval '(quicklisp-quickstart:install)' \ --eval '(ql-util:without-prompting (ql:add-to-init-file))' \ --eval '(ql:quickload :shasht)' \ --eval '(ql:quickload :clip)' \ --eval '(ql:quickload :pathname-utils)' \ --quit - - uses: actions/cache@v3 - with: - path: | - ~/quicklisp/ - key: ${{ runner.os }} - restore-keys: ${{ runner.os }} - uses: actions/checkout@v2 - name: Rebuild run: | - ./compile.lisp all + ~/trial-deployment/sbcl-lin \ + --noinform \ + --disable-debugger \ + --eval "(ql:quickload '(clip shasht pathname-utils) :silent T)" \ + --load "compile.lisp" \ + --eval '(promptfont-compiler::dump)' + ~/trial-deployment/sbcl-win \ + --noinform \ + --disable-debugger \ + --eval "(ql:quickload '(clip shasht pathname-utils) :silent T)" \ + --load "compile.lisp" \ + --eval '(promptfont-compiler::dump)' + ./promptfont.run all - name: Upload artifact uses: actions/upload-artifact@v1 with: diff --git a/.gitignore b/.gitignore index f255132..62a21d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,6 @@ *.sfd-* index.html chars.txt -promptfont.css -promptfont.ttf -promptfont.otf -promptfont.afm -promptfont.txt -promptfont.h -promptfont.cs -promptfont.py -promptfont.lisp -promptfont.lua -promptfont.rs -promptfont.gd -promptfont-compiler.* +promptfont.* *.png *.zip diff --git a/compile.lisp b/compile.lisp index d43b497..b221180 100755 --- a/compile.lisp +++ b/compile.lisp @@ -34,9 +34,10 @@ exec sbcl \ (real (princ-to-string arg))))) (apply #'uiop:run-program (list* program (loop for arg in program-args - append (if (listp arg) - (mapcar #'normalize arg) - (list (normalize arg))))) + append (typecase arg + (null ()) + (list (mapcar #'normalize arg)) + (T (list (normalize arg)))))) args)))) (defun outdated-p (out in) @@ -290,6 +291,9 @@ for file in argv[2:]: (file "promptfont" "lua") (file "promptfont" "rs") (file "promptfont" "gd") + (probe-file (file "promptfont" "run")) + (probe-file (file "promptfont" "exe")) + (probe-file (file "promptfont" "o")) (directory (file :wild "png")))) (defun query (&rest glyphs) @@ -346,13 +350,6 @@ Tags: ~12t~{~a~^, ~}~%~%" (dolist (command (or commands '(fixup fonts txt css h cs py lisp lua rs gd web atlas release))) (run-command command))) -(defun dump () - (sb-ext:save-lisp-and-die - (file "promptfont-compiler" #+win32 "exe" #+linux "run" #-(or win32 linux) "o") - :toplevel #'main - :executable T - :compression T)) - (defun help () (format T "PromptFont data management utilities by Yukari \"Shinmera\" Hafner @@ -378,28 +375,20 @@ Compile Data: --- Generates the glyph texture atlas files Defaults to all banks and size of 64 - txt --- Generates the promptfont.txt file - - css --- Generates the promptfont.css file - - h --- Generates the promptfont.h file - - cs --- Generates the promptfont.cs file - - py --- Generates the promptfont.py file - - lisp --- Generates the promptfont.lisp file - - lua --- Generates the promptfont.lua file - - rs --- Generates the promptfont.rs file - - gd --- Generates the promptfont.gd file - web --- Generates the index.html file release --- Generates a release zip + txt --- Generate the respective glyph mapping source file + css + h + cs + py + lisp + lua + rs + gd + You typically do not need this utility as it is run automatically by the GitHub CI when you create a PR. @@ -407,6 +396,13 @@ https://shinmera.com/promptfont " (uiop:argv0))) (defun main () - (destructuring-bind (argv0 &optional (command "all") &rest args) (uiop:raw-command-line-arguments) + (destructuring-bind (argv0 &optional (command "help") &rest args) (uiop:raw-command-line-arguments) (declare (ignore argv0)) (apply #'run-command command args))) + +(defun dump () + (sb-ext:save-lisp-and-die + (file "promptfont" #+win32 "exe" #+linux "run" #-(or win32 linux) "o") + :toplevel #'main + :executable T + :compression 22))