Skip to content

Commit fe6d0ae

Browse files
committed
Add initial version
1 parent 784cd6f commit fe6d0ae

File tree

5 files changed

+120
-4
lines changed

5 files changed

+120
-4
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Order ignore, include
2+
*
3+
4+
# Files required for the action
5+
!entrypoint.sh
6+
!action.yml

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM gableroux/unity3d:2019.2.11f1
2+
3+
LABEL "com.github.actions.name"="Unity - Request Activation File"
4+
LABEL "com.github.actions.description"="Request the manual activation file for activating Unity personal"
5+
LABEL "com.github.actions.icon"="box"
6+
LABEL "com.github.actions.color"="gray-dark"
7+
8+
LABEL "repository"="http://github.com/webbertakken/unity-actions"
9+
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
10+
LABEL "maintainer"="Webber Takken <[email protected]>"
11+
12+
ADD entrypoint.sh /entrypoint.sh
13+
RUN chmod +x /entrypoint.sh
14+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,67 @@
1-
# Unity - Request Manual Activation File
2-
Github Action for requesting Unity's manual activation file.
1+
# Unity - Request Activation File
2+
[Github Action](https://github.com/features/actions) for requesting the manual activation file, used to acquire a Unity personal license.
33

4-
Required to acquire a license, used in the **Activate**, **Test** and **Build** actions
4+
Required for the
5+
[Activate](https://github.com/webbertakken/unity-actions#activate),
6+
[Test](https://github.com/webbertakken/unity-actions#test) and
7+
[Build](https://github.com/webbertakken/unity-actions#build)
8+
actions from the
9+
[Unity Actions](https://github.com/webbertakken/unity-actions)
10+
collection.
511

6-
This action is part of the [Unity Actions](https://github.com/webbertakken/unity-actions) collection
12+
## Usage
13+
14+
Create a file called `.github/workflows/activation.yml` and add a job to it.
15+
16+
```yaml
17+
name: Acquire activation file
18+
on: [push]
19+
jobs:
20+
activation:
21+
name: Request manual activation file 🔑
22+
steps:
23+
```
24+
25+
To **configure** this action, add this step and set the id.
26+
27+
```yaml
28+
# Request manual activation file
29+
- name: Request manual activation file
30+
uses: webbertakken/unity-request-manual-activation-file@v1
31+
id: getManualLicenseFile
32+
```
33+
34+
You use the id to **upload the output file** like so:
35+
36+
```yaml
37+
# Upload artifact (Unity_v20XX.X.XXXX.alf)
38+
- name: Expose as artifact
39+
uses: actions/upload-artifact@v1
40+
with:
41+
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
42+
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
43+
```
44+
45+
Commit and push your workflow definition.
46+
47+
## Activation
48+
49+
Follow these (one-time) steps for simple activation.
50+
51+
- Download the manual activation file that now appeared as an artifact.
52+
- Visit [license.unity3d.com](https://license.unity3d.com/manual) and upload it.
53+
- You should now receive your license file (Unity_v20XX.x.ulf) as a download.
54+
- Open `Github` > `Your repository` > `Settings` > `Secrets`.
55+
- Add a new secret called `UNITY_LICENSE` and copy the contents your license file into it.
56+
57+
You can now use the
58+
[Activate](https://github.com/webbertakken/unity-actions#activate),
59+
[Test](https://github.com/webbertakken/unity-actions#test) and
60+
[Build](https://github.com/webbertakken/unity-actions#build)
61+
actions.
62+
63+
## More actions
64+
65+
Visit
66+
[webbertakken/unity-actions](https://github.com/webbertakken/unity-actions)
67+
to find related actions for Unity.

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: 'Unity - Request Activation File'
2+
description: 'Request the manual activation file for acquiring a Unity personal license.'
3+
outputs:
4+
filePath:
5+
description: 'Path of the manual activation file'
6+
runs:
7+
using: 'docker'
8+
image: 'Dockerfile'

entrypoint.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# The container's unity version
4+
UNITY_VERSION=2019.2.11f1
5+
6+
# Determine the expected file name and path
7+
FILE_NAME=Unity_v$UNITY_VERSION.alf
8+
FILE_PATH=$FILE_NAME
9+
10+
# Request the manual activation file for activating unity personal
11+
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
12+
/opt/Unity/Editor/Unity \
13+
-batchmode \
14+
-nographics \
15+
-logFile /dev/stdout \
16+
-quit \
17+
-createManualActivationFile
18+
19+
# Output the resulting file by copying
20+
cp $FILE_NAME $HOME/$FILE_PATH
21+
22+
# Set resulting name as output variable
23+
echo ::set-output name=filePath::$FILE_PATH
24+
25+
# Explain what to do next
26+
echo "Use the file \"$FILE_PATH\" for manual activation."
27+
echo "Set the contents of the resulting license file as the \$UNITY_LICENSE variabe."

0 commit comments

Comments
 (0)