https://github.com/fontist/setup-fontist
🔠 Install Fontist for GitHub Actions
https://github.com/fontist/setup-fontist
action fontist fonts github-action github-actions google-fonts installer ruby setup-action setup-actions
Last synced: 10 months ago
JSON representation
🔠 Install Fontist for GitHub Actions
- Host: GitHub
- URL: https://github.com/fontist/setup-fontist
- Owner: fontist
- License: mit
- Created: 2024-01-24T23:18:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-10T19:03:53.000Z (over 2 years ago)
- Last Synced: 2024-02-11T18:48:56.892Z (over 2 years ago)
- Topics: action, fontist, fonts, github-action, github-actions, google-fonts, installer, ruby, setup-action, setup-actions
- Language: JavaScript
- Homepage:
- Size: 706 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setup Fontist
🔠 Install [Fontist](https://www.fontist.org/) for GitHub Actions
```yml
- 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


**🚀 Here's what you're after:**
```yml
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](https://www.npmjs.com/package/@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



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](https://www.npmjs.com/package/@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](https://github.com/oven-sh/bun/issues/43) 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 ` 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](https://github.com/typst-community/typst.js)
and contributed to [Fontist](https://www.fontist.org).
Huge thanks to @jcbhmr for the tremendous effort in improving the Fontist
ecosystem!