{"id":15100663,"url":"https://github.com/mlugg/setup-zig","last_synced_at":"2026-01-12T14:59:57.953Z","repository":{"id":243322940,"uuid":"812112570","full_name":"mlugg/setup-zig","owner":"mlugg","description":"Install a Zig compiler for usage in GitHub Actions workflows.","archived":false,"fork":false,"pushed_at":"2025-03-11T18:52:19.000Z","size":18720,"stargazers_count":129,"open_issues_count":8,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T10:05:17.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mlugg.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":"2024-06-08T01:58:28.000Z","updated_at":"2025-03-28T02:44:32.000Z","dependencies_parsed_at":"2024-06-18T22:30:22.954Z","dependency_job_id":"f5f2b78a-784c-403d-800b-2b50f941f097","html_url":"https://github.com/mlugg/setup-zig","commit_stats":null,"previous_names":["mlugg/setup-zig"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlugg%2Fsetup-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlugg%2Fsetup-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlugg%2Fsetup-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlugg%2Fsetup-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlugg","download_url":"https://codeload.github.com/mlugg/setup-zig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":[],"created_at":"2024-09-25T18:00:39.273Z","updated_at":"2025-04-05T11:07:34.391Z","avatar_url":"https://github.com/mlugg.png","language":"JavaScript","readme":"# setup-zig\n\nInstall the Zig compiler for use in an Actions workflow, and preserve the Zig cache across workflow runs.\n\n## Usage\n\n```yaml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    name: Build and Test\n    steps:\n      - uses: actions/checkout@v3\n      - uses: mlugg/setup-zig@v1\n      - run: zig build test\n```\n\nThis will automatically download Zig and install it to `PATH`.\n\nYou can use `version` to set a Zig version to download. This may be a release (`0.13.0`), a specific nightly\nbuild (`0.14.0-dev.2+0884a4341`), the string `master` for the latest nightly build, or the string `latest`\nfor the latest full release. It can also refer to a [Mach nominated version][mach-nominated], such as\n`2024.5.0-mach`. Finally, leaving the value empty (the default) will cause the action to attempt to resolve\nthe Zig version from the `minimum_zig_version` field in `build.zig.zon`, falling back to `latest` if that\nisn't possible.\n\n```yaml\n  - uses: mlugg/setup-zig@v1\n    with:\n      version: 0.13.0\n```\n\n\u003e [!WARNING]\n\u003e Mirrors, including the official Zig website, may purge old nightly builds at their leisure. This means\n\u003e that if you target an out-of-date nightly build, such as a `0.11.0-dev` build, the download may fail.\n\nIf you want to use one specific mirror, you can set it using the `mirror` option:\n\n```yaml\n  - uses: mlugg/setup-zig@v1\n    with:\n      mirror: 'https://pkg.machengine.org/zig'\n```\n\nPlease don't do this unnecessarily; it's not nice to hammer one mirror. This mirror is not permitted to\nbe https://ziglang.org/download to avoid the official website being hit with large amounts of requests.\nIf you've experienced issues with a default mirror, please open an issue, and I will communicate with the\nmirror's owner or remove it from the list.\n\nIf necessary, the caching of the global Zig cache directory can be disabled by setting the option\n`use-cache: false`. Don't do this without reason: preserving the Zig cache will typically speed things up\nand decrease the load on GitHub's runners.\n\n[mach-nominated]: https://machengine.org/about/nominated-zig/\n\n## Details\n\nThis action attempts to download the requested Zig tarball from a set of mirrors, in a random order. As\na last resort, the official Zig website is used. The tarball's minisign signature is also downloaded and\nverified to ensure binaries have not been tampered with. The tarball is cached between runs and workflows.\n\nThe global Zig cache directory (`~/.cache/zig` on Linux) is automatically cached between runs, and all\nlocal caches are redirected to the global cache directory to make optimal use of this cross-run caching.\n\n## Adding a mirror\n\nAnyone is welcome to host a Zig download mirror; thanks to the tarball signatures, the mirror provider need\nnot be trusted. Naturally, if a mirror is found to be a bad actor, it will be removed, and likewise if a\nmirror repeatedly encounters reliability problems.\n\nThe rules for adding a mirror are listed below. Note that I (@mlugg) reserve the right to, for any or no\nreason, exclude mirrors which obey these rules, or include mirrors which violate them.\n\n\u003e [!NOTE]\n\u003e While there are a lot of rules listed here, most of them should be obvious. They are stated explicitly here\n\u003e to ensure complete clarity on what is expected of a mirror. Please do read these requirements through before\n\u003e attempting to add a mirror.\n\n* A mirror provides a single base URL, which we will call `X`.\n* `X` **may** include a path component, but is not required to. For instance, `https://foo.bar/zig/` is okay,\n  as is `https://zig.baz.qux/`.\n* The mirror **must** have working HTTPS support. `X` **must** start with `https://`.\n* The mirror **must** cache tarballs locally. For instance, it may not simply forward all requests to another\n  mirror.\n* The mirror **may** routinely evict its local tarball caches based on any reasonable factor, such as age,\n  access frequency, or the existence of newer versions. This does not affect whether the mirror may return 404\n  for requests to these files (see below).\n* The mirror **must** download its tarballs from either `https://ziglang.org/`, or another mirror which\n  follows these rules.\n* Tarballs **must** be accessible by sending GET requests for files under `X`, where the filename matches that\n  of the files provided by `https://ziglang.org/`, not including the directory part. For instance,\n  `X/zig-linux-x86_64-0.13.0.tar.xz` is a valid access, and should return the same file as\n  `https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz`.\n* Files provided by the mirror **must** be bit-for-bit identical to their `https://ziglang.org/` counterparts.\n* If a file is accessed whose Zig version is a master branch build (i.e. a `-dev` version), and the version is\n  ordered before the latest major release of Zig, the mirror **may** respond with 404 Not Found, but is not\n  required to. For instance, at the time of writing, `0.13.0` is the latest major release of Zig, so a mirror\n  may respond with 404 for `0.13.0-dev...` builds, but *not* for `0.14.0-dev...` builds.\n* If a file is accessed whose Zig version is `0.5.0` or below, the mirror **may** respond with 404 Not Found,\n  but is not required to.\n* If a file is acccessed which represents a *source* tarball, such as `X/zig-0.13.0.tar.xz`, the mirror\n  **may** respond with 404 Not Found, but is not required to. The same applies to \"bootstrap source tarballs\",\n  such as `X/zig-bootstrap-0.13.0.tar.xz`.\n* For all other accesses of valid Zig tarballs, the mirror **must** respond with status code 200 OK and the\n  file in question. If the mirror has not yet cached the file locally, it should immediately download it from\n  a permitted source (as covered above), and respond with the downloaded file.\n* If a tarball `X/foo.ext` is available by the above rules, requesting the minisign signature file\n  `X/foo.ext.minisig` **must** also respond with status code 200 OK and the signature file in question, like\n  the tarball itself.\n* The mirror **may** rate-limit accesses. If an access failed due to rate-limiting, the mirror **should**\n  return HTTP status code 429 Too Many Requests.\n* The mirror **may** undergo maintenance, upgrades, and other scheduled downtime. If an access fails for this\n  reason, where possible, the mirror **should** return HTTP status code 503 Unavailable. The mirror **should**\n  try to minimize such downtime.\n* The mirror **may** undergo occasional unintended and unscheduled downtime. The mirror **must** go to all\n  efforts to minimize such outages, and **must** resolve such outages within a reasonable time upon being\n  notified of them.\n* The mirror **may** observe the `?source=github-actions` query parameter to track how many requests originate\n  from this Action. This Action will provide this query parameter to all mirror requests.\n\nThe easiest way to set up a mirror right now is using Mach's [Wrench][wrench]. For instructions, please see\n[the relevant section of their README][setup-wrench].\n\n[wrench]: https://github.com/hexops/wrench\n[setup-wrench]: https://github.com/hexops/wrench?tab=readme-ov-file#run-your-own-ziglangorgdownload-mirror\n\nAfter setting up a mirror, you can add it to this GitHub Action by opening a PR which adds it to the list in\n[mirrors.json](https://github.com/mlugg/setup-zig/blob/main/mirrors.json).\n","funding_links":[],"categories":["JavaScript","Fundamentals"],"sub_categories":["Package and Version Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlugg%2Fsetup-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlugg%2Fsetup-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlugg%2Fsetup-zig/lists"}