Skip to content
play

GitHub Action

Setup Fontist

v2.0.1 Latest version

Setup Fontist

play

Setup Fontist

πŸ”  Install Fontist for GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Fontist

uses: fontist/[email protected]

Learn more about this action in fontist/setup-fontist

Choose a version

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!