resources.packages.package 定义

可以使用 NuGet 和 npm GitHub 包作为 YAML 管道中的资源。 指定包资源时,请将包设置为 NuGetnpm

packages:
- package: string # Required as first property. Alias of package artifact.
  type: string # Required. Type of the package. Ex - NuGet, NPM etc.
  connection: string # Required. Name of the connection. This connection will be used for all the communication related to this artifact.
  name: string # Required. Name of the package.
  version: string
  tag: string
  trigger: none | true # Trigger a new pipeline run when a new version of this package is available.

引用此定义的定义:resources.packages

性能

package 字符串。 必需为第一个属性。
包项目的别名。 可接受的值:[-_A-Za-z0-9]*。

type 字符串。 必填。
包的类型。 例如 - NuGet、NPM 等。

connection 字符串。 必填。
连接的名称。 此连接将用于与此项目相关的所有通信。

name 字符串。 必填。
包的名称。

version 字符串。

tag 字符串。

trigger 字符串。
当此包的新版本可用时触发新的管道运行。 none |真。

例子

在此示例中,GitHub 服务连接 名为 pat-contoso 名为 contoso的 GitHub npm 包。 详细了解 GitHub 包

resources:
  packages:
    - package: contoso
      type: npm
      connection: pat-contoso
      name: yourname/contoso 
      version: 7.130.88 
      trigger: true

pool:
  vmImage: ubuntu-latest

steps:
- getPackage: contoso 

另请参阅