gpt4 book ai didi

azure - 管道: cannot publish a file from artifacts directory

转载 作者:行者123 更新时间:2023-12-03 05:39:25 27 4
gpt4 key购买 nike

我有这个管道文件,我在其中从 Electron 应用程序创建了一个 exe 文件。最后,我将发布一个包含结果文件的 Github 版本(至少这是我正在尝试的)。问题是在进行发布时找不到exe文件。

-   job: Release
dependsOn:
- WindowsBuild
pool:
vmImage: 'ubuntu-latest'
steps:
- bash:
echo "##vso[task.setvariable variable=GIT_TAG]$(git describe --tags --always)"
displayName: "Set the tag name"

- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Windows'
path: $(Build.ArtifactStagingDirectory)

- bash:
ls -la '$(Build.ArtifactStagingDirectory)'
displayName: "List artifacts dir"

- task: GitHubRelease@1
displayName: "Github release"
inputs:
gitHubConnection: 'github connection'
repositoryName: '$(Build.Repository.Name)'
assets: |
'$(Build.ArtifactStagingDirectory)/app.exe'
action: 'edit'
target: '$(Build.SourceVersion)'
tagSource: gitTag
tag: '$(GIT_TAG)'
addChangeLog: true
assetUploadMode: replace
changeLogCompareToRelease: lastNonDraftRelease
title: 'Release $(GIT_TAG)'

如您所见,我执行的任务之一是 ls -la '$(Build.ArtifactStagingDirectory)',这样我就可以查看 ArtifactStagingDirectory 中的内容:

Starting: List artifacts dir
==============================================================================
Task : Bash
Description : Run a Bash script on macOS, Linux, or Windows
Version : 3.159.3
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/bash
==============================================================================
Generating script.
Script contents:
ls -la '/home/vsts/work/1/a'
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/4a24644d-728f-4a2a-a7d9-12a5de01f75d.sh
total 70480
drwxr-xr-x 2 vsts docker 4096 Jan 25 17:15 .
drwxr-xr-x 6 vsts docker 4096 Jan 25 17:14 ..
-rw-r--r-- 1 vsts docker 72161249 Jan 25 17:15 app.exe

Finishing: List artifacts dir

app.exe 文件存在。下一个任务是 GitHubRelease,它的指定 Assets 为 '$(Build.ArtifactStagingDirectory)/app.exe',但未找到:

Starting: Github release
==============================================================================
Task : GitHub Release
Description : Create, edit, or delete a GitHub release
Version : 1.160.2
Author : Microsoft Corporation
Help : https://aka.ms/AA5vv5o
==============================================================================
b1a3412a-0bb2-48a8-8dfc-bc2109012f38 exists true
Computing changes made in this release...
Fetching the latest non-draft release...
Found the latest non-draft release
Fetching the list of commits since the last published release...
Found the list of changes.
Changes computed successfully.
Release notes file: /home/vsts/work/1/s is a directory and not a file.
Fetching the release for tag: v0.0.28
##[warning]No existing release was found to edit. Creating one with the tag: v0.0.28
Creating a release for tag: v0.0.28
Uploading assets...
Searching for file(s) matching ''/home/vsts/work/1/a/app.exe''.
No files found matching ''/home/vsts/work/1/a/app.exe''. Nothing to upload.
All assets uploaded successfully.
Release created successfully at https://github.com/app/desktop/releases/tag/v0.0.28
Finishing: Github release

关于我在这里做错了什么有什么想法吗>?

最佳答案

尝试删除 YAML 中这一行的单引号

assets: |
'$(Build.ArtifactStagingDirectory)/app.exe'

看起来它是用重复的单引号解释的。

Uploading assets...
Searching for file(s) matching ''/home/vsts/work/1/a/app.exe''

当您使用 | 时,我在其他 Azure DevOps 任务中看到了这一点。对于多行格式。

关于azure - 管道: cannot publish a file from artifacts directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59911644/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com