mirror of
https://github.com/game-ci/unity-actions.git
synced 2026-01-29 04:39:07 +08:00
Add license and test step
This commit is contained in:
32
README.md
32
README.md
@@ -6,8 +6,8 @@ Feel free to contribute.
|
|||||||
|
|
||||||
## Jobs
|
## Jobs
|
||||||
|
|
||||||
- [ ] Checkout project
|
- [X] Checkout project
|
||||||
- [ ] Acquire license
|
- [X] Activate license
|
||||||
- [ ] Open project in Unity
|
- [ ] Open project in Unity
|
||||||
- [ ] Install dependencies
|
- [ ] Install dependencies
|
||||||
- [ ] Perform test suite
|
- [ ] Perform test suite
|
||||||
@@ -25,33 +25,9 @@ Feel free to contribute.
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
Add the following yaml to your workflow in `.github/workflows/main.yml`
|
Create a workflow in `.github/workflows/main.yml`.
|
||||||
|
|
||||||
```yaml
|
- Activate license: [readme](./activate/README.md).
|
||||||
name: Testing and building my Unity project
|
|
||||||
on: push
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Test
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
|
|
||||||
- name: Get license
|
|
||||||
uses: webbertakken/unity-actions/get-license@master
|
|
||||||
env:
|
|
||||||
UNITY_USERNAME: ${{ secrets.UNITY_USERNAME }}
|
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_USERNAME }}
|
|
||||||
|
|
||||||
- name: Test project
|
|
||||||
uses: webbertakken/unity-actions/test@master
|
|
||||||
env:
|
|
||||||
FOLDER: .
|
|
||||||
PLATFORM: playmode
|
|
||||||
```
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM gableroux/unity3d:2019.2.11f1-webgl
|
FROM gableroux/unity3d:2019.2.11f1-webgl
|
||||||
|
|
||||||
LABEL "com.github.actions.name"="Unity get license"
|
LABEL "com.github.actions.name"="Activate Unity"
|
||||||
LABEL "com.github.actions.description"="Retrieve license for Unity editor"
|
LABEL "com.github.actions.description"="Activate license for Unity editor"
|
||||||
LABEL "com.github.actions.icon"="box"
|
LABEL "com.github.actions.icon"="box"
|
||||||
LABEL "com.github.actions.color"="gray-dark"
|
LABEL "com.github.actions.color"="gray-dark"
|
||||||
|
|
||||||
40
activate/README.md
Normal file
40
activate/README.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Activate Unity
|
||||||
|
|
||||||
|
Activates personal of professional license of unity.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
#### Personal license example
|
||||||
|
|
||||||
|
1. Goto `Repository` > `Settings` > `Secrets`
|
||||||
|
2. Create a new secret called `UNITY_LICENSE`
|
||||||
|
3. Find the license file:
|
||||||
|
- Windows: `C:/ProgramData/Unity/Unity_lic.ulf`
|
||||||
|
- MacOS: `/Library/Application Support/Unity/Unity_lic.ulf`
|
||||||
|
4. Copy the contents into the value field of the secret `UNITY_LICENSE`
|
||||||
|
5. Use the action as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Activate Unity
|
||||||
|
uses: webbertakken/unity-actions/activate@master
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Professional license example
|
||||||
|
|
||||||
|
1. Goto `Repository` > `Settings` > `Secrets`
|
||||||
|
2. Set the following secrets:
|
||||||
|
- `UNITY_EMAIL`: <your_unity_login_email_address>
|
||||||
|
- `UNITY_PASSWORD`: <your_unity_login_password>
|
||||||
|
- `UNITY_SERIAL`: <your_unity_serial>
|
||||||
|
3. Use the action as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Activate Unity
|
||||||
|
uses: webbertakken/unity-actions/activate@master
|
||||||
|
env:
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
|
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
|
||||||
|
```
|
||||||
38
activate/entrypoint.sh
Normal file
38
activate/entrypoint.sh
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ ! -z "$UNITY_LICENSE" ]]; then
|
||||||
|
#
|
||||||
|
# PERSONAL LICENSE MODE
|
||||||
|
#
|
||||||
|
# This will activate Unity, using a license file
|
||||||
|
#
|
||||||
|
# Note that this is the ONLY WAY for PERSONAL LICENSES in 2019.
|
||||||
|
# * See for more details: https://gitlab.com/gableroux/unity3d-gitlab-ci-example/issues/5#note_72815478
|
||||||
|
#
|
||||||
|
# The license file can be found here:
|
||||||
|
# * Windows: C:/ProgramData/Unity/Unity_lic.ulf
|
||||||
|
# * MacOS: /Library/Application Support/Unity/Unity_lic.ulf
|
||||||
|
#
|
||||||
|
echo "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf
|
||||||
|
else
|
||||||
|
#
|
||||||
|
# PROFESSIONAL (SERIAL) LICENSE MODE
|
||||||
|
#
|
||||||
|
# This will activate unity, using the activating process.
|
||||||
|
#
|
||||||
|
# Note: This is the preferred way for PROFESSIONAL LICENSES.
|
||||||
|
#
|
||||||
|
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||||
|
/opt/Unity/Editor/Unity \
|
||||||
|
-logFile /dev/stdout \
|
||||||
|
-batchmode \
|
||||||
|
-username "$UNITY_EMAIL" \
|
||||||
|
-password "$UNITY_PASSWORD" \
|
||||||
|
-serial "$UNITY_SERIAL" \
|
||||||
|
-nographics \
|
||||||
|
-verbose \
|
||||||
|
-quit \
|
||||||
|
-projectPath "$(pwd)"
|
||||||
|
fi
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
|
||||||
/opt/Unity/Editor/Unity \
|
|
||||||
-logFile /dev/stdout \
|
|
||||||
-batchmode \
|
|
||||||
-username "$UNITY_USERNAME" -password "$UNITY_PASSWORD"
|
|
||||||
Reference in New Issue
Block a user