{"id":16104989,"url":"https://github.com/j0yu/setup-rez","last_synced_at":"2025-03-18T08:31:34.734Z","repository":{"id":40726832,"uuid":"244162949","full_name":"j0yu/setup-rez","owner":"j0yu","description":"Github Action to setup rez package system","archived":false,"fork":false,"pushed_at":"2023-07-12T04:40:55.000Z","size":1473,"stargazers_count":14,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T01:18:29.825Z","etag":null,"topics":["github-actions-javascript","rez"],"latest_commit_sha":null,"homepage":"https://j0yu.github.io/setup-rez/","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/j0yu.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":"2020-03-01T14:22:45.000Z","updated_at":"2023-09-08T18:18:15.000Z","dependencies_parsed_at":"2024-10-27T17:27:08.710Z","dependency_job_id":"08d20c35-0346-405d-aee4-3adda59fbfe0","html_url":"https://github.com/j0yu/setup-rez","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.23076923076923073","last_synced_commit":"c778ea4a2dba72c1f87b589c62131105eeab27c9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j0yu%2Fsetup-rez","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j0yu%2Fsetup-rez/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j0yu%2Fsetup-rez/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j0yu%2Fsetup-rez/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j0yu","download_url":"https://codeload.github.com/j0yu/setup-rez/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910749,"owners_count":20367545,"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-actions-javascript","rez"],"created_at":"2024-10-09T19:07:39.775Z","updated_at":"2025-03-18T08:31:33.587Z","avatar_url":"https://github.com/j0yu.png","language":"JavaScript","readme":"[![CI](https://github.com/j0yu/setup-rez/workflows/CI/badge.svg?branch=main)](https://github.com/j0yu/setup-rez/actions?query=branch:main+workflow:CI)\n\n# setup-rez\n\nGithub Action to setup [rez] package system.\n\n\n## Usage\n\n```yaml\n# Ensure there is a python interpreter first to install rez!\n- uses: actions/setup-python@v1\n  with:\n    python-version: \"${{ matrix.python }}\"\n\n- uses: j0yu/setup-rez@v1\n  # ALL below inputs are optional, these values are the default ones\n  with:\n    # GitHub repository to install rez from.\n    source: 'nerdvegas/rez'\n\n    # Git tag/branch/commit to use.\n    ref: 'master'\n\n    # Install using \"python\" as the Python interpreter\n    pythonExe: 'python'\n\n    # Create all default \"rez config packages_path\".\n    makePackagesPaths: true\n\n    # Comma separated packages to rez bind, e.g. \"pip, python, os\".\n    # To disable, just pass in an empty string \"bind: ''\"\n    # See \"rez bind --list\".\n    # Will force the creation of \"rez config local_packages_path\"\n    binds: \"os, python\"\n```\n\n## Example\n\nFor VMs, make sure you run [actions/setup-python] before using\n[j0yu/setup-rez] so it has access to a Python Interpreter.\n\n```yaml\nname: CI\non: [push]\n\njobs:\n  test:\n    name: Test\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/setup-python@v1\n        with:\n          python-version: 2.7\n\n      # Using custom rez repository and version\n      - uses: j0yu/setup-rez@v1\n        with:\n          source: \"mottosso/bleeding-rez\"\n          ref: \"2.33.0\"\n\n      # Check if rez is on PATH, check configs and rez bind packages\n      - run: rez --version\n      - run: rez config local_packages_path\n      - run: rez config release_packages_path\n      - run: rez config packages_path\n      - run: rez view os\n      - run: rez view python\n\n      # If our repository has a package.py, let's try test build/installing it\n      - uses: actions/checkout@v2\n      - run: rez build --install\n```\n\n### Containers\n\nIf you're using [`container`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer)\nyou'll need to install Python as per the image/system instead of using [actions/setup-python].\n\n\n```yaml\nname: CI\non: [push]\n\njobs:\n  test-centos7:\n    name: Test CentOS 7 (${{ matrix.yum_python }})\n    runs-on: ubuntu-latest\n    container:\n      image: \"centos:7\"\n    strategy:\n      matrix:\n        yum_python:\n          - \"python\"  # Python 2.7\n          - \"python3\" # Python 3.6\n\n    steps:\n      - run: yum install -y ${{ matrix.yum_python }}\n      - uses: j0yu/setup-rez@v1\n        with:\n          pythonExe: ${{ matrix.yum_python }}\n      - run: rez --version\n      - run: rez python -V\n```\n\nIn this example, `centos:7` uses an old `glibc` and isn't compatible with\n[actions/setup-python]. But `rez` is ok with Python 2.7 and above (as recent as 2.93.0):\n\n- `python`: [j0yu/setup-rez] will use a slightly updated Python 2.7 interpreter that's\n  already shipped with `centos:7`.\n- `python3`: [j0yu/setup-rez] will run rez's `install.py` using `python3`\n  (nice coincidence) as the interpreter, instead of the default `python`.\n\n\n## How it works\n\nEverything is done in the `run` function in `index.js`:\n\n1. Get cached install for the `source` and `ref` input combination\n1. If there is no installs/tools cache install rez:\n    1. Downloads and extracts from `https://github.com/${source}/archive/${ref}.tar.gz`\n    1. If `install.py` exists, install via `python install.py DEST`\n\n         else, if `setup.py` exists, install via `pip install --target DEST SRC`\n    1. Store required environment variable paths to append in a `setup.json`\n1. Load and append environment variables paths from `setup.json`\n\n   Typically `PATH` for `rez` command, `PYTHONPATH` if used `pip install --target`.\n\n1. Create any `rez config package_paths` folders if required.\n1. Create any `rez bind PKG...` packages if required.\n\nNotes on install style availability:\n\nRez                   | (1st) install.py | (2nd) pip install\n----------------------|------------------|------------------\nnerdvegas/rez         | Always           | 2.33.0+\nmottosso/bleeding-rez | NEVER            | Always\n\n\n## Developing\n\nClone this repository down and modify:\n\n- `index.js` for the inner workings and logic.\n\n    - [Node.js 12x] API docs\n    - [GitHub Action Toolkit Sub-Packages]\n\n- `action.yml` for input/output and action definition.\n\n    - [GitHub: Building actions] specifically [Metadata Syntax]\n\n- `.github/workflows/ci.yml` for tests.\n\n\n\n\u003cdetails\u003e\u003csummary\u003eat the humble beginnings...\u003c/summary\u003e\n\nI didn't want to have npm installed, so here's the Docker contained way I\nworked on CentOS-7. See [Creating a JavaScript action].\n\n1. Clone this repository.\n1. `cd` into the repository.\n1. Edit the `action.yml`\n1. Setup `npm` package using Docker container.\n\n    ```bash\n    alias npm=\"docker run --rm -it -v \"$(pwd):$(pwd)\" --user \"$(id -u):$(id -g)\" -w \"$(pwd)\" node:12 npm\"\n    npm init -y\n    npm install @actions/core --save\n    npm install @actions/exec --save\n    npm install @actions/io --save\n    npm install @actions/tool-cache --save\n    ```\n1. Edit the `index.js`\n1. Add paths required, then push:\n\n    ```bash\n    git add --force action.yml index.js node_modules/* package.json package-lock.json README.md\n    git commit\n    git push\n    ```\n\n\u003c/details\u003e\n\n\n[j0yu/setup-rez]: github.com/j0yu/setup-rez\n[actions/setup-python]: github.com/actions/setup-python\n[GitHub Action Toolkit Sub-Packages]: https://github.com/actions/toolkit#packages\n[Metadata Syntax]: https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions\n[Node.js 12x]: https://nodejs.org/dist/latest-v12.x/docs/api/\n[GitHub: Building actions]: https://help.github.com/en/actions/building-actions\n[rez]: https://github.com/nerdvegas/rez\n[actions/setup-python]: https://github.com/actions/setup-python\n[Creating a JavaScript action]: https://help.github.com/en/actions/building-actions/creating-a-javascript-action\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0yu%2Fsetup-rez","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj0yu%2Fsetup-rez","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0yu%2Fsetup-rez/lists"}