{"id":13731851,"url":"https://github.com/game-ci/unity-license-activate","last_synced_at":"2025-04-10T16:42:56.179Z","repository":{"id":37932156,"uuid":"407518682","full_name":"game-ci/unity-license-activate","owner":"game-ci","description":"Activate Unity license through CLI","archived":false,"fork":false,"pushed_at":"2024-05-18T22:26:59.000Z","size":196,"stargazers_count":28,"open_issues_count":3,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T02:01:08.994Z","etag":null,"topics":["ci","cli","license","npm","unity"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/unity-license-activate","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/game-ci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"game-ci","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-09-17T11:40:29.000Z","updated_at":"2024-05-28T08:54:44.771Z","dependencies_parsed_at":"2023-11-10T15:01:32.333Z","dependency_job_id":"a6f5d447-de67-493d-b94e-4658fc6b935a","html_url":"https://github.com/game-ci/unity-license-activate","commit_stats":{"total_commits":135,"total_committers":8,"mean_commits":16.875,"dds":"0.20740740740740737","last_synced_commit":"2b3f49309ae102b20a6a303726eb64a98d2df0e2"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/game-ci%2Funity-license-activate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/game-ci%2Funity-license-activate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/game-ci%2Funity-license-activate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/game-ci%2Funity-license-activate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/game-ci","download_url":"https://codeload.github.com/game-ci/unity-license-activate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247446406,"owners_count":20940098,"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":["ci","cli","license","npm","unity"],"created_at":"2024-08-03T02:01:40.004Z","updated_at":"2025-04-10T16:42:56.155Z","avatar_url":"https://github.com/game-ci.png","language":"JavaScript","funding_links":["https://github.com/sponsors/game-ci"],"categories":["JavaScript"],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Release](https://img.shields.io/github/tag/jcs090218/unity-license-activate.svg?label=release\u0026logo=github)](https://github.com/jcs090218/unity-license-activate/releases/latest)\n[![npm](https://img.shields.io/npm/v/unity-license-activate?logo=npm\u0026color=green)](https://www.npmjs.com/package/unity-license-activate)\n[![npm-dt](https://img.shields.io/npm/dt/unity-license-activate.svg)](https://npmcharts.com/compare/unity-license-activate?minimal=true)\n[![npm-dm](https://img.shields.io/npm/dm/unity-license-activate.svg)](https://npmcharts.com/compare/unity-license-activate?minimal=true)\n\n# unity-license-activate\n\u003e A tool to automate the manual activation of unity license using puppeteer\n\n[![CI](https://github.com/game-ci/unity-license-activate/actions/workflows/test.yml/badge.svg)](https://github.com/game-ci/unity-license-activate/actions/workflows/test.yml)\n\nThis is a fork from [MizoTake/unity-license-activate](https://github.com/MizoTake/unity-license-activate).\n\nThis tool is design to use with [GameCI](https://game.ci/) and personal license\n(free version) users. Personal license will expire after some times, then you most\nlikely would have to repeast the step [Activation - Personal License](https://game.ci/docs/github/activation#personal-license)\nin order to keep the CI running. Thankfully, you can use this tool to constantly\nactivate a new license from Unity's licensing system.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./etc/ma.png\"/\u003e\n\u003c/p\u003e\n\n## 🔨 How to use?\n\nYou can use this tools with any CI/CD system as long as you have the [Node](https://nodejs.org/en/)\nenvironment set up! Here is an example for GitHub Actions.\n\n```yml\njobs:\n  acquire_ulf:\n    name: Acquire .ulf file 🔑\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Node.js\n        uses: actions/setup-node@v1\n        with:\n          node-version: '16'\n\n      - name: Install node package, `unity-license-activate`\n        run: npm install --global unity-license-activate\n\n      - name: Activate the license\n        run: unity-license-activate \"${{ secrets.UNITY_EMAIL }}\" \"${{ secrets.UNITY_PASSWORD }}\" \"${{ needs.request_alf.outputs.alf }}\"\n\n      - name: Read ulf\n        id: ulfRead\n        uses: juliangruber/read-file-action@v1.1.4\n        with:\n          path: ${{ env.ULF_FILE }}\n\n      - name: Update secret UNITY_LICENSE\n        uses: hmanzur/actions-set-secret@v2.0.0\n        with:\n          name: 'UNITY_LICENSE'\n          value: '${{ steps.ulfRead.outputs.content }}'\n          token: ${{ secrets.ACCESS_TOKEN }}\n```\n\nSee the full example [here](https://github.com/jcs090218/JCSUnity/blob/master/.github/workflows/license.yml).\n\n## 🔐 Two Factor Authentication (TFA)\nUnity requires you to enter a 6 digit verification code when signing in.\nThis project supports two types of verification code:\n\n#### Authenticator App (TOTP)\nAuthenticator App is the preferred option when TFA is explicitly enabled on an account.\nTo get past this, specify your original authenticator key and `unity-license-activate` will generate a TOTP automatically.\n\n```yml\n      - name: Activate the license\n        run: unity-license-activate ... --authenticator-key \"${{ secrets.UNITY_TOTP_KEY }}\"\n```\n\n#### How to obtain authenticator key\n\n- Login to Unity account and activate new two factor authentication.\nGo to https://id.unity.com/en/settings/tfa/new and click `Start setup`\n![](etc/TOTP/1.png)\n- Select `Authenticator App` and click `Next`\n![](etc/TOTP/2.png)\n- Click `Can't scan the barcode?`.\nFind and save the authenticator key\n![](etc/TOTP/3.png)\n- Verify activation with Google Authenticator. You can also verify using a QR code\n![](etc/TOTP/4.png)\n\n#### Email\nEmail is the default option when you have not enabled TFA on your account.\n\nTo get past this, you would have to install [unity-verify-code](https://github.com/jcs090218/unity-verify-code)\nin your workflow and follow the steps [here](https://github.com/jcs090218/unity-verify-code#-prerequisite) to allow access to your email inbox (IMAP).\n\n```yml\n      - name: Install node package, `unity-verify-code`\n        run: npm install --global unity-verify-code\n```\n\nIf you have different password from Unity account and Email account, you would\nneed to add `--password` flag to it.\n\n```yml\n      - name: Activate the license\n        run: unity-license-activate ... --password \"${{ secrets.EMAIL_PASSWORD }}\"\n```\n\n## ㊙️ Secrets\n\nYou should have 3 ~ 4 GitHub secrets to correctly set up the entire workflow.\n\n* `UNITY_EMAIL` - Email address that you use to login to Unity\n* `UNITY_PASSWORD` - Password that you use to login to Unity\n* `ACCESS_TOKEN` - Use to update secret `UNITY_LICENSE`, see [hmanzur/actions-set-secret#token](https://github.com/hmanzur/actions-set-secret#token)\n* `EMAIL_PASSWORD` (optional) - Use to get pass Unity's Two Factor Authentication,\n`UNITY_PASSWORD` is used by default assuming your passwords are the same.\n* `UNITY_TOTP_KEY` (optional) - Use to pass Unity's Two Factor Authentication,\n\n## 🩺 Error handling\n\nFor some reason, if this plugin does not work. Try configure your workflow file\nlike this,\n\n```yml\n      - name: Activate the license\n        run: unity-license-activate \"${{ secrets.UNITY_EMAIL }}\" \"${{ secrets.UNITY_PASSWORD }}\" \"${{ needs.request_alf.outputs.alf }}\"\n\n      # Add the error handling step here!\n      - name: 🩺 Upload error screenshot\n        if: failure()\n        uses: actions/upload-artifact@v1\n        with:\n          name: screenshot_error\n          path: error.png\n```\n\nThe program generates a `error.png` file if something went wrong. Then you can\ndownload and see what's the last step before the program is exited.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./etc/error_artifact.png\" width=\"75%\" height=\"75%\"/\u003e\n\u003c/p\u003e\n\n## 📇 Command Line Arguments\n\n```console\nusage : unity-license-activate EMAIL [EMAIL ...] PASSWORD [PASSWORD ...] ALF [ALF ...]\n\nUnity License Activate : Activate Unity license through CLI.\n\npositional arguments:\n  EMAIL          Username or Email you use to register for Unity account\n  PASSWORD       Password to login Unity account\n  ALF            Unity activation license file path\n```\n\n## 🔗 Links\n\n- https://license.unity3d.com/manual\n\n## ⚜️ License\n\nThis repository is [Apache 2.0](./LICENSE) licensed.\n\nThis includes all contributions from the community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgame-ci%2Funity-license-activate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgame-ci%2Funity-license-activate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgame-ci%2Funity-license-activate/lists"}