mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-01 06:16:14 -07:00
Compare commits
3 Commits
chore/depe
...
fix/issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd95ad9604 | ||
|
|
d829bfc901 | ||
|
|
2240bedf08 |
@@ -95,7 +95,7 @@ jobs:
|
||||
- name: Run plugin interface unit tests
|
||||
run: |
|
||||
echo "Running orchestrator-plugin unit tests..."
|
||||
npx jest orchestrator-plugin --verbose --detectOpenHandles --forceExit
|
||||
npx vitest run orchestrator-plugin --reporter=verbose
|
||||
|
||||
- name: Build and pack orchestrator
|
||||
working-directory: orchestrator-standalone
|
||||
@@ -167,6 +167,10 @@ jobs:
|
||||
continue-on-error: true
|
||||
id: orch-branch
|
||||
|
||||
- name: Clean corrupted checkout
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
run: rm -rf .git || true
|
||||
|
||||
- name: Fallback to orchestrator main branch
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
uses: actions/checkout@v4
|
||||
@@ -320,9 +324,20 @@ jobs:
|
||||
- name: Run orchestrator unit tests (fast, no infra)
|
||||
timeout-minutes: 2
|
||||
run: >-
|
||||
yarn run test
|
||||
--testPathPattern="orchestrator-guid|orchestrator-folders|task-parameter-serializer|follow-log-stream-service|runner-availability-service|provider-url-parser|provider-loader|provider-git-manager|orchestrator-image|orchestrator-hooks|orchestrator-github-checks|middleware-service"
|
||||
--verbose --detectOpenHandles --forceExit --runInBand
|
||||
yarn vitest run
|
||||
"orchestrator-guid"
|
||||
"orchestrator-folders"
|
||||
"task-parameter-serializer"
|
||||
"follow-log-stream-service"
|
||||
"runner-availability-service"
|
||||
"provider-url-parser"
|
||||
"provider-loader"
|
||||
"provider-git-manager"
|
||||
"orchestrator-image"
|
||||
"orchestrator-hooks"
|
||||
"orchestrator-github-checks"
|
||||
"middleware-service"
|
||||
--reporter=verbose --no-file-parallelism
|
||||
|
||||
# --- K8s cluster setup ---
|
||||
- name: Clean up disk space before K8s tests
|
||||
@@ -372,7 +387,7 @@ jobs:
|
||||
# --- K8s Test 1: orchestrator-image ---
|
||||
- name: Run orchestrator-image test (K8s)
|
||||
timeout-minutes: 10
|
||||
run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-image" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -396,7 +411,7 @@ jobs:
|
||||
# --- K8s Test 2: orchestrator-kubernetes ---
|
||||
- name: Run orchestrator-kubernetes test
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-kubernetes" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-kubernetes" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -428,7 +443,7 @@ jobs:
|
||||
# --- K8s Test 3: orchestrator-s3-steps ---
|
||||
- name: Run orchestrator-s3-steps test (K8s)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-s3-steps" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -461,7 +476,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-caching test (K8s)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -500,7 +515,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-retaining test (K8s)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-retaining" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-retaining" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -560,6 +575,10 @@ jobs:
|
||||
continue-on-error: true
|
||||
id: orch-branch
|
||||
|
||||
- name: Clean corrupted checkout
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
run: rm -rf .git || true
|
||||
|
||||
- name: Fallback to orchestrator main branch
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
uses: actions/checkout@v4
|
||||
@@ -650,7 +669,7 @@ jobs:
|
||||
# --- AWS Test 1: orchestrator-image ---
|
||||
- name: Run orchestrator-image test (AWS)
|
||||
timeout-minutes: 10
|
||||
run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-image" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -668,7 +687,7 @@ jobs:
|
||||
# --- AWS Test 2: orchestrator-environment ---
|
||||
- name: Run orchestrator-environment test (AWS)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-environment" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-environment" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -686,7 +705,7 @@ jobs:
|
||||
# --- AWS Test 3: orchestrator-s3-steps ---
|
||||
- name: Run orchestrator-s3-steps test (AWS)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-s3-steps" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -704,7 +723,7 @@ jobs:
|
||||
# --- AWS Test 4: orchestrator-hooks ---
|
||||
- name: Run orchestrator-hooks test (AWS)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-hooks" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-hooks" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -722,7 +741,7 @@ jobs:
|
||||
# --- AWS Test 5: orchestrator-caching ---
|
||||
- name: Run orchestrator-caching test (AWS)
|
||||
timeout-minutes: 60
|
||||
run: yarn run test "orchestrator-caching" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-caching" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -740,7 +759,7 @@ jobs:
|
||||
# --- AWS Test 6: orchestrator-locking-core ---
|
||||
- name: Run orchestrator-locking-core test (AWS)
|
||||
timeout-minutes: 60
|
||||
run: yarn run test "orchestrator-locking-core" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-locking-core" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -758,7 +777,7 @@ jobs:
|
||||
# --- AWS Test 7: orchestrator-locking-get-locked ---
|
||||
- name: Run orchestrator-locking-get-locked test (AWS)
|
||||
timeout-minutes: 60
|
||||
run: yarn run test "orchestrator-locking-get-locked" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-locking-get-locked" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -782,7 +801,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-caching test (AWS)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -801,7 +820,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-retaining test (AWS)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-retaining" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-retaining" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -820,7 +839,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-locking test (AWS)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-locking" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-locking" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -865,6 +884,10 @@ jobs:
|
||||
continue-on-error: true
|
||||
id: orch-branch
|
||||
|
||||
- name: Clean corrupted checkout
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
run: rm -rf .git || true
|
||||
|
||||
- name: Fallback to orchestrator main branch
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
uses: actions/checkout@v4
|
||||
@@ -954,7 +977,7 @@ jobs:
|
||||
# --- Local Docker Test 1: orchestrator-image ---
|
||||
- name: Run orchestrator-image test (local-docker)
|
||||
timeout-minutes: 10
|
||||
run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-image" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -972,7 +995,7 @@ jobs:
|
||||
# --- Local Docker Test 2: orchestrator-hooks ---
|
||||
- name: Run orchestrator-hooks test (local-docker)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-hooks" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-hooks" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -990,7 +1013,7 @@ jobs:
|
||||
# --- Local Docker Test 3: orchestrator-local-persistence ---
|
||||
- name: Run orchestrator-local-persistence test (local-docker)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-local-persistence" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-local-persistence" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1008,7 +1031,7 @@ jobs:
|
||||
# --- Local Docker Test 4: orchestrator-caching ---
|
||||
- name: Run orchestrator-caching test (local-docker)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-caching" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-caching" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1026,7 +1049,7 @@ jobs:
|
||||
# --- Local Docker Test 5: orchestrator-github-checks ---
|
||||
- name: Run orchestrator-github-checks test (local-docker)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-github-checks" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-github-checks" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1044,7 +1067,7 @@ jobs:
|
||||
# --- Local Docker Test 6: orchestrator-locking-core (with S3) ---
|
||||
- name: Run orchestrator-locking-core test (local-docker + S3)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-locking-core" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-locking-core" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1062,7 +1085,7 @@ jobs:
|
||||
# --- Local Docker Test 7: orchestrator-locking-get-locked (with S3) ---
|
||||
- name: Run orchestrator-locking-get-locked test (local-docker + S3)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-locking-get-locked" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-locking-get-locked" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1080,7 +1103,7 @@ jobs:
|
||||
# --- Local Docker Test 8: orchestrator-s3-steps (with S3) ---
|
||||
- name: Run orchestrator-s3-steps test (local-docker + S3)
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-s3-steps" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1099,7 +1122,7 @@ jobs:
|
||||
- name: Run orchestrator-end2end-caching test (local-docker + S3)
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
@@ -1144,6 +1167,10 @@ jobs:
|
||||
continue-on-error: true
|
||||
id: orch-branch
|
||||
|
||||
- name: Clean corrupted checkout
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
run: rm -rf .git || true
|
||||
|
||||
- name: Fallback to orchestrator main branch
|
||||
if: steps.orch-branch.outcome == 'failure'
|
||||
uses: actions/checkout@v4
|
||||
@@ -1220,7 +1247,7 @@ jobs:
|
||||
# --- Rclone Test ---
|
||||
- name: Run orchestrator-rclone-steps test
|
||||
timeout-minutes: 30
|
||||
run: yarn run test "orchestrator-rclone-steps" --detectOpenHandles --forceExit --runInBand
|
||||
run: yarn run test "orchestrator-rclone-steps" --no-file-parallelism
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
|
||||
14
action.yml
14
action.yml
@@ -168,6 +168,14 @@ inputs:
|
||||
default: ''
|
||||
required: false
|
||||
description: 'The Unity licensing server address to use for activating Unity.'
|
||||
unityLicensingToolset:
|
||||
default: ''
|
||||
required: false
|
||||
description:
|
||||
'Optional toolset identifier for Unity floating-license servers that host multiple toolsets (e.g.
|
||||
"LicenseServer_1234567890_3"). When set, written to services-config.json so the Licensing Client
|
||||
requests entitlements from the named toolset instead of relying on the server-side default. Leave
|
||||
empty to preserve previous behavior.'
|
||||
dockerWorkspacePath:
|
||||
default: '/github/workspace'
|
||||
required: false
|
||||
@@ -178,6 +186,10 @@ inputs:
|
||||
default: 'false'
|
||||
required: false
|
||||
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
|
||||
linux64RemoveExecutableExtension:
|
||||
default: 'false'
|
||||
required: false
|
||||
description: 'When building for StandaloneLinux64, remove the default file extension of `.x86_64`. Set to true to restore the extensionless behavior from v4.'
|
||||
|
||||
outputs:
|
||||
volume:
|
||||
@@ -195,5 +207,5 @@ branding:
|
||||
icon: 'box'
|
||||
color: 'gray-dark'
|
||||
runs:
|
||||
using: 'node20'
|
||||
using: 'node24'
|
||||
main: 'dist/index.js'
|
||||
|
||||
12926
dist/index.js
generated
vendored
12926
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
120
dist/licenses.txt
generated
vendored
120
dist/licenses.txt
generated
vendored
@@ -870,51 +870,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
commander
|
||||
MIT
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
commander-ts
|
||||
ISC
|
||||
Copyright 2018 Matt Strom <matt@mattstrom.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
concat-map
|
||||
MIT
|
||||
This software is released under the MIT license:
|
||||
@@ -1219,64 +1174,6 @@ SOFTWARE.
|
||||
|
||||
|
||||
|
||||
reflect-metadata
|
||||
Apache-2.0
|
||||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
semver
|
||||
ISC
|
||||
The ISC License
|
||||
@@ -1441,20 +1338,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
yaml
|
||||
ISC
|
||||
Copyright Eemeli Aro <eemeli@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
8
dist/platforms/ubuntu/entrypoint.sh
vendored
8
dist/platforms/ubuntu/entrypoint.sh
vendored
@@ -71,8 +71,12 @@ if [[ "$RUN_AS_HOST_USER" == "true" ]]; then
|
||||
# Don't stop on error when running our scripts as error handling is baked in
|
||||
set +e
|
||||
|
||||
# Switch to the host user so we can create files with the correct ownership
|
||||
su $USERNAME -c "$SHELL -c 'source /steps/runsteps.sh'"
|
||||
# Switch to the host user so we can create files with the correct ownership.
|
||||
# Pass HOME/USER explicitly so the Unity Licensing Client (which writes to
|
||||
# ~/.config/unity3d) resolves a real, writable home directory rather than
|
||||
# falling back to /home/UNKNOWN when getpwuid() inside the container has no
|
||||
# entry for the host UID. -p preserves the rest of the env from root.
|
||||
su -p $USERNAME -c "HOME=/home/$USERNAME USER=$USERNAME LOGNAME=$USERNAME $SHELL -c 'source /steps/runsteps.sh'"
|
||||
else
|
||||
echo "Running as root"
|
||||
|
||||
|
||||
@@ -36,11 +36,8 @@
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^6.0.1",
|
||||
"commander": "^9.5.0",
|
||||
"commander-ts": "^0.2.0",
|
||||
"md5": "^2.3.0",
|
||||
"nanoid": "^3.3.12",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"semver": "^7.7.4",
|
||||
"ts-md5": "^1.3.1",
|
||||
"unity-changeset": "^3.1.0",
|
||||
|
||||
@@ -66,12 +66,6 @@ vi.mock('./model', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('./model/cli/cli', () => ({
|
||||
Cli: {
|
||||
InitCliMode: vi.fn().mockReturnValue(false),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('./model/mac-builder', () => ({
|
||||
__esModule: true,
|
||||
default: {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as core from '@actions/core';
|
||||
import { Action, BuildParameters, Cache, Docker, ImageTag, Output } from './model';
|
||||
import { Cli } from './model/cli/cli';
|
||||
import MacBuilder from './model/mac-builder';
|
||||
import PlatformSetup from './model/platform-setup';
|
||||
import { Plugin, loadPlugin } from './model/plugin';
|
||||
@@ -9,11 +8,6 @@ import { Plugin, loadPlugin } from './model/plugin';
|
||||
// vitest's module re-loading (which changed in vitest 4).
|
||||
export async function runMain() {
|
||||
try {
|
||||
if (Cli.InitCliMode()) {
|
||||
await Cli.RunCli();
|
||||
|
||||
return;
|
||||
}
|
||||
Action.checkCompatibility();
|
||||
Cache.verify();
|
||||
|
||||
|
||||
@@ -117,18 +117,28 @@ describe('BuildParameters', () => {
|
||||
});
|
||||
|
||||
test.each`
|
||||
targetPlatform | expectedExtension | androidExportType
|
||||
${Platform.types.Android} | ${'.apk'} | ${'androidPackage'}
|
||||
${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'}
|
||||
${Platform.types.Android} | ${''} | ${'androidStudioProject'}
|
||||
${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'}
|
||||
${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'}
|
||||
targetPlatform | expectedExtension | androidExportType | linux64RemoveExecutableExtension
|
||||
${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} | ${false}
|
||||
${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} | ${true}
|
||||
${Platform.types.Android} | ${''} | ${'androidStudioProject'} | ${false}
|
||||
${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} | ${true}
|
||||
${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} | ${false}
|
||||
${Platform.types.StandaloneLinux64} | ${'.x86_64'} | ${'n/a'} | ${false}
|
||||
${Platform.types.StandaloneLinux64} | ${''} | ${'n/a'} | ${true}
|
||||
`(
|
||||
'appends $expectedExtension for $targetPlatform with androidExportType $androidExportType',
|
||||
async ({ targetPlatform, expectedExtension, androidExportType }) => {
|
||||
'appends $expectedExtension for $targetPlatform with linux64RemoveExecutableExtension=$linux64RemoveExecutableExtension',
|
||||
async ({
|
||||
targetPlatform,
|
||||
expectedExtension,
|
||||
androidExportType,
|
||||
linux64RemoveExecutableExtension,
|
||||
}) => {
|
||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
|
||||
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
|
||||
vi.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType);
|
||||
vi.spyOn(Input, 'linux64RemoveExecutableExtension', 'get').mockReturnValue(
|
||||
linux64RemoveExecutableExtension,
|
||||
);
|
||||
await expect(BuildParameters.create()).resolves.toEqual(
|
||||
expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }),
|
||||
);
|
||||
@@ -218,6 +228,14 @@ describe('BuildParameters', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('returns the unity licensing toolset', async () => {
|
||||
const mockValue = 'LicenseServer_1234567890_3';
|
||||
vi.spyOn(Input, 'unityLicensingToolset', 'get').mockReturnValue(mockValue);
|
||||
await expect(BuildParameters.create()).resolves.toEqual(
|
||||
expect.objectContaining({ unityLicensingToolset: mockValue }),
|
||||
);
|
||||
});
|
||||
|
||||
it('throws error when no unity license provider provided', async () => {
|
||||
delete process.env.UNITY_LICENSE; // Need to delete this as it is set for every test currently
|
||||
await expect(BuildParameters.create()).rejects.toThrowError();
|
||||
|
||||
@@ -6,7 +6,7 @@ import UnityVersioning from './unity-versioning';
|
||||
import Versioning from './versioning';
|
||||
import { GitRepoReader } from './input-readers/git-repo';
|
||||
import { GithubCliReader } from './input-readers/github-cli';
|
||||
import { Cli } from './cli/cli';
|
||||
import { PluginOptions } from './plugin-options';
|
||||
import GitHub from './github';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
@@ -18,6 +18,7 @@ class BuildParameters {
|
||||
public customImage!: string;
|
||||
public unitySerial!: string;
|
||||
public unityLicensingServer!: string;
|
||||
public unityLicensingToolset!: string;
|
||||
public skipActivation!: string;
|
||||
public runnerTempPath!: string;
|
||||
public targetPlatform!: string;
|
||||
@@ -73,6 +74,7 @@ class BuildParameters {
|
||||
Input.buildName,
|
||||
Input.targetPlatform,
|
||||
Input.androidExportType,
|
||||
Input.linux64RemoveExecutableExtension,
|
||||
);
|
||||
const editorVersion = UnityVersioning.determineUnityVersion(
|
||||
Input.projectPath,
|
||||
@@ -128,13 +130,14 @@ class BuildParameters {
|
||||
}
|
||||
|
||||
const providerStrategy =
|
||||
Input.getInput('providerStrategy') || (Cli.isCliMode ? 'aws' : 'local');
|
||||
Input.getInput('providerStrategy') || (PluginOptions.isPluginMode ? 'aws' : 'local');
|
||||
|
||||
return {
|
||||
editorVersion,
|
||||
customImage: Input.customImage,
|
||||
unitySerial,
|
||||
unityLicensingServer: Input.unityLicensingServer,
|
||||
unityLicensingToolset: Input.unityLicensingToolset,
|
||||
skipActivation: Input.skipActivation,
|
||||
runnerTempPath: Input.runnerTempPath,
|
||||
targetPlatform: Input.targetPlatform,
|
||||
@@ -181,14 +184,19 @@ class BuildParameters {
|
||||
'0123456789abcdefghijklmnopqrstuvwxyz',
|
||||
4,
|
||||
)()}`,
|
||||
isCliMode: Cli.isCliMode,
|
||||
isCliMode: PluginOptions.isPluginMode,
|
||||
cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac,
|
||||
unityHubVersionOnMac: Input.unityHubVersionOnMac,
|
||||
dockerWorkspacePath: Input.dockerWorkspacePath,
|
||||
};
|
||||
}
|
||||
|
||||
static parseBuildFile(filename: string, platform: string, androidExportType: string): string {
|
||||
static parseBuildFile(
|
||||
filename: string,
|
||||
platform: string,
|
||||
androidExportType: string,
|
||||
linux64RemoveExecutableExtension: boolean,
|
||||
): string {
|
||||
if (Platform.isWindows(platform)) {
|
||||
return `${filename}.exe`;
|
||||
}
|
||||
@@ -208,6 +216,10 @@ class BuildParameters {
|
||||
}
|
||||
}
|
||||
|
||||
if (platform === Platform.types.StandaloneLinux64 && !linux64RemoveExecutableExtension) {
|
||||
return `${filename}.x86_64`;
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
export class CliFunctionsRepository {
|
||||
private static targets: any[] = [];
|
||||
public static PushCliFunction(
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: PropertyDescriptor,
|
||||
key: string,
|
||||
description: string,
|
||||
) {
|
||||
CliFunctionsRepository.targets.push({
|
||||
target,
|
||||
propertyKey,
|
||||
descriptor,
|
||||
key,
|
||||
description,
|
||||
});
|
||||
}
|
||||
|
||||
public static GetCliFunctions(key: any) {
|
||||
const results = CliFunctionsRepository.targets.find((x) => x.key === key);
|
||||
if (results === undefined || results.length === 0) {
|
||||
throw new Error(`no CLI mode found for ${key}`);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public static GetAllCliModes() {
|
||||
return CliFunctionsRepository.targets.map((x) => {
|
||||
return {
|
||||
key: x.key,
|
||||
description: x.description,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static PushCliFunctionSource(cliFunction: any) {}
|
||||
}
|
||||
|
||||
export function CliFunction(key: string, description: string) {
|
||||
return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {
|
||||
CliFunctionsRepository.PushCliFunction(target, propertyKey, descriptor, key, description);
|
||||
};
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
import { Command } from 'commander-ts';
|
||||
import { Input } from '..';
|
||||
import * as core from '@actions/core';
|
||||
import { ActionYamlReader } from '../input-readers/action-yaml';
|
||||
import { CliFunction, CliFunctionsRepository } from './cli-functions-repository';
|
||||
import { OptionValues } from 'commander';
|
||||
import { InputKey } from '../input';
|
||||
|
||||
export class Cli {
|
||||
public static options: OptionValues | undefined;
|
||||
static get isCliMode() {
|
||||
return Cli.options !== undefined && Cli.options.mode !== undefined && Cli.options.mode !== '';
|
||||
}
|
||||
public static query(key: string, alternativeKey: string) {
|
||||
if (Cli.options && Cli.options[key] !== undefined) {
|
||||
return Cli.options[key];
|
||||
}
|
||||
if (Cli.options && alternativeKey && Cli.options[alternativeKey] !== undefined) {
|
||||
return Cli.options[alternativeKey];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public static InitCliMode() {
|
||||
const program = new Command();
|
||||
program.version('0.0.1');
|
||||
|
||||
const actionYamlReader: ActionYamlReader = new ActionYamlReader();
|
||||
const properties = Object.getOwnPropertyNames(Input).filter(
|
||||
(p) => p !== 'length' && p !== 'prototype' && p !== 'name',
|
||||
);
|
||||
for (const element of properties) {
|
||||
program.option(`--${element} <${element}>`, actionYamlReader.GetActionYamlValue(element));
|
||||
}
|
||||
program.option(
|
||||
'-m, --mode <mode>',
|
||||
CliFunctionsRepository.GetAllCliModes()
|
||||
.map((x) => `${x.key} (${x.description})`)
|
||||
.join(` | `),
|
||||
);
|
||||
program.option(
|
||||
'--populateOverride <populateOverride>',
|
||||
'should use override query to pull input false by default',
|
||||
);
|
||||
program.option('--cachePushFrom <cachePushFrom>', 'cache push from source folder');
|
||||
program.option('--cachePushTo <cachePushTo>', 'cache push to caching folder');
|
||||
program.option('--artifactName <artifactName>', 'caching artifact name');
|
||||
program.option('--select <select>', 'select a particular resource');
|
||||
program.option('--logFile <logFile>', 'output to log file (log stream only)');
|
||||
program.option('--profilePath <profilePath>', 'path to submodule profile YAML');
|
||||
program.option('--variantPath <variantPath>', 'path to submodule variant YAML');
|
||||
program.option('--agentPath <agentPath>', 'path to custom LFS transfer agent');
|
||||
program.option('--agentArgs <agentArgs>', 'arguments for custom LFS transfer agent');
|
||||
program.option(
|
||||
'--storagePaths <storagePaths>',
|
||||
'semicolon-separated storage paths for LFS agent',
|
||||
);
|
||||
program.parse(process.argv);
|
||||
Cli.options = program.opts();
|
||||
|
||||
return Cli.isCliMode;
|
||||
}
|
||||
|
||||
static async RunCli(): Promise<void> {
|
||||
const results = CliFunctionsRepository.GetCliFunctions(Cli.options?.mode);
|
||||
if (!results) {
|
||||
throw new Error(
|
||||
`Unknown CLI mode: ${Cli.options?.mode}. Orchestrator CLI features require @game-ci/orchestrator.`,
|
||||
);
|
||||
}
|
||||
core.info(`Entrypoint: ${results.key}`);
|
||||
Cli.options!.versioning = 'None';
|
||||
|
||||
return await results.target[results.propertyKey](Cli.options);
|
||||
}
|
||||
|
||||
@CliFunction(`print-input`, `prints all input`)
|
||||
private static logInput() {
|
||||
core.info(`\n`);
|
||||
core.info(`INPUT:`);
|
||||
const properties = Object.getOwnPropertyNames(Input).filter(
|
||||
(p) => p !== 'length' && p !== 'prototype' && p !== 'name',
|
||||
);
|
||||
for (const element of properties) {
|
||||
if (
|
||||
element in Input &&
|
||||
Input[element as InputKey] !== undefined &&
|
||||
Input[element as InputKey] !== '' &&
|
||||
typeof Input[element as InputKey] !== `function` &&
|
||||
element !== 'length' &&
|
||||
element !== 'cliOptions' &&
|
||||
element !== 'prototype'
|
||||
) {
|
||||
core.info(`${element} ${Input[element as InputKey]}`);
|
||||
}
|
||||
}
|
||||
core.info(`\n`);
|
||||
}
|
||||
}
|
||||
@@ -353,4 +353,22 @@ describe('Input', () => {
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('linux64RemoveExecutableExtension', () => {
|
||||
it('returns the default value', () => {
|
||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
|
||||
});
|
||||
|
||||
it('returns true when string true is passed', () => {
|
||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(true);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('returns false when string false is passed', () => {
|
||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { Cli } from './cli/cli';
|
||||
import { PluginOptions } from './plugin-options';
|
||||
import Platform from './platform';
|
||||
import GitHub from './github';
|
||||
import os from 'node:os';
|
||||
@@ -28,8 +28,8 @@ class Input {
|
||||
const alternativeQuery = Input.ToEnvVarFormat(query);
|
||||
|
||||
// Query input sources
|
||||
if (Cli.query(query, alternativeQuery)) {
|
||||
return Cli.query(query, alternativeQuery);
|
||||
if (PluginOptions.query(query, alternativeQuery)) {
|
||||
return PluginOptions.query(query, alternativeQuery);
|
||||
}
|
||||
|
||||
if (process.env[query] !== undefined) {
|
||||
@@ -122,6 +122,10 @@ class Input {
|
||||
return Input.getInput('unityLicensingServer') ?? '';
|
||||
}
|
||||
|
||||
static get unityLicensingToolset(): string {
|
||||
return Input.getInput('unityLicensingToolset') ?? '';
|
||||
}
|
||||
|
||||
static get buildMethod(): string {
|
||||
return Input.getInput('buildMethod') ?? ''; // Processed in docker file
|
||||
}
|
||||
@@ -284,6 +288,12 @@ class Input {
|
||||
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false';
|
||||
}
|
||||
|
||||
static get linux64RemoveExecutableExtension(): boolean {
|
||||
const input = Input.getInput('linux64RemoveExecutableExtension') ?? 'false';
|
||||
|
||||
return input === 'true';
|
||||
}
|
||||
|
||||
public static ToEnvVarFormat(input: string) {
|
||||
if (input.toUpperCase() === input) {
|
||||
return input;
|
||||
|
||||
@@ -32,6 +32,13 @@ class PlatformSetup {
|
||||
|
||||
let servicesConfig = fs.readFileSync(servicesConfigPathTemplate).toString();
|
||||
servicesConfig = servicesConfig.replace('%URL%', buildParameters.unityLicensingServer);
|
||||
|
||||
if (buildParameters.unityLicensingToolset) {
|
||||
const parsed = JSON.parse(servicesConfig);
|
||||
parsed.toolset = buildParameters.unityLicensingToolset;
|
||||
servicesConfig = JSON.stringify(parsed, undefined, 2);
|
||||
}
|
||||
|
||||
fs.writeFileSync(servicesConfigPath, servicesConfig);
|
||||
|
||||
SetupAndroid.setup(buildParameters);
|
||||
|
||||
32
src/model/plugin-options.ts
Normal file
32
src/model/plugin-options.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Shared options bridge between unity-builder and plugins (e.g. @game-ci/orchestrator).
|
||||
*
|
||||
* Plugins set PluginOptions.options to pass configuration into BuildParameters
|
||||
* and Input. When options are set, isPluginMode is true and query() reads
|
||||
* from the options map instead of @actions/core.getInput().
|
||||
*/
|
||||
export class PluginOptions {
|
||||
public static options: Record<string, any> | undefined;
|
||||
|
||||
static get isPluginMode() {
|
||||
return Boolean(PluginOptions.options?.mode);
|
||||
}
|
||||
|
||||
public static query(key: string, alternativeKey: string) {
|
||||
if (PluginOptions.options && PluginOptions.options[key] !== undefined) {
|
||||
return PluginOptions.options[key];
|
||||
}
|
||||
if (
|
||||
PluginOptions.options &&
|
||||
alternativeKey &&
|
||||
PluginOptions.options[alternativeKey] !== undefined
|
||||
) {
|
||||
return PluginOptions.options[alternativeKey];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Backwards-compatible alias — the orchestrator still imports { Cli }
|
||||
export { PluginOptions as Cli };
|
||||
28
yarn.lock
28
yarn.lock
@@ -2302,17 +2302,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"commander-ts@npm:^0.2.0":
|
||||
version: 0.2.0
|
||||
resolution: "commander-ts@npm:0.2.0"
|
||||
dependencies:
|
||||
commander: "npm:^7.2.0"
|
||||
peerDependencies:
|
||||
reflect-metadata: ^0.1.13
|
||||
checksum: 10/b57582d0eb98e7bce0a05bfe7c44b8ed01a0f77a05358ec9d35ef6406ac6b3031590fa49e1bff58649ae511bb18a576b01151cb94de9c12c7f0be7f865ca494f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"commander@npm:^10.0.1":
|
||||
version: 10.0.1
|
||||
resolution: "commander@npm:10.0.1"
|
||||
@@ -2341,13 +2330,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"commander@npm:^9.5.0":
|
||||
version: 9.5.0
|
||||
resolution: "commander@npm:9.5.0"
|
||||
checksum: 10/41c49b3d0f94a1fbeb0463c85b13f15aa15a9e0b4d5e10a49c0a1d58d4489b549d62262b052ae0aa6cfda53299bee487bfe337825df15e342114dde543f82906
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"common-path-prefix@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "common-path-prefix@npm:3.0.0"
|
||||
@@ -4214,13 +4196,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"reflect-metadata@npm:^0.2.2":
|
||||
version: 0.2.2
|
||||
resolution: "reflect-metadata@npm:0.2.2"
|
||||
checksum: 10/1c93f9ac790fea1c852fde80c91b2760420069f4862f28e6fae0c00c6937a56508716b0ed2419ab02869dd488d123c4ab92d062ae84e8739ea7417fae10c4745
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"regexp-tree@npm:^0.1.27":
|
||||
version: 0.1.27
|
||||
resolution: "regexp-tree@npm:0.1.27"
|
||||
@@ -4816,8 +4791,6 @@ __metadata:
|
||||
"@typescript/native-preview": "npm:^7.0.0-dev.20260505.1"
|
||||
"@vercel/ncc": "npm:^0.36.1"
|
||||
"@vitest/coverage-istanbul": "npm:^4.1.5"
|
||||
commander: "npm:^9.5.0"
|
||||
commander-ts: "npm:^0.2.0"
|
||||
cross-env: "npm:^7.0.3"
|
||||
eslint: "npm:^10.3.0"
|
||||
eslint-plugin-unicorn: "npm:^64.0.0"
|
||||
@@ -4829,7 +4802,6 @@ __metadata:
|
||||
node-fetch: "npm:2"
|
||||
oxfmt: "npm:^0.48.0"
|
||||
oxlint: "npm:^1.63.0"
|
||||
reflect-metadata: "npm:^0.2.2"
|
||||
semver: "npm:^7.7.4"
|
||||
ts-md5: "npm:^1.3.1"
|
||||
ts-node: "npm:10.8.1"
|
||||
|
||||
Reference in New Issue
Block a user