{"id":18989160,"url":"https://github.com/wtfjoke/setup-tectonic","last_synced_at":"2025-05-08T21:16:40.585Z","repository":{"id":39392717,"uuid":"332029542","full_name":"WtfJoke/setup-tectonic","owner":"WtfJoke","description":"Sets up Tectonic in your GitHub Actions workflow so you can compile your LaTeX documents.","archived":false,"fork":false,"pushed_at":"2025-05-06T13:21:36.000Z","size":7223,"stargazers_count":54,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T21:16:33.536Z","etag":null,"topics":["action","github-actions","hacktoberfest","latex","pdf","setup-actions","tectonic","tex"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/WtfJoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2021-01-22T18:25:29.000Z","updated_at":"2025-05-06T13:20:37.000Z","dependencies_parsed_at":"2023-12-25T02:40:43.829Z","dependency_job_id":"ed4ed23a-7b24-4be2-8732-7cd956929769","html_url":"https://github.com/WtfJoke/setup-tectonic","commit_stats":{"total_commits":207,"total_committers":9,"mean_commits":23.0,"dds":0.6521739130434783,"last_synced_commit":"77caf47ca001dc46c6565a046a9f26da0125cb26"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fsetup-tectonic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fsetup-tectonic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fsetup-tectonic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fsetup-tectonic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WtfJoke","download_url":"https://codeload.github.com/WtfJoke/setup-tectonic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149621,"owners_count":21861740,"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","github-actions","hacktoberfest","latex","pdf","setup-actions","tectonic","tex"],"created_at":"2024-11-08T17:05:30.147Z","updated_at":"2025-05-08T21:16:40.551Z","avatar_url":"https://github.com/WtfJoke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/WtfJoke/setup-tectonic/actions/workflows/test.yml/badge.svg)](https://github.com/WtfJoke/setup-tectonic/actions/workflows/test.yml)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic)\n\nThe `wtfjoke/setup-tectonic` action is a JavaScript action that sets up [Tectonic](https://github.com/tectonic-typesetting/tectonic) in your GitHub Actions workflow by:\n\n- Downloading a requested version of Tectonic and adding it to the `PATH`.\n- (Optionally) downloading a requested version of [Biber](https://sourceforge.net/projects/biblatex-biber/) and adding it to the `PATH`.\n\n# 🔧 Usage\n\nThis action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners.\n\nThe default configuration installs the latest version of Tectonic. The `GITHUB_TOKEN` is needed to query the Github Releases of `tectonic-typesetting/tectonic` to download tectonic.\n\nYou can even use caching (see example below) to speed up your workflow 🎉.\n\nSee [action.yml](https://github.com/WtfJoke/setup-tectonic/blob/main/action.yml) for a full description of all parameters.\n\n```yml\nsteps:\n  - uses: wtfjoke/setup-tectonic@v3\n  - run: tectonic main.tex\n```\n\nYou can also download a specific version of Tectonic\n\n```yml\nsteps:\n  - uses: wtfjoke/setup-tectonic@v3\n    with:\n      tectonic-version: 0.14.1\n  - run: tectonic main.tex\n```\n\nIf you want to use biber, specify a biber version (for a full example see [below](https://github.com/WtfJoke/setup-tectonic#with-biber))\n\n```yml\nsteps:\n  - uses: wtfjoke/setup-tectonic@v3\n    with:\n      biber-version: 2.17\n  - run: biber --version\n```\n\n## Upload pdf (using `actions/upload-artifact`)\n\n```yml\nname: 'Build LaTex Document'\non:\n  push:\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - uses: wtfjoke/setup-tectonic@v3\n      - name: Run Tectonic\n        run: tectonic main.tex\n      - name: Upload pdf\n        uses: actions/upload-artifact@v3\n        with:\n          name: main\n          path: main.pdf\n```\n\n## With enabled cache (using `actions/cache`)\n\n```yml\nname: 'Build LaTex Document'\non:\n  push:\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - uses: actions/cache@v3\n        name: Tectonic Cache\n        with:\n          path: ~/.cache/Tectonic\n          key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}\n          restore-keys: |\n            ${{ runner.os }}-tectonic-\n      - uses: wtfjoke/setup-tectonic@v3\n      - name: Run Tectonic\n        run: tectonic main.tex\n      - name: Upload pdf\n        uses: actions/upload-artifact@v3\n        with:\n          name: main\n          path: main.pdf\n```\n\n## With biber\n\n```yml\nname: 'Build LaTex Document with Biber'\non:\n  push:\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - uses: actions/cache@v3\n        name: Tectonic Cache\n        with:\n          path: ~/.cache/Tectonic\n          key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}\n          restore-keys: |\n            ${{ runner.os }}-tectonic-\n      - uses: wtfjoke/setup-tectonic@v3\n        with:\n          biber-version: 'latest'\n      - name: Run Tectonic + Biber\n        run: tectonic main.tex\n      - name: Upload pdf\n        uses: actions/upload-artifact@v3\n        with:\n          name: main\n          path: main.pdf\n```\n\n**Note**: Tectonic has added biber support in `0.7.1` (see [changelog](https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.1)). Prior to that version you need to run following commands:\n\n```yml\nrun: |\n  tectonic --keep-intermediates --reruns 0 main.tex\n  biber main\n  tectonic main.tex\n```\n\n# 📊 Comparison to other LaTeX/Tectonic actions like [vinay0410/tectonic-action](https://github.com/vinay0410/tectonic-action)\n\n| Pro                    | Description                                                                                          |\n| ---------------------- | :--------------------------------------------------------------------------------------------------- |\n| :zap: Performance      | - Supports caching \u003c/br\u003e - Native Javascript Action's are faster than docker (:whale:) based actions |\n| :robot: Future proofed | New tectonic versions right on release without code changes                                          |\n| :art: Customizability  | Do one thing and do it well - let other actions do what they can do best                             |\n\n\u003c/br\u003e\n\n## Explanation\n\nThis action was created because all existing Github Actions for compiling LaTeX documents I came across are docker based actions, which are [slower than Javascript based actions](https://docs.github.com/en/actions/creating-actions/about-actions#docker-container-actions).\n\nLaTex Docker images tend to be huge (2gb+). Tectonic images are an exception but they need to be maintained and updated with new Tectonic versions. This is not often the case, at the time of writing [my docker image](https://github.com/WtfJoke/tectonic-docker) is the only one up to date with the latest tectonic version.\n\nIn comparison, this github action doesn't need an update if a new release of tectonic is released, it just works.\n\nThe existing github actions doesn't support biber (notable exception: [birjolaxew/tectonic-biber-action](https://github.com/birjolaxew/tectonic-biber-action)).\n\nAdditionally most of the github actions tend to do too much or are too strict.\n\nThis github action has one job, to setup tectonic (and optionally biber). You can choose on your own how you want to call tectonic, how and if you want to cache your dependencies, how and if you want to upload your pdf. Depending on your decisions you can choose the best action to do the corresponding job (eg. [actions/cache](https://github.com/actions/cache) for caching, [actions/upload-artifact](https://github.com/actions/upload-artifact) or [actions/create-release](https://github.com/actions/create-release) for publishing your pdf)\n\n# 🤓 How does the cache works?\n\nThe official cache action [actions/cache](https://github.com/actions/cache) has three parameters:\n\n- `path` - A list of files, directories, and wildcard patterns to cache and restore.\n- `key` - Primary cache key - If the key has a cache-hit, it means the cache is up to date. The execution of a tool should'nt change the cache anymore.\n- `restore-keys` - If there is no key hit with `key` - These will be used to restore the cache. The execution of a tool most likely will change the cache.\n\n## Path\n\nFor tectonic the cache directories (`path`) are as follows (see also [tectonic-typesetting/tectonic#159](https://github.com/tectonic-typesetting/tectonic/issues/159)):\n\n| OS      | Cache-Directory                           | Run-Command to export it as environment variable                          |\n| ------- | ----------------------------------------- | ------------------------------------------------------------------------- |\n| Linux   | `~/.cache/Tectonic`                       | `echo TECTONIC_CACHE_PATH=~/.cache/Tectonic \u003e\u003e $GITHUB_ENV`               |\n| Mac     | `~/Library/Caches/Tectonic`               | `echo TECTONIC_CACHE_PATH=~/Library/Caches/Tectonic \u003e\u003e $GITHUB_ENV`       |\n| Windows | `%LOCALAPPDATA%\\TectonicProject\\Tectonic` | \u003ccode\u003eecho TECTONIC_CACHE_PATH=$env:LOCALAPPDATA\\TectonicProject\\Tectonic | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append`\u003c/code\u003e |\n\n## Key\n\nBy calculate the hash all .tex files (see `hashFiles('**/*.tex')`) and integrate that into the cache-`key` we can make sure, that another execution of tectonic wont change the result.\n\nSimpler put, as long as no `.tex` files are changing, the cache wont change.\n\n## Restore-Keys\n\nWe change our `.tex` files but still want to use a cache? `restore-keys` to the rescue :muscle:\n\u003c/br\u003e\n\nWhen we change our .tex files (either by using a new package or just change the text), the exact cache `key` wont hit. Still we want to use the cache from the previous runs, as we most likely still use the same packages. So `restore keys` will use the cache from the previous run and then (at the end of the job execution) will update the existing cache with `key`.\n\n\u003c/br\u003e\nThats how the cache works :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtfjoke%2Fsetup-tectonic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtfjoke%2Fsetup-tectonic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtfjoke%2Fsetup-tectonic/lists"}