{"id":27424143,"url":"https://github.com/engineerd/configurator","last_synced_at":"2025-04-14T11:38:03.704Z","repository":{"id":36554121,"uuid":"209023649","full_name":"engineerd/configurator","owner":"engineerd","description":"Cross-platform GitHub Action to download, extract, and add to path statically compiled tools","archived":false,"fork":false,"pushed_at":"2024-10-21T18:30:44.000Z","size":12999,"stargazers_count":27,"open_issues_count":15,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T00:13:17.935Z","etag":null,"topics":["github","github-actions"],"latest_commit_sha":null,"homepage":"https://radu-matei.com/blog/github-action-cross-plat-configure-tools/","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/engineerd.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":"2019-09-17T10:20:41.000Z","updated_at":"2025-02-01T18:56:28.000Z","dependencies_parsed_at":"2024-06-18T16:52:21.666Z","dependency_job_id":"5511e851-87f3-4245-94b9-9d87c59594d2","html_url":"https://github.com/engineerd/configurator","commit_stats":{"total_commits":65,"total_committers":5,"mean_commits":13.0,"dds":"0.18461538461538463","last_synced_commit":"dc6b312d89ab097f73f3ebbf507a69dd7399c5d0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineerd%2Fconfigurator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineerd%2Fconfigurator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineerd%2Fconfigurator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineerd%2Fconfigurator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/engineerd","download_url":"https://codeload.github.com/engineerd/configurator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248872954,"owners_count":21175532,"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":["github","github-actions"],"created_at":"2025-04-14T11:37:59.107Z","updated_at":"2025-04-14T11:38:03.691Z","avatar_url":"https://github.com/engineerd.png","language":"TypeScript","readme":"# @engineerd/configurator\n\nCross-platform GitHub Action for downloading statically compiled tools (or\narchives) and adding them to the path. This has been tested on `ubuntu-latest`,\n`windows-latest`, and `macos-latest`.\n\nThis action can be used in two modes:\n\n- directly providing a download URL (or a URL per-platform, using a\n  configuration matrix)\n- providing a URL template and a semver version or range to be selected from\n  GitHub releases. In this mode, the action iterates through the GitHub releases\n  to find the latest version that satisfies the version (or range) constraint,\n  constructs the download URL, and adds the tool to the path.\n\n## Directly downloading tools based on URL\n\nInputs:\n\n- `name`: name your tool will be configured with (required)\n- `url`: URL to download your tool from (required)\n- `pathInArchive`: if the URL points to an archive, this field is required, and\n  points to the path of the tool to configure, relative to the archive root\n\nExamples - a cross-platform action that downloads, extracts, and adds Helm\nv3.3.0 to the path:\n\n```yaml\njobs:\n  configurator:\n    runs-on: ${{ matrix.config.os }}\n    strategy:\n      matrix:\n        config:\n          - {\n              os: \"ubuntu-latest\",\n              url: \"https://get.helm.sh/helm-v3.3.0-linux-amd64.tar.gz\",\n              name: \"h3\",\n              pathInArchive: \"linux-amd64/helm\",\n            }\n          - {\n              os: \"windows-latest\",\n              url: \"https://get.helm.sh/helm-v3.3.0-windows-amd64.zip\",\n              name: \"h3.exe\",\n              pathInArchive: \"windows-amd64/helm.exe\",\n            }\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: ${{ matrix.config.name }}\n          url: ${{ matrix.config.url }}\n          pathInArchive: ${{ matrix.config.pathInArchive }}\n      - name: Testing\n        run: |\n          h3 --help\n```\n\n## Selecting versions from GitHub Releases\n\nInputs:\n\n- `name`: name your tool will be configured with (required)\n- `pathInArchive`: if the URL points to an archive, this field is required, and\n  points to the path of the tool to configure, relative to the archive root\n- `fromGitHubReleases`: if true, the action will attempt to get the latest\n  version from the specified repository's GitHub Releases that matches the given\n  semver version or range provided, and then construct the download URL using\n  the provided `urlTemplate`.\n- `repo`: GitHub repository of the tool. Used to list all releases and select\n  the proper version. Required if `fromGitHubReleases` is true.\n- `version`: an exact semver version or version range (specified with ^ or ~, as\n  defined and used by [NPM](https://docs.npmjs.com/about-semantic-versioning)).\n  If using semver ranges with `v0.x.x` releases, be sure to\n  [understand the semver behavior here](https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004).\n  If `latest` is provided, the action will download the latest release\n  (respecting the `includePrereleases flag`), which, can break your action.\n  Required if `fromGitHubReleases` is true.\n- `token`: GitHub token used _only_ to list the GitHub releases for the supplied\n  repository. For most cases, its value should be `${{ secrets.GITHUB_TOKEN }}`.\n  Required if `fromGitHubReleases` is true.\n- `urlTemplate`: a URL template used to construct the download URL, together\n  with the desired version acquired from a GitHub release. For example,\n  `https://get.helm.sh/helm-{{version}}-linux-amd64.tar.gz` (the version\n  inserted here is the exact tag name from GitHub - check whether the tag name\n  contains any `v` before the version when constructing the URL template). Note\n  that this is [Mustache template](https://mustache.github.io/) (completely\n  separate from the GitHub Actions templating system - the template _must be_\n  `{{version}}`). Note that if the version tag has a leading `v`, a\n  `{{rawVersion}}` variable that doesn't contain the leading `v` can be used in\n  the `urlTemplate`. Required if `fromGitHubReleases` is true.\n- `includePrereleases`: if true, the action will include pre-releases when\n  selecting a version from GitHub Releases.\n\nExample - a cross-platform action that selects the latest Helm version that\nsatisfies the `^3.1.2` release constraint - meaning it selects any minor and\npatch update, or, in other words, the latest `v3.x.x` version:\n\n```yaml\njobs:\n  configurator:\n    runs-on: ${{ matrix.config.os }}\n    strategy:\n      matrix:\n        config:\n          - {\n              os: \"ubuntu-latest\",\n              urlTemplate: \"https://get.helm.sh/helm-{{version}}-linux-amd64.tar.gz\",\n              name: \"h3\",\n              pathInArchive: \"linux-amd64/helm\",\n            }\n          - {\n              os: \"windows-latest\",\n              urlTemplate: \"https://get.helm.sh/helm-{{version}}-windows-amd64.zip\",\n              name: \"h3.exe\",\n              pathInArchive: \"windows-amd64/helm.exe\",\n            }\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: ${{ matrix.config.name }}\n          pathInArchive: ${{ matrix.config.pathInArchive }}\n          fromGitHubReleases: \"true\"\n          repo: \"helm/helm\"\n          version: \"^v3.1.2\"\n          urlTemplate: ${{ matrix.config.urlTemplate }}\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Testing\n        run: |\n          h3 --help\n```\n\nExample - an action that selects the latest non-pre-release (as marked in the\nGitHub release) of Kind:\n\n```yaml\njobs:\n  kind:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: \"kind\"\n          fromGitHubReleases: \"true\"\n          repo: \"kubernetes-sigs/kind\"\n          urlTemplate: \"https://github.com/kubernetes-sigs/kind/releases/download/{{version}}/kind-linux-amd64\"\n          version: \"latest\"\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Testing\n        run: |\n          kind --help\n```\n\n## Other examples\n\n- download an executable from a given URL and move it to a folder in path with\n  the given name:\n\n```yaml\nname: \"Test plain file\"\non: [pull_request, push]\n\njobs:\n  kind:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: \"kind\"\n          url: \"https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-linux-amd64\"\n      - name: Testing\n        run: |\n          kind --help\n```\n\n- download a `.tar.gz` archive from a given URL, and move a certain file from\n  the archive directory to a folder in path, with a given name:\n\n```yaml\nname: \"Test .tar.gz\"\non: [pull_request, push]\n\njobs:\n  kind:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: \"h3\"\n          url: \"https://get.helm.sh/helm-v3.3.0-linux-amd64.tar.gz\"\n          pathInArchive: \"linux-amd64/helm\"\n      - name: Testing\n        run: |\n          h3 --help\n```\n\n- download a `.zip` archive on Windows from a given URL, and move a certain file\n  from the archive directory to a folder in path, with a given name:\n\n```yaml\nname: \"Test .zip\"\non: [pull_request, push]\n\njobs:\n  kind:\n    runs-on: windows-latest\n    steps:\n      - uses: engineerd/configurator@v0.0.9\n        with:\n          name: \"h3.exe\"\n          url: \"https://get.helm.sh/helm-v3.3.0-windows-amd64.zip\"\n          pathInArchive: \"windows-amd64/helm.exe\"\n      - name: Testing\n        run: |\n          h3 --help\n```\n\n\u003e Note: usually, Windows-specific tooling uses `.zip` archives - and the `tar`\n\u003e utility on Windows doesn't seem to handle `.tar.gz` files properly. Note: for\n\u003e Linux, `chmod +x` is called on the target file before moving it to the path,\n\u003e ensuring it is executable. On Windows this is skipped.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerd%2Fconfigurator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineerd%2Fconfigurator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerd%2Fconfigurator/lists"}