License #13
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
name: License | |
on: | |
schedule: | |
- cron: "0 0 * * 1" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
UNITY_VERSION: 2021.3.22f1 | |
ULF_FILE: Unity_v2021.x.ulf | |
jobs: | |
request_alf: | |
name: Request .alf file π | |
runs-on: ubuntu-latest | |
outputs: | |
alf: ${{ steps.output.outputs.alf }} | |
steps: | |
- name: Request manual activation file | |
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@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: 'UNITY_LICENSE' | |
value: '${{ steps.ulfRead.outputs.content }}' | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} |