Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to install particular fonts #4

Open
ronaldtse opened this issue Jan 26, 2024 · 3 comments
Open

Add option to install particular fonts #4

ronaldtse opened this issue Jan 26, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

Right now the user needs to specify additional lines to install fonts, as in:

on: push
jobs:
  job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: fontist/setup@v1
      - run: fontist install "Fira Code"

It would be much better if we can specify the fonts to install directly:

      - uses: fontist/setup@v1
        with:
          fonts: Fira Code

GitHub Actions arguments only support string | number | boolean so we can't use an array, but multiple fonts can be specified using semicolons or commas (since ?

      - uses: fontist/setup@v1
        with:
          fonts: Fira Code, Inter
@ronaldtse ronaldtse added the enhancement New feature or request label Jan 26, 2024
@jcbhmr
Copy link
Collaborator

jcbhmr commented Jan 26, 2024

GitHub Actions arguments only support string | number | boolean so we can't use an array, but multiple fonts can be specified using semicolons or commas (since ?

I suggest multiline strings if you do in fact do this:

      - uses: fontist/setup@v1
        with:
          fonts: Fira Code
      - uses: fontist/setup@v1
        with:
          fonts: |
            Fira Code
            Inter

There's even a core method for it: core.getMultilineInput("input-name-here") https://www.npmjs.com/package/@actions/core

Examples from actions/cache and actions/upload-artifact:

    - name: Save Primes
      id: cache-primes-save
      uses: actions/cache/save@v4
      with:
        path: |
          path/to/dependencies
          some/other/dependencies
        key: ${{ steps.cache-primes-restore.outputs.cache-primary-key }}
- uses: actions/upload-artifact@v4
  with:
    name: my-artifact
    path: |
      path/output/bin/
      path/output/test-results
      !path/**/*.tmp

@jcbhmr
Copy link
Collaborator

jcbhmr commented Jan 26, 2024

I would be cautious about this. I haven't seen any other setup-$THING action install packages or things on-the-spot when setting up. So I don't know if they don't do it for a reason or something or what.

setup-node, setup-python, setup-ruby, etc. seem to always leave package installation (even global package installation) to either a package.json requirements.txt or Cargo.toml or whatever OR they rely on you to package-manager install --global $THING in your script. 🤷‍♂️ Just a thought. It'd also be shorter lol

# 3x lines
- uses: fontist/setup@v1
  with:
    fonts: Fira Code

vs

# 2x lines
- uses: fontist/setup@v1
- run: fontist install "Fira Code" 

also you could shorten it even more if fontist install supported a variable number of arguments like cargo add does or npm install does or pip install does. 🤷‍♂️

# 2x lines
- uses: fontist/setup@v1
- run: fontist install "Fira Code" "Inter" "Open Sans" "Consolas" "Arial" "Times New Roman"

vs

# lots of lines 🤷‍♂️
- uses: fontist/setup@v1
  with:
    fonts: |
      Fira Code
      Inter
      Open Sans
      Consolas
      Arial
      Times New Roman

@ronaldtse
Copy link
Contributor Author

setup-ruby does allow installing of gems through the Gemfile using bundler:

    steps:
    - uses: actions/checkout@v4
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true # runs 'bundle install' and caches installed gems automatically

We could use manifest.yaml for the same purpose, which is already defined here:

setup-fontist/action.yml

Lines 18 to 20 in 5922aae

cache-dependency-path:
description: 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.
default: manifest.y{a,}ml

What about something like this:

- uses: fontist/setup@v1
  with:
    manifest: true # The manifest is at manifest.y{a,}ml

As a side node, perhaps fontist.y{a,}ml would work better than manifest.y{a,}ml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: TRIAGE
Development

No branches or pull requests

3 participants