Files
common/dotnet/dotnet-nugetforunity-restore/action.yaml
2025-07-01 14:44:24 -07:00

39 lines
1.1 KiB
YAML

name: dotnet-nugetforunity-restore
description: "Restore NugetForUnity packages."
inputs:
projectPath:
description: "Path to the Unity project."
required: true
default: "."
restoreMode:
description: "Whether or not to resture NuGetForUnity packages. Options: true, false, auto"
required: true
default: auto
runs:
using: "composite"
steps:
- name: "Determine if NuGet packages need restored."
id: nuget
run: |
NUGET="${{ inputs.restoreMode }}"
if [ "$NUGET" == "auto" ]; then
if [ -f "${{ inputs.projectPath }}/Assets/NuGet.config" ]; then
NUGET=true
else
NUGET=false
fi
fi
echo "restoreMode=$NUGET" >> "$GITHUB_OUTPUT"
shell: bash
- name: "Restore NuGet packages."
if: ${{ steps.nuget.outputs.restoreMode == 'true' }}
uses: act/common/dotnet/dotnet@master
with:
program: nugetforunity
command: restore "${{ inputs.projectPath }}"
# - name: "Own artifacts."
# if: ${{ steps.nuget.outputs.restoreMode == 'true' }}
# uses: act/common/utils/chown@master
# with:
# file: ${{ inputs.projectPath }}/Assets/Packages