{"id":13523014,"url":"https://github.com/typst-community/setup-typst","last_synced_at":"2026-03-15T08:57:16.479Z","repository":{"id":152949925,"uuid":"625450644","full_name":"typst-community/setup-typst","owner":"typst-community","description":"📑 Install Typst for use in GitHub Actions","archived":false,"fork":false,"pushed_at":"2024-02-11T13:36:40.000Z","size":1003,"stargazers_count":113,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T11:39:17.752Z","etag":null,"topics":["action","compiler","github-actions","installer","markup","typesetting","typst"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/setup-typst","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typst-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-09T06:22:39.000Z","updated_at":"2024-10-17T13:57:05.000Z","dependencies_parsed_at":"2024-02-08T01:40:41.054Z","dependency_job_id":"7747070d-7179-4995-881f-8faefbd0ebb6","html_url":"https://github.com/typst-community/setup-typst","commit_stats":null,"previous_names":["typst-community/setup-typst","yusancky/setup-typst"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Fsetup-typst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Fsetup-typst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Fsetup-typst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Fsetup-typst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typst-community","download_url":"https://codeload.github.com/typst-community/setup-typst/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248856038,"owners_count":21172683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","compiler","github-actions","installer","markup","typesetting","typst"],"created_at":"2024-08-01T06:00:54.643Z","updated_at":"2026-03-15T08:57:16.472Z","avatar_url":"https://github.com/typst-community.png","language":"JavaScript","funding_links":[],"categories":["Integrations \u0026 Tools"],"sub_categories":["CI/CD"],"readme":"\u003cp align=center\u003e\n  \u003cb\u003eEnglish\u003c/b\u003e | \u003ca href=\"https://github.com/typst-community/setup-typst/blob/main/README_zh-Hans-CN.md\" hreflang=\"zh-Hans-CN\" lang=\"zh-Hans-CN\"\u003e简体中文\u003c/a\u003e\n\u003c/p\u003e\n\n# Setup Typst\n\nThis action provides the following functionality for GitHub Actions users:\n\n- **Installing** a version of [Typst] and adding it to the PATH\n- **Caching** [packages] dependencies\n- **Downloading** ZIP archives as packages\n\n```yaml\n- uses: typst-community/setup-typst@v5\n- run: typst compile paper.typ paper.pdf\n```\n\n## Usage\n\n### Basic Usage\n\n```yaml\nname: Render paper.pdf\non: push\njobs:\n  render-paper:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: typst-community/setup-typst@v5\n      # 🎉 Now Typst is installed!\n      - run: typst compile paper.typ paper.pdf\n```\n\n### Inputs\n\n#### Installing A Typst Version\n\n- **`typst-version`:** Version range or exact version of Typst to use, using SemVer's version range syntax. Uses the latest version if unset.\n- **`allow-prereleases`:** When `true`, a version range including `latest` passed to `typst-version` input will match prerelease versions.\n  **`executable-name`:** Used to specify the executable file name of Typst.\n\n```yaml\n# Example 1\n- uses: typst-community/setup-typst@v5\n  with:\n    typst-version: ^0.14.0\n\n# Example 2\n- uses: typst-community/setup-typst@v5\n  with:\n    typst-version: 0.14.0-rc1\n    allow-prereleases: true\n\n# Example 3\n- uses: typst-community/setup-typst@v5\n  with:\n    executable-name: typst-latest\n```\n\n\u003e [!TIP]\n\u003e\n\u003e - `executable-name` defaults to `typst`.\n\u003e - A Typst executable named `typst-${version}` is always kept.\n\u003e - For Windows, there is no need to include the executable file extension `.exe` in the parameters.\n\u003e - Multiple distinct `executable-name` values can be set for the same Typst version.\n\u003e - Setting the same `executable-name` (including the default `typst`) for different Typst versions is **not recommended**, as it may lead to version management confusion.\n\n#### Installing Multiple Typst Versions\n\n**`typst-versions-map`:** Used to specify a JSON map of executable names to Typst version configurations, for installing multiple Typst versions at once. Each value is an object with a required `version` field and an optional `allowPrerelease` field.\n\n\u003e [!NOTE]\n\u003e\n\u003e When `typst-versions-map` is set, `typst-version` and `executable-name` are **ignored**. The `allow-prereleases` input is used as the **default value** for all entries in the map, but can be **overridden** by `allowPrerelease` in each individual config object.\n\n```yaml\n- uses: typst-community/setup-typst@v5\n  with:\n    typst-versions-map: |\n      {\n        \"typst-latest\": {\"version\": \"latest\"},\n        \"typst-013\": {\n          \"version\": \"v0.13\",\n          \"allowPrerelease\": true\n        }\n      }\n```\n\n#### Managing Packages with Cache\n\n**`cache-dependency-path`:** Used to specify the path to a Typst file containing lines of `import` keyword.\n\n```yaml\n# Example workflow YAML file\n- uses: typst-community/setup-typst@v5\n  with:\n    cache-dependency-path: requirements.typ\n```\n\n```typst\n// Example Typst file (requirements.typ)\n#import \"@preview/example:0.1.0\": *\n```\n\n#### ZIP Archive Packages Management\n\n- **`zip-packages`:** Used to specify the path to a JSON file containing names and ZIP archive URLs of packages.\n- **`cache-local-packages`:** When `true`, local packages set by `zip-packages` will be cached independently of `@preview` packages.\n\n```yaml\n# Example workflow YAML file\n- uses: typst-community/setup-typst@v5\n  with:\n    zip-packages: requirements.json\n    cache-local-packages: true\n```\n\n```js\n// Example JSON file (requirements.json)\n{\n  \"preview\": {\n    \"algorithmic\": \"https://github.com/typst-community/typst-algorithmic/archive/refs/tags/v1.0.0.zip\"\n  },\n  \"local\": {\n    \"glossarium\": \"https://github.com/typst-community/glossarium/archive/refs/tags/v0.5.7.zip\"\n  }\n}\n```\n\n\u003e [!TIP]\n\u003e\n\u003e - For links to download GitHub repositories, please refer to [_Downloading source code archives_].\n\u003e - The supported namespaces are only `local` and `preview`.\n\u003e - The SemVer versions of packages are read from its `typst.toml`.\n\n#### Token\n\n**`token`:** The token used to authenticate when fetching Typst distributions from [typst/typst]. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.\n\n### Integration with Other Actions\n\n#### Uploading Artifacts\n\nIf you require storing and sharing data from a workflow, you can use [artifacts].\n\n```yaml\n- uses: typst-community/setup-typst@v5\n- run: typst compile paper.typ paper.pdf\n- uses: actions/upload-artifact@v6\n  with:\n    name: paper\n    path: paper.pdf\n```\n\n#### Installing Fonts with Fontist\n\nIf you require installing fonts in GitHub Actions runner, you can use [Fontist].\n\n```yaml\n- uses: fontist/setup-fontist@v2\n- run: fontist install \"Fira Code\"\n- uses: typst-community/setup-typst@v5\n- run: typst compile paper.typ paper.pdf --font-path ~/.fontist/fonts\n```\n\n## Development Guide\n\n### Prerequisites\n\nSetup Typst uses TypeScript for development, so you'll need Node.js 20 and npm to develop the action.\n\n### Initial Setup\n\nYou can clone the repository with the help of Git and use `npm ci` to install dependencies.\n\n### Building\n\nThe action uses TypeScript for development and [ncc] to compile and bundle everything into a single JavaScript file for distribution.\n\nTo build the action, run `npm run build`. This command compiles the TypeScript code from `src/main.ts` and bundles it with all dependencies into the `dist/main.js` file.\n\nYou can also use `npm run lint` to run type checking and format code with `npm run format`.\n\n### Testing\n\nThe repository uses GitHub Actions for continuous integration testing. The workflow automatically runs on pull requests and pushes to the main branch.\n\n[Typst]: https://typst.app/\n[typst/typst]: https://github.com/typst/typst\n[packages]: https://github.com/typst/packages\n[_Downloading source code archives_]: https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives\n[artifacts]: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow\n[Fontist]: https://www.fontist.org/\n[ncc]: https://github.com/vercel/ncc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypst-community%2Fsetup-typst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypst-community%2Fsetup-typst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypst-community%2Fsetup-typst/lists"}