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

Allow specifying the name of the installed Typst executable #21

Closed
SillyFreak opened this issue Jun 7, 2024 · 5 comments
Closed

Allow specifying the name of the installed Typst executable #21

SillyFreak opened this issue Jun 7, 2024 · 5 comments

Comments

@SillyFreak
Copy link

this action adds typst to the path; for testing packages with multiple Typst versions it would be desirable that different versions could be installed under different executable names, to that in the end for example typst and typst-0.10 end up on the Path.

I can imagine a few different ways this could work:

  • add a parameter like executable-name that you could set to typst-0.10. If specified, the executable is renamed
  • add a parameter like use-version-suffix that you could set to true. If true, either
    • rename the executable
    • add a symlink that uses typst-version for the suffix
    • add symlinks for all prefixes of the actual resolved version number, e.g. 0, 0.10 and 0.10.0
  • always add these symlinks; they don't hurt, even if the executable is used through the name typst. As each invocation of setup-typst prepends an entry to the path, the last one will determine the version found under the name typst
@jamesrswift
Copy link
Member

Wouldn't mind a main build too

@SillyFreak
Copy link
Author

you mean in addition to "latest" and version tags? and with suffix that would be typst-main?

@jcbhmr
Copy link
Member

jcbhmr commented Jun 8, 2024

For reference the way this is done with other setup-node and setup-python actions is to execute the tests on each version either in parallel across multiple jobs or sequentially by re-applying setup-node again and again after each test.

Example using multiple jobs via a matrix 🌟 this is the most popular way I've seen

jobs:
  test-it:
    strategy:
      matrix:
        node-version: ["18", "20", "22"]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: npm test

Example using multiple applications of setup-node; unsure if setup-typst currently works with this pattern

jobs:
  test-it:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: "18"
      - run: npm ci
      - run: npm test
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - run: npm test
      - uses: actions/setup-node@v4
        with:
          node-version: "22"
      - run: npm test

@SillyFreak
Copy link
Author

ah, I completely forgot configuration matrices; I'll try it this way.

@SillyFreak
Copy link
Author

Using a matrix is IMO sufficient and superior, so I'll close this. As an example, I'm adding this in the package template here: typst-community/typst-package-template#9

@SillyFreak SillyFreak closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants