Skip to content

๐Ÿ”  Install Fontist for GitHub Actions

License

Notifications You must be signed in to change notification settings

fontist/setup-fontist

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

67 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Setup Fontist

๐Ÿ”  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

Usage

GitHub Actions GitHub

๐Ÿš€ 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.

Inputs

  • fontist-version: The version of Fontist to install. This can be an exact version lile 1.10.0 or a semver range such as 1.x or ~1.15.0. The default value is latest.

  • 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 the github.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 is manifest.yml and manifest.yaml. If no files are matched at runtime then the ~/.fontist folder will not be cached.

Outputs

  • fontist-version: The version of Fontist that was installed. This will be something like 1.10.0 or similar.

  • cache-hit: Whether or not Fontist was restored from the runner's cache or newly downloaded.

Development

Bun Node.js Ruby

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. ๐Ÿ˜‰

Contributions

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!