Skip to content

Commit

Permalink
Add release packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Dec 30, 2023
1 parent 96d65c0 commit 7f1f0c3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 13 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/rebuild-index.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Rebuild Index

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Setup
run: |
Expand All @@ -18,11 +16,15 @@ jobs:
--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/checkout@v1
- name: Rebuild
run: |
./compile.lisp
./compile.lisp fonts
./compile.lisp txt
./compile.lisp css
./compile.lisp web
- name: GH Pages deploy
if: github.head_ref == null
run: |
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create release
on: [create, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup
run: |
git config --global user.name "CI"
git config --global user.email "[email protected]"
sudo apt-get -qq install sbcl curl fontforge imagemagick
curl -o ~/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp
sbcl --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/checkout@v2
- name: Rebuild
run: |
./compile.lisp all
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: promptfont-${{ github.ref }}
path: promptfont.zip
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Release ${{ github.ref }}
artifacts: promptfont.zip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ promptfont.css
promptfont.ttf
promptfont.otf
promptfont.afm
*.png
*.png
*.zip
33 changes: 24 additions & 9 deletions compile.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -131,26 +131,41 @@ for file in argv[2:]:
(dolist (dir (directory (merge-pathnames "glyphs/*/" (file))))
(atlas (pathname-utils:directory-name dir))))))

(defun release (&optional (file (file "promptfont" "zip")))
(run "zip" "-j" file
(file "LICENSE" "txt")
(file "README" "md")
(file "index" "html")
(file "glyphs" "json")
(file "chars" "txt")
(file "promptfont" "ttf")
(file "promptfont" "otf")
(file "promptfont" "css")
(directory (file :wild "png"))))

(defun all ()
(fixup)
(fonts)
(txt)
(css)
(web))
(web)
(atlas)
(release))

(defun help ()
(format T "PromptFont data management utilities
Commands:
help --- Show this help screen
all --- Performs all below commands. This is run by default
fixup --- Fixes up the glyphs.json file
fonts --- Generates the promptfont.ttf and .otf files
help --- Show this help screen
all --- Performs all below commands. This is run by default
fixup --- Fixes up the glyphs.json file
fonts --- Generates the promptfont.ttf and .otf files
atlas [bank] [size]
--- Generates the glyph texture atlas files
txt --- Generates the chars.txt file
css --- Generates the promptfont.css file
web --- Generates the index.html file
--- Generates the glyph texture atlas files
txt --- Generates the chars.txt file
css --- Generates the promptfont.css file
web --- Generates the index.html file
release --- Generates a release zip
You typically do not need this utility as it is run automatically by
the GitHub CI when you create a PR.
Expand Down

0 comments on commit 7f1f0c3

Please sign in to comment.