๐ Install Fontist for GitHub Actions
- uses: fontist/setup-fontist@v2
- run: fontist install "Fira Code" |
๐ Uses Ruby to install the fontist Ruby gem
๐ฆ Works with Windows
๐ง Works with Ubuntu
๐ Works with macOS
โก Caches installation in $RUNNER_TOOL_CACHE
and/ior the workflow cache
๐ Caches ~/.fontist
font installs by default using manifest.yml
๐ Here's what you're after:
on: push
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fontist/setup-fontist@v2
- run: fontist install "Fira Code"
๐ก You can use fontist manifest-install manifest.yml
to install fonts listed in a manifest file similar to package.json
, requirements.txt
, and Cargo.toml
.
-
fontist-version
: The version of Fontist to install. This can be an exact version lile1.10.0
or a semver range such as1.x
or~1.15.0
. The default value islatest
. -
fontist-token
: The GitHub token to use when fetching the version list from fontist/fontist. You shouldn't have to touch this. The default is thegithub.token
if you're on github.com or unauthenticated (rate limited) if you're not on github.com. -
cache
: Whether or not to use @actions/cache to cache things in the GitHub workflow cache. This is enabled by default. -
cache-dependency-path
: A multiline list of globs to use to derive the~/.fontist
cache key. The default ismanifest.yml
andmanifest.yaml
. If no files are matched at runtime then the~/.fontist
folder will not be cached.
-
fontist-version
: The version of Fontist that was installed. This will be something like1.10.0
or similar. -
cache-hit
: Whether or not Fontist was restored from the runner's cache or newly downloaded.
This action tries to restore the result of gem install fontist
from both the $RUNNER_TOOL_CACHE
as well as the workflow cache via @actions/cache. It then tries to restore the ~/.fontist
folder local cache from the workflow cache.
How do I test it?
Open a PR (even a draft one works) and some magic GitHub Actions will run to test your changes.
Note that since Bun doesn't support Windows yet we can't run the bun build
command on Windows runners. Don't worry! The action should still work ok since Bun is only used for the build step; it runs using node <the-js-file>
via using: node20
in both testing and releases. Once Bun adds Windows support remember to add back the Windows tests. ๐
This GitHub Action was originally created by @jcbhmr for the Typst project and contributed to Fontist.
Huge thanks to @jcbhmr for the tremendous effort in improving the Fontist ecosystem!