Github actions/upload-artifact@v2 与 windows-latest 中断
我有一个 C# (.net 6) 项目的以下 GitHub 操作工作流程,可以与 ubuntu-latest 配合良好。但由于某种原因,我们需要它使用 windows-latest
,并且它会因错误而中断(YAML 工作流程后面跟着错误消息)。
Yaml 工作流程:
jobs:
build:
name: Create Release
runs-on: windows-latest
steps:
- name: Setup Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore .NET dependencies
run: dotnet restore
- name: Build .NET
run: dotnet build --no-restore
- name: Test .NET
run: dotnet test --no-build --verbosity normal
- name: Publish .NET
run: |
dotnet publish /p:PublishProfile=Release-win-x86 -c Release
dotnet publish /p:PublishProfile=Release-win-x64 -c Release
- name: Upload Published Artifact
uses: actions/upload-artifact@v2
with:
name: softwarename
path: |
/home/runner/work/solution/project/Software/win-x86/
/home/runner/work/solution/project/Software/win-x64/
错误:
Upload Published Artifact
Run actions/upload-artifact@v2
Warning: No files were found with the provided path:
/home/runner/work/solution/project/Software/win-x86/
/home/runner/work/solution/project/Software/win-x64/. No artifacts will be uploaded.
Download Published Artifact
Run actions/download-artifact@v2
Starting download for softwarename
Error: Unable to find any artifacts for the associated workflow
我读了 这里我需要将 actions/upload-artifact@v2 更改为 actions/[电子邮件受保护],我尝试但失败并出现相同的错误。
知道如何解决这个问题吗?
I have the following GitHub actions workflow for a C# (.net 6) project that works fine with ubuntu-latest
. But for some reason we need it to use windows-latest
, and it breaks with the error (the error message followed after YAML workflow).
Yaml workflow:
jobs:
build:
name: Create Release
runs-on: windows-latest
steps:
- name: Setup Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore .NET dependencies
run: dotnet restore
- name: Build .NET
run: dotnet build --no-restore
- name: Test .NET
run: dotnet test --no-build --verbosity normal
- name: Publish .NET
run: |
dotnet publish /p:PublishProfile=Release-win-x86 -c Release
dotnet publish /p:PublishProfile=Release-win-x64 -c Release
- name: Upload Published Artifact
uses: actions/upload-artifact@v2
with:
name: softwarename
path: |
/home/runner/work/solution/project/Software/win-x86/
/home/runner/work/solution/project/Software/win-x64/
The error:
Upload Published Artifact
Run actions/upload-artifact@v2
Warning: No files were found with the provided path:
/home/runner/work/solution/project/Software/win-x86/
/home/runner/work/solution/project/Software/win-x64/. No artifacts will be uploaded.
Download Published Artifact
Run actions/download-artifact@v2
Starting download for softwarename
Error: Unable to find any artifacts for the associated workflow
I read here that I need to change actions/upload-artifact@v2 to actions/[email protected], and I tried and failed with the same error.
Any Idea how to fix this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我感谢@jessehouwing 让我意识到了这个概念。
关于这个线程,我的解决方案需要
${{ github.workspace }}
,这样我的更改如下所示:I give credit to @jessehouwing for making me aware of the concept.
Regarding this thread, my solution needed
${{ github.workspace }}
, so that my changes looks like this:不要依赖:
而是使用
这种方式,它指向独立于操作系统和配置的运行程序的正确路径
Don't rely on:
Instead use
That way it points to the correct path for the runner independent of the operating system and configuration