.net core Github操作:dotnet nuget push无法识别所有环境变量
我有一份预定义环境变量的工作:.net core Github操作:dotnet nuget push无法识别所有环境变量,.net-core,nuget,github-actions,.net Core,Nuget,Github Actions,我有一份预定义环境变量的工作: jobs: my-assembly: runs-on: ubuntu-latest env: VERSION: 0.0.1-alpha PROJECT_NAME: MyAssembly.Abstracts PROJECT_PATH: ./src/MyAssembly.Abstracts/MyAssembly.Abstracts.csproj NUGET_OUTPUT_PATH: .src/MyAssembly.Abst
jobs:
my-assembly:
runs-on: ubuntu-latest
env:
VERSION: 0.0.1-alpha
PROJECT_NAME: MyAssembly.Abstracts
PROJECT_PATH: ./src/MyAssembly.Abstracts/MyAssembly.Abstracts.csproj
NUGET_OUTPUT_PATH: .src/MyAssembly.Abstracts/bin/Release
最后一步,我想将成功创建的.nupkg
文件推送到我的包管理器
- name: Nuget Push
run: dotnet nuget push "${NUGET_OUTPUT_PATH}/${PROJECT_NAME}.${VERSION}.nupkg"
但当我在runner上尝试时,我有一个错误:
Run dotnet nuget push "${NUGET_OUTPUT_PATH}/${PROJECT_NAME}.${VERSION}.nupkg"
dotnet nuget push "${NUGET_OUTPUT_PATH}/${PROJECT_NAME}.${VERSION}.nupkg"
shell: /bin/bash -e {0}
env:
VERSION: 0.0.1-alpha
PROJECT_NAME: MyAssembly.Abstracts
PROJECT_PATH: ./src/MyAssembly.Abstracts/MyAssembly.Abstracts.csproj
NUGET_OUTPUT_PATH: .src/MyAssembly.Abstracts/bin/Release
DOTNET_ROOT: /opt/hostedtoolcache/dncs/3.1.401/x64
error: Could not find a part of the path '/home/runner/work/code-service/code-service/.src/MyAssembly.Abstracts/bin/Release'.
看起来runner并没有考虑到环境变量,或者可能是我做错了什么。有什么想法吗?Typo,你应该使用
/src/..
而不是.src/..
来选择NUGET\u OUTPUT\u路径