-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (102 loc) · 3.53 KB
/
example-licenses-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: test auth
on:
workflow_dispatch:
inputs:
editor_image:
description: 'Editor Image'
required: true
default: 'unityci/editor:ubuntu-2022.1.23f1-webgl-1'
selenium_image:
description: 'Selenium Image'
required: true
default: 'deserializeme/unity-self-auth:v0.0.1'
editor_version:
description: 'Editor Version'
required: true
default: '2022.1.23f1'
headless:
description: 'Run without GUI'
required: true
default: 'False'
jobs:
test-auth:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: setup
run: |
touch Unity_v$EDITOR_VERSION.alf
sudo chown 1000:1000 .
ls -hal .
shell: bash
env:
EDITOR_VERSION: ${{github.event.inputs.editor_version}}
EDITOR_IMAGE: ${{github.event.inputs.editor_image}}
- name: Generate alf
run: |
docker run --rm -v $(pwd)/Unity_v$EDITOR_VERSION.alf:/Unity_v${EDITOR_VERSION}.alf \
--user root \
$EDITOR_IMAGE \
unity-editor -quit \
-batchmode \
-nographics \
-logFile /dev/stdout \
-createManualActivationFile \
-username ${{ secrets.UNITY_USERNAME }} \
-password ${{ secrets.UNITY_PASSWORD }}
shell: bash
env:
EDITOR_VERSION: ${{github.event.inputs.editor_version}}
EDITOR_IMAGE: ${{github.event.inputs.editor_image}}
- name: Generate ulf
run: |
docker run --rm --mount type=bind,source=$(pwd),target=/home/player1/Downloads \
--user 1000:1000 \
-p 5900:5900 \
-e USERNAME=${{ secrets.UNITY_USERNAME }} \
-e PASSWORD=${{ secrets.UNITY_PASSWORD }} \
-e HEADLESS=$HEADLESS \
$SELENIUM_IMAGE \
./license.py ../Downloads/Unity_v$EDITOR_VERSION.alf
shell: bash
env:
SELENIUM_IMAGE: ${{github.event.inputs.selenium_image}}
EDITOR_VERSION: ${{github.event.inputs.editor_version}}
HEADLESS: ${{github.event.inputs.headless}}
#- name: Store and Mask License Data
# run: |
# UNITY_LICENSE=$(cat *.ulf)
# echo "::add-mask::$UNITY_LICENSE"
# echo UNITY_LICENSE=$UNITY_LICENSE >> $GITHUB_ENV
# shell: bash
# env:
# EDITOR_VERSION: ${{github.event.inputs.editor_version}}
# EDITOR_IMAGE: ${{github.event.inputs.editor_image}}
#- name: Add License as a Github Actions Secret
# uses: hmanzur/[email protected]
# with:
# name: 'UNITY_LICENSE'
# value: echo "$UNITY_LICENSE"
# token: ${{ secrets.PAT }}
#- name: Return Secret as file
# run: |
# sudo echo "$UNITY_LICENSE" > /tmp/Unity_v2022.x.ulf
# shell: bash
# env:
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
- name: Activate License
run: |
ls -hal && \
docker run --rm -v $(pwd):/home/player1/Downloads \
--user root \
$EDITOR_IMAGE \
unity-editor -quit \
-batchmode \
-nographics \
-logFile /dev/stdout \
-manualLicenseFile /home/player1/Downloads/Unity_v2022.x.ulf
shell: bash
env:
EDITOR_VERSION: ${{github.event.inputs.editor_version}}
EDITOR_IMAGE: ${{github.event.inputs.editor_image}}