Skip to content

Commit f152357

Browse files
committed
wip: read .ulf from secrets
1 parent dbc617c commit f152357

File tree

4 files changed

+17
-42
lines changed

4 files changed

+17
-42
lines changed

.github/workflows/linux-test.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
type: boolean
99
default: false
1010
secrets:
11+
UNITY_LICENSE_BASE64:
12+
required: true
1113
UNITY_EMAIL:
1214
required: true
1315
UNITY_PASSWORD:
@@ -106,7 +108,7 @@ jobs:
106108
os:
107109
- ubuntu-24.04
108110
unityVersion:
109-
- 6000.0.33f1 # FIXME: use >= 6000.0.58f2
111+
- 6000.0.58f2
110112
- 2022.3.55f1 # FIXME: use >= 2022.3.62f2
111113
steps:
112114
- name: Install UnityEditor
@@ -118,21 +120,11 @@ jobs:
118120
sudo chmod +x /usr/bin/unity-editor
119121
120122
- name: Generate a license activation file
121-
run: |
122-
unity-editor -quit -createManualActivationFile -logFile || true
123-
- name: Request a Unity license file
124123
env:
125-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
126-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
127-
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}
124+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
128125
run: |
129-
npm install -g unity-verify-code
130-
git clone https://github.com/homuler/unity-license-activate.git
131-
cd unity-license-activate
132-
npm install
133-
cd ..
134-
npm install -g ./unity-license-activate
135-
unity-license-activate "$UNITY_EMAIL" "$UNITY_PASSWORD" Unity_v${{ matrix.unityVersion }}.alf --authenticator-key "$UNITY_TOTP_KEY"
126+
echo "$UNITY_LICENSE_BASE64" | base64 -d > Unity_lic.ulf
127+
136128
- name: Activate License
137129
run: |
138130
unity-editor -quit -batchmode -nographics -logFile -manualLicenseFile $(ls Unity_*.ulf) || true

.github/workflows/macos-test.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
type: boolean
99
default: false
1010
secrets:
11+
UNITY_LICENSE_BASE64:
12+
required: true
1113
UNITY_EMAIL:
1214
required: true
1315
UNITY_PASSWORD:
@@ -107,21 +109,10 @@ jobs:
107109
sudo installer -package Unity.pkg -target /
108110
109111
- name: Generate a license activation file
110-
run: |
111-
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -createManualActivationFile -logFile || true
112-
- name: Request a Unity license file
113112
env:
114-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
115-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
116-
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}
113+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
117114
run: |
118-
npm install -g unity-verify-code
119-
git clone https://github.com/homuler/unity-license-activate.git
120-
cd unity-license-activate
121-
npm install
122-
cd ..
123-
npm install -g ./unity-license-activate
124-
unity-license-activate "${UNITY_EMAIL}" "${UNITY_PASSWORD}" Unity_v${{ matrix.unity.version }}.alf --authenticator-key "${UNITY_TOTP_KEY}"
115+
echo "$UNITY_LICENSE_BASE64" | base64 -d > Unity_lic.ulf
125116
- name: Activate License
126117
run: |
127118
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -nographics -logFile -manualLicenseFile $(ls Unity_*.ulf) || true

.github/workflows/run-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
ref: ${{ github.event.pull_request.head.sha }}
2424
is_master: ${{ github.ref_name == 'master' }}
2525
secrets:
26+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
2627
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
2728
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
2829
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}
@@ -34,6 +35,7 @@ jobs:
3435
ref: ${{ github.event.pull_request.head.sha }}
3536
is_master: ${{ github.ref_name == 'master' }}
3637
secrets:
38+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
3739
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
3840
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
3941
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}
@@ -44,6 +46,7 @@ jobs:
4446
with:
4547
ref: ${{ github.event.pull_request.head.sha }}
4648
secrets:
49+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
4750
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
4851
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
4952
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}

.github/workflows/windows-test.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
ref:
66
type: string
77
secrets:
8+
UNITY_LICENSE_BASE64:
9+
required: true
810
UNITY_EMAIL:
911
required: true
1012
UNITY_PASSWORD:
@@ -105,23 +107,10 @@ jobs:
105107
exit 0
106108
107109
- name: Generate a license activation file
108-
run: |
109-
Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${{ matrix.unity.version }}\Editor\Unity.exe" -ArgumentList "-quit -batchmode -createManualActivationFile -logfile"
110-
exit 0
111-
timeout-minutes: 1
112-
- name: Request a Unity license file
113110
env:
114-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
115-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
116-
UNITY_TOTP_KEY: ${{ secrets.UNITY_TOTP_KEY }}
111+
UNITY_LICENSE_BASE64: ${{ secrets.UNITY_LICENSE_BASE64 }}
117112
run: |
118-
npm install -g unity-verify-code
119-
git clone https://github.com/homuler/unity-license-activate.git
120-
cd unity-license-activate
121-
npm install
122-
cd ..
123-
npm install -g ./unity-license-activate
124-
unity-license-activate "$env:UNITY_EMAIL" "$env:UNITY_PASSWORD" Unity_v${{ matrix.unity.version }}.alf --authenticator-key "$env:UNITY_TOTP_KEY"
113+
echo "$UNITY_LICENSE_BASE64" | base64 -d > Unity_lic.ulf
125114
- name: Activate License
126115
run: |
127116
$ulf_file = Get-Item Unity_*.ulf

0 commit comments

Comments
 (0)