game-ci / unity-builder

Build Unity projects for different platforms
https://github.com/marketplace/actions/unity-builder
MIT License
853 stars 253 forks source link

Feature/licensing server macos #573

Open simensan opened 1 year ago

simensan commented 1 year ago

Changes

I do not have ability to verify that the username/password/serial flow still works. So please sanity check the changes, or even better test it if you have ability to. I had to remove sending in username/password in build.sh, but that shouldn't be required as it is activated already, and we do not do that in the ubuntu version of build.sh.

Checklist

github-actions[bot] commented 1 year ago

Cat Gif

codecov-commenter commented 1 year ago

Codecov Report

Merging #573 (d2f8361) into main (a13443a) will not change coverage. The diff coverage is n/a.

:exclamation: Current head d2f8361 differs from pull request most recent head 482c00f. Consider uploading reports for the commit 482c00f to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/game-ci/unity-builder/pull/573/graphs/tree.svg?width=650&height=150&src=pr&token=eRCPplc2s1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=game-ci)](https://app.codecov.io/gh/game-ci/unity-builder/pull/573?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=game-ci) ```diff @@ Coverage Diff @@ ## main #573 +/- ## ======================================= Coverage 37.02% 37.02% ======================================= Files 77 77 Lines 3041 3041 Branches 632 632 ======================================= Hits 1126 1126 Misses 1765 1765 Partials 150 150 ```
simensan commented 1 year ago

Hi, any chance to merge this in? I have another dependent PR lined up. Thanks!

AndrewKahr commented 1 year ago

Hey there! Apologies for the extreme delay. We can work on getting this merged but there are a few merge conflicts that need to be resolved before we can merge. If you could resolve them then ping for a review here I can make that happen.

jfranco-cap commented 1 month ago

+1

jfranco-cap commented 1 month ago

for those needing license activation from server licensing on mac. A workaround I'm using is skipping license activation and passing an custom parameter for adquiring the license.

- name: Configure License
      shell: bash
      run: |
        # Define the config file path
        CONFIG_FILE="/Library/Application Support/Unity/config/services-config.json"
        UNITY_LICENSE_PATH="/Library/Application Support/Unity/config"

        # Define the JSON content
        JSON_CONTENT='{
          "licensingServiceBaseUrl": "http://localhost:8080",
          "enableEntitlementLicensing": true,
          "hubEnableWorkOffline": true,
          "clientConnectTimeoutSec": 60,
          "clientHandshakeTimeoutSec": 30
        }'

        if [ ! -d "$UNITY_LICENSE_PATH" ]; then
          echo "Creating Unity License Directory"
          sudo mkdir -p "$UNITY_LICENSE_PATH"
          sudo chmod -R 777 "$UNITY_LICENSE_PATH"
        fi;

        # Write the JSON content to the config file
        echo "$JSON_CONTENT" > "$CONFIG_FILE"

        # Set the correct permissions for the file
        sudo chmod 644 "$CONFIG_FILE"

        echo "License configuration file updated successfully at $CONFIG_FILE"

    - uses: game-ci/unity-builder@v4.2.3
      name: Execute Unity Build on MacOS
      with:
        unityLicensingServer: 'http://localhost:8080'
        # if using server license
        skipActivation: 'true'
        customParameters: --acquire-floating
        targetPlatform: ${{ inputs.target-platform }}
        projectPath: ${{ inputs.path }}
        buildsPath: ${{ inputs.build-path }}
        allowDirtyBuild: true
        cacheUnityInstallationOnMac: ${{ inputs.cache-unity-installation }}
        versioning: ${{ inputs.version != '' && inputs.version || 'Semantic' }}