手动创建新的程序包

官方文档:https://learn.microsoft.com/zh-cn/windows/package-manager/package

采用 WinGetCreate 实用工具的方式最为简单。

winget install wingetcreate

wingetcreate new

在提交程序清单的PR中这些内容需要完成。

Checklist for Pull Requests

Manifests

  •  Have you checked that there aren't other open pull requests for the same manifest update/change?
  •  This PR only modifies one (1) manifest
  •  Have you validated your manifest locally with winget validate --manifest <path>?
  •  Have you tested your manifest locally with winget install --manifest <path>?
  •  Does your manifest conform to the 1.9 schema?

Note: <path> is the directory's name containing the manifest you're submitting.

第一次往仓库提交PR需要同意一个协议,在对话中找到 Contributor License Agreement(CLA) 并回复即可。

# 验证清单
winget validate --manifest %USERPROFILE%\manifests\r\RubyMetric\chsrc\0.1.9
# 下载安装
# 管理员权限开启下面的功能
winget settings --enable LocalManifestFiles
winget install --manifest %USERPROFILE%\manifests\r\RubyMetric\chsrc\0.1.9

https://learn.microsoft.com/zh-cn/windows/package-manager/winget/troubleshooting

windows程序的终端发放类型:https://learn.microsoft.com/zh-cn/windows/terminal/distributions

winget的输出日志位置,查看了一下好像是安装包的类型导致了安装失败。

%LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

使用git action 自动更新程序包

使用的action:https://github.com/marketplace/actions/winget-releaser#:~:text=token%3A%20The%20GitHub%20token%20with%20which%20the%20action%20will%20authenticate%20with%20GitHub%20API%20and%20create%20a%20pull%20request%20on%20the%20WinGet%20Community%20Repository.%20The%20token%20should%20have%20a%20public_repo%20scope.需要创建一个token并授予 public repo权限。

在git action 中使用 secret:https://docs.github.com/zh/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

目录