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 headless' required: true default: 'False' jobs: test-auth: runs-on: ubuntu-latest 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: Return Secret as file # run: | # sudo echo "$UNITY_LICENSE" > /tmp/Unity_v2022.x.ulf # shell: bash # env: # UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} #- name: get a token # run: | # curl -L \ # -H "Accept: application/vnd.github+json" \ # -H "Authorization: Bearer " \ # -H "X-GitHub-Api-Version: 2022-11-28" \ # https://api.github.com/orgs/ORG/actions/secrets/public-key #- name: encrypt secret #- name: Create new repository secret # run: | # curl -X PUT \ # -H "Accept: application/vnd.github.v3+json" \ # -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ # https://api.github.com/repos/$OWNER/$REPO/actions/secrets/$SECRET_NAME \ # -d '{"encrypted_value":"","key_id":""}' # env: # OWNER: "buildstar-online" # REPO: "unity-self-auth" # SECRET_NAME: "TEST_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}}