GitHub 操作:无法找到输入文件

GitHub Actions: Unable to find the input file

我在这里尝试为我的解决方案恢复 nuget 包。为此,我在下面写了 GitHub 行动:

name: CI

on:
  push:
  pull_request:
      branches:
      - '*'
env:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
jobs:
  ci_build:
    name: Build
    runs-on: windows-latest
    steps:
    - name: NPM Authentication
      uses: actions/checkout@v1
    - name: Use Node.js
      uses: actions/setup-node@v1
    - name: Nuget Command
      uses: actions/checkout@master
    - uses: nuget/setup-nuget@v1
      with:
        nuget-api-key: ${{ secrets.NuGetAPIKey }}
    - run: nuget restore MyProject.sln
    - name: NuGet Tool Installer
      run: NuGetToolInstaller@0
    - name: NuGet Commad
      run: NuGetCommand@2
      env:
        restoreSolution: '$(solution)'
        selectOrConfig: 'config'
        nugetConfigPath: 'Build/NuGet.config'
    - name: VS Build
      run: VSBuild@1
      env:
        solution: '$(solution)'
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'
        msbuildArgs: /p:AuthenticateWithRegistry=false
    - name: VS Test
      run: VSTest@2
      env:
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'
        testSelector: 'testAssemblies'
        testAssemblyVer2: '**\*test*.dll!**\*IntegrationTests.dll!**\*UiTests.dll!**\*TestAdapter.dll!**\obj\**'
    - name: Copy Files to - $(build.artifactstagingdirectory)
      run: CopyFiles@2
      env:
        content: |
            **\bin\Project*.zip
            **\bin\**$(buildConfiguration)\*.msi
        targetFolder: $(build.artifactstagingdirectory)
        flattenFolders: true

下面是我遇到的错误:

Run nuget restore Advanced.OpenLink365.sln

nuget restore MyProject.sln

shell: C:\Program Files\PowerShell\pwsh.EXE -command ". '{0}'"

env:

solution: **/*.sln

buildPlatform: Any CPU

buildConfiguration: Release

NUGET: C:\hostedtoolcache\windows\nuget.exe.4.0\x64/nuget.exe

Input file does not exist: MyProject.sln.

##[error]Process completed with exit code 1.

此外,我发现 "C:\Program Files\Powershell\pwsh.EXE" &C:\hostedtoolcache\windows\nuget.exe.4.0\x64/nuget.exe

没有可用的文件

此外,FYR - 文件夹结构如下:

  • Project Repo
    • .github
      • workflows
      • CI.yml
    • Projects
      • MyProject.sln
      • ...other project files

请让我知道我错过了什么。

谢谢。

将命令更改为:

- run: nuget restore Projects/MyProject.sln