Skip to content

Conversation

cseteram
Copy link
Contributor

@cseteram cseteram commented Sep 11, 2025

Changes

GameCI currently supports Unity license server activation, but the Bash scripts for the macOS platform have not been updated to support this functionality. While there was a previous PR addressing this, it has not yet been merged. 😭 This PR revisits and adapts the changes from the previous PR to fit the current Linux-based script structure.

Additionally, since BSD grep (used on macOS runners) does not support Perl-compatible regular expressions, the regex pattern used for license token parsing has been updated to ensure compatibility.

  • Added logic to activate and return Unity licenses when the UNITY_LICENSING_SERVER environment variable is set
  • Removed the email and password parameters in the build script
  • Updated the regular expression pattern for license token parsing to work correctly with BSD grep

Related Issues

  • N/A

Related PRs

Successful Workflow Run Link

I have successfully tested this in our private repository and have attached logs from tests, showing the use of the Unity license server at each step. Since the implementation closely follows the Linux version, I expect it to work without any issues. If necessary, I can provide the full log file of workflows (with secrets masked).

Activate license

Changing to "/Users/***/actions-runner/_work/_actions/cseteram/unity-builder/main/dist/BlankProject" directory.
~/actions-runner/_work/_actions/cseteram/unity-builder/main/dist/BlankProject ~/actions-runner/_work/tech-internal-test/tech-internal-test
Adding licensing server config
Acquired floating license: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" with timeout 2025-09-11T13:26:41.6611694+09:00
Activation complete.

Build

###########################
#    Building project     #
###########################

[UnityConnectServicesConfig] Local config successfully read: "/Library/Application Support/Unity/config/services-config.json"
[UnityConnectServicesConfig] "licensingServiceBaseUrl" was overridden with "http://***:8080/"
[UnityConnectServicesConfig] "clientConnectTimeoutSec" was overridden with "5"
[UnityConnectServicesConfig] "clientHandshakeTimeoutSec" was overridden with "10"
[UnityConnectServicesConfig] Service configuration:
    "servicesConfigBaseUrl": "",
    "disableServicesWindow": false,
    "disableUserLogin": false,
    "entitlementCacheTimeoutInSeconds": 60,
    "clientConnectTimeoutSec": 5,
    "clientHandshakeTimeoutSec": 10,
    "clientResolveEntitlementsTimeoutSec": 30,
    "clientUpdateLicenseTimeoutSec": 30,
    "licensingServiceBaseUrl": "http://***:8080/",
    "enableProxyAutoconfig": "false"

Return license

Returning floating license: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Trying to return floating license lease (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) to: *** ...
License lease returned successfully

Checklist

  • Read the contribution guide and accept the
    code of conduct
  • Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
    in the documentation repo)
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Copy link

coderabbitai bot commented Sep 11, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (4)
  • dist/platforms/mac/steps/activate.sh is excluded by !**/dist/**
  • dist/platforms/mac/steps/build.sh is excluded by !**/dist/**
  • dist/platforms/mac/steps/return_license.sh is excluded by !**/dist/**
  • dist/platforms/ubuntu/steps/activate.sh is excluded by !**/dist/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Cat Gif

@cseteram cseteram marked this pull request as ready for review September 11, 2025 09:06
Copy link
Member

@webbertakken webbertakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that this works as expected?

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.34%. Comparing base (00fa0d3) to head (c4bc5cd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #735   +/-   ##
=======================================
  Coverage   38.34%   38.34%           
=======================================
  Files          78       78           
  Lines        3169     3169           
  Branches      663      663           
=======================================
  Hits         1215     1215           
  Misses       1809     1809           
  Partials      145      145           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cseteram
Copy link
Contributor Author

@webbertakken Hi, I was away for a short while due to Korean holidays. 🙇

Can you confirm that this works as expected?

Yes, as far as I can verify. Except for a slightly different grep patterns, the implementation is almost identical to the Linux version.
I've updated the PR and re-checked it with two scenarios.

(1) Using the license server

I tested it in our private repository and it works well.

Activate license

Changing to "/Users/cookapps/actions-runner/_work/_actions/cseteram/unity-builder/main/dist/BlankProject" directory.
~/actions-runner/_work/_actions/cseteram/unity-builder/main/dist/BlankProject ~/actions-runner/_work/tech-internal-test/tech-internal-test
Adding licensing server config
Acquired floating license: "fd1379ac-fdd5-4052-a702-3681baf7XXXX" with timeout 2025-10-13T14:22:13.2464243+09:00
Activation complete.

Build

###########################
#    Building project     #
###########################

[UnityConnectServicesConfig] Local config successfully read: "/Library/Application Support/Unity/config/services-config.json"
[UnityConnectServicesConfig] "licensingServiceBaseUrl" was overridden with "http://***:8080/"
[UnityConnectServicesConfig] "clientConnectTimeoutSec" was overridden with "5"
[UnityConnectServicesConfig] "clientHandshakeTimeoutSec" was overridden with "10"
[UnityConnectServicesConfig] Service configuration:
    "servicesConfigBaseUrl": "",
    "disableServicesWindow": false,
    "disableUserLogin": false,
    "entitlementCacheTimeoutInSeconds": 60,
    "clientConnectTimeoutSec": 5,
    "clientHandshakeTimeoutSec": 10,
    "clientResolveEntitlementsTimeoutSec": 30,
    "clientUpdateLicenseTimeoutSec": 30,
    "licensingServiceBaseUrl": "http://***:8080/",
    "enableProxyAutoconfig": "false"

(...)

[Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-cookapps" (connect: 0.27s, validation: 0.04s, handshake: 0.01s)
[Licensing::IpcConnector] Successfully connected to the License Notification on channel: "LicenseClient-cookapps-notifications" at "2025-10-13T05:07:16.796816Z"
[Licensing::Module] Connected to LicensingClient (PId: 1016, launch time: 0.00, total connection time: 0.33s)
[Licensing::Module] Error: Access token is unavailable; failed to update
[Licensing::Client] Successfully updated license
[Licensing::Client] Successfully resolved entitlement details
[Licensing::Module] Serial number assigned to: "accelerator_14569657689813_1_fd1379ac-fdd5-4052-a702-3681baf7XXXX"

Return license

Returning floating license: "fd1379ac-fdd5-4052-a702-3681baf7XXXX"
Trying to return floating license lease (fd1379ac-fdd5-4052-a702-3681baf7XXXX) to: *** ...
License lease returned successfully

(Added) I believe some users use the method mentioned in the comments, and I also verified that it does not break existing workflows.

(2) Not using the license server

The result is the same as the current upstream main branch.

@webbertakken
Copy link
Member

After merging main, you'll also have to run yarn and rebuild the dist file. If you don't mind doing that we'll merge it.

@davidmfinol davidmfinol merged commit ab64768 into game-ci:main Oct 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants