-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,77 @@ | ||
name: Acquire activation file | ||
name: Activate License | ||
|
||
on: | ||
workflow_dispatch: { } | ||
schedule: | ||
- cron: "0 0 * * 1" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
UNITY_VERSION: 2022.3.10f1 | ||
ULF_FILE: Unity_v2022.x.ulf | ||
|
||
jobs: | ||
activation: | ||
name: Request manual activation file 🔑 | ||
request_alf: | ||
name: Request .alf file 🔑 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
alf: ${{ steps.output.outputs.alf }} | ||
steps: | ||
|
||
# Request manual activation file | ||
- name: Request manual activation file | ||
id: getManualLicenseFile | ||
uses: game-ci/unity-request-activation-file@v2 | ||
id: alfFile | ||
uses: game-ci/unity-request-activation-file@main | ||
with: | ||
unityVersion: ${{ env.UNITY_VERSION }} | ||
|
||
# Upload artifact (Unity_v20XX.X.XXXX.alf) | ||
- name: Expose as artifact | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ steps.alfFile.outputs.filePath }} | ||
path: ${{ steps.alfFile.outputs.filePath }} | ||
|
||
- name: Output | ||
id: output | ||
run: | | ||
echo "::set-output name=alf::${{ steps.alfFile.outputs.filePath }}" | ||
acquire_ulf: | ||
needs: [ request_alf ] | ||
name: Acquire .ulf file 🔑 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download .alf artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ needs.request_alf.outputs.alf }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install node package, `unity-license-activate` | ||
run: npm install --global unity-license-activate | ||
|
||
- name: Install node package, `unity-verify-code` | ||
run: npm install --global unity-verify-code | ||
|
||
- name: Activate the license | ||
continue-on-error: true | ||
run: unity-license-activate "${{ secrets.UNITY_EMAIL }}" "${{ secrets.UNITY_PASSWORD }}" "${{ needs.request_alf.outputs.alf }}" | ||
|
||
- name: Read ulf | ||
id: ulfRead | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ${{ env.ULF_FILE }} | ||
|
||
- name: Update secret UNITY_LICENSE | ||
uses: hmanzur/[email protected] | ||
with: | ||
name: ${{ steps.getManualLicenseFile.outputs.filePath }} | ||
path: ${{ steps.getManualLicenseFile.outputs.filePath }} | ||
name: 'UNITY_LICENSE' | ||
value: '${{ steps.ulfRead.outputs.content }}' | ||
token: ${{ secrets.PAT }} |