-
Notifications
You must be signed in to change notification settings - Fork 0
Shenanigans #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Shenanigans #3
Conversation
This is the initial unity project
.gitignore setup by Tom
|
needs license, im sleepy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Configure Unity license (Linux) | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # generate .ulf from any machine where you’ve activated Unity Personal (Hub -> Manage License -> “Manual activation” -> save the license file)” and upload the response Unity emails back. Once you have the .ulf, add UNITY_LICENSE to your repo’s secrets with its base64 text; the workflow will then decode it and tests will run on all three OS runners. | ||
| run: | | ||
| python3 -c "import base64, os, sys, pathlib; data=os.environ.get('UNITY_LICENSE'); \ | ||
| if not data: sys.stderr.write('UNITY_LICENSE secret is required to run Unity in CI.\n'); sys.exit(1); \ | ||
| target = pathlib.Path.home() / '.local/share/unity3d/Unity/Unity_lic.ulf'; \ | ||
| target.parent.mkdir(parents=True, exist_ok=True); \ | ||
| target.write_bytes(base64.b64decode(data)); \ | ||
| print(f'Wrote Unity license to {target}')" | ||
| echo "UNITY_LICENSE_FILE=$HOME/.local/share/unity3d/Unity/Unity_lic.ulf" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Configure Unity license (macOS) | ||
| if: runner.os == 'macOS' | ||
| shell: bash | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
| run: | | ||
| python3 -c "import base64, os, sys, pathlib; data=os.environ.get('UNITY_LICENSE'); \ | ||
| if not data: sys.stderr.write('UNITY_LICENSE secret is required to run Unity in CI.\n'); sys.exit(1); \ | ||
| target = pathlib.Path.home() / 'Library/Application Support/Unity/Unity_lic.ulf'; \ | ||
| target.parent.mkdir(parents=True, exist_ok=True); \ | ||
| target.write_bytes(base64.b64decode(data)); \ | ||
| print(f'Wrote Unity license to {target}')" | ||
| echo "UNITY_LICENSE_FILE=$HOME/Library/Application Support/Unity/Unity_lic.ulf" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Configure Unity license (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
| run: | | ||
| if (-not $env:UNITY_LICENSE) { | ||
| Write-Error "UNITY_LICENSE secret is required to run Unity in CI." -ErrorAction Stop | ||
| } | ||
| $licenseDir = Join-Path $env:LOCALAPPDATA 'Unity' | ||
| New-Item -ItemType Directory -Path $licenseDir -Force | Out-Null | ||
| $licensePath = Join-Path $licenseDir 'Unity_lic.ulf' | ||
| [System.IO.File]::WriteAllBytes($licensePath, [System.Convert]::FromBase64String($env:UNITY_LICENSE)) | ||
| Add-Content -Path $env:GITHUB_ENV -Value "UNITY_LICENSE_FILE=$licensePath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gate Unity CI when secrets are unavailable
The workflow unconditionally requires secrets.UNITY_LICENSE and exits with an error when it is absent. GitHub does not expose repository secrets to pull_request workflows triggered from forks, so any external contributor PR will fail before tests even run. Consider guarding the license configuration and test steps behind a check for a present secret or skipping the entire job when the event originates from a fork to keep CI usable for outside contributions.
Useful? React with 👍 / 👎.
|
I summon thee @vecipher to get the license make it a secret in the settings of the repo. I believe you get the License from unity hub and then manage license. |
No description provided.