Skip to content

Commit

Permalink
Update Docs for Schema 1.6 (microsoft#137976)
Browse files Browse the repository at this point in the history
* Add Schema Documentation for 1.6

* Update references to be Schema 1.6

* Bump YamlCreate

* Spelling

* Fix URL detection since redirects were changed
  • Loading branch information
Trenly authored Feb 6, 2024
1 parent 9f49a6b commit bec1439
Show file tree
Hide file tree
Showing 10 changed files with 2,692 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [ ] This PR only modifies one (1) manifest
- [ ] Have you [validated](https://github.com/microsoft/winget-pkgs/blob/master/AUTHORING_MANIFESTS.md#validation) 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.5 schema](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.5.0)?
- [ ] Does your manifest conform to the [1.6 schema](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.6.0)?

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

Expand Down
2 changes: 1 addition & 1 deletion .github/policies/labelAdded.manifestVersionError.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ configuration:
Hello @${issueAuthor},
The package manager bot determined that the ManifestVersion key does not match any version currently approved for release. Please verify the manifest file is compliant with the package manager [1.3 manifest specification](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.3.0), [1.4 manifest specification](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.4.0), or [1.5 manifest specification](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.5.0).
The package manager bot determined that the ManifestVersion key does not match any version currently approved for release. Please verify the manifest file is compliant with the package manager [1.5 manifest specification](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.5.0) or [1.6 manifest specification](https://github.com/microsoft/winget-pkgs/tree/master/doc/manifest/schema/1.6.0).
For details on the specific error, see the details link below in the build pipeline.
Expand Down
8 changes: 4 additions & 4 deletions AUTHORING_MANIFESTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Manifest Specification]: doc/manifest/schema/1.5.0
[versionSchema]: doc/manifest/schema/1.5.0/version.md
[defaultLocaleSchema]: doc/manifest/schema/1.5.0/defaultLocale.md
[installerSchema]: doc/manifest/schema/1.5.0/installer.md
[Manifest Specification]: doc/manifest/schema/1.6.0
[versionSchema]: doc/manifest/schema/1.6.0/version.md
[defaultLocaleSchema]: doc/manifest/schema/1.6.0/defaultLocale.md
[installerSchema]: doc/manifest/schema/1.6.0/installer.md

# Authoring Manifests

Expand Down
6 changes: 3 additions & 3 deletions Tools/YamlCreate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ if ($Settings) {
exit
}

$ScriptHeader = '# Created with YamlCreate.ps1 v2.3.2'
$ManifestVersion = '1.5.0'
$ScriptHeader = '# Created with YamlCreate.ps1 v2.3.3'
$ManifestVersion = '1.6.0'
$PSDefaultParameterValues = @{ '*:Encoding' = 'UTF8' }
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$ofs = ', '
Expand All @@ -189,7 +189,7 @@ if ($ScriptSettings.EnableDeveloperOptions -eq $true -and $null -ne $ScriptSetti
$useDirectSchemaLink = if ($env:GITHUB_ACTIONS -eq $true) {
$true
} else {
(Invoke-WebRequest "https://aka.ms/winget-manifest.version.$ManifestVersion.schema.json" -UseBasicParsing).BaseResponse.ContentLength -eq -1
(Invoke-WebRequest "https://aka.ms/winget-manifest.version.$ManifestVersion.schema.json" -UseBasicParsing).BaseResponse.ResponseUri.IdnHost -match 'bing'
}
$SchemaUrls = @{
version = if ($useDirectSchemaLink) { "https://raw.githubusercontent.com/microsoft/winget-cli/master/schemas/JSON/manifests/v$ManifestVersion/manifest.version.$ManifestVersion.json" } else { "https://aka.ms/winget-manifest.version.$ManifestVersion.schema.json" }
Expand Down
57 changes: 57 additions & 0 deletions doc/manifest/schema/1.6.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[schemaFolder]: https://github.com/microsoft/winget-cli/tree/master/schemas/JSON/manifests/v1.6.0
[versionSchema]: https://github.com/microsoft/winget-cli/tree/master/schemas/JSON/manifests/v1.6.0/manifest.version.1.6.0.json
[defaultLocaleSchema]: https://github.com/microsoft/winget-cli/tree/master/schemas/JSON/manifests/v1.6.0/manifest.defaultLocale.1.6.0.json
[localeSchema]: https://github.com/microsoft/winget-cli/tree/master/schemas/JSON/manifests/v1.6.0/manifest.locale.1.6.0.json
[installerSchema]: https://github.com/microsoft/winget-cli/tree/master/schemas/JSON/manifests/v1.6.0/manifest.installer.1.6.0.json
[Windows Package Manager Manifest Creator]: https://github.com/microsoft/winget-create
[YAML Create]: https://github.com/microsoft/winget-pkgs/blob/master/Tools/YamlCreate.ps1

# Windows Package Manager

## Manifest Schema 1.6

The Windows Package Manager 1.6 client does not support all fields in the 1.6 schema.

The Windows Package Manager uses manifests (YAML files) to locate and install packages for Windows users. This specification provides references to JSON schemas as well as best practices.

Manifests submitted to the Windows Package Manager Community Repository should be submitted as a multi-file manifest. Only one version of a package may be submitted per pull request. The [singleton](singleton.md) manifest format is supported by the client, but has been deprecated in the community repository. Rich tooling exists to generate manifests. The [Windows Package Manager Manifest Creator] and [YAML Create] were both designed to produce well formed and rich manifests.

A multi-file manifest contains:
* One [version](version.md) ([JSON Schema][versionSchema]) file
* One [default locale](defaultLocale.md) ([JSON Schema][defaultLocaleSchema]) file
* One [installer](installer.md) ([JSON Schema][installerSchema]) file
* Additional optional [locale](locale.md) ([JSON Schema][localeSchema]) files

## YAML file name and folder structure
YAML files shall be added to the repository with the following folder structure:
manifests / p / publisher / package / packageVersion / publisher.package.&lt;manifestFile&gt;.yaml

Example:
`manifests/m/Microsoft/WindowsTerminal/1.9.1942/Microsoft.WindowsTerminal.installer.yaml`

* Manifests are partitioned by the first letter of the publisher name (in lower case). For example: m.
* Publisher folder is the name of the company that publishes the tool. For example: Microsoft.
* The child folder package is the name of the application or tool. For example: WindowsTerminal.
* The child folder package version is the version of the package. For example: 1.6.10571.0.
* The filename must be a combination of the publisher name and the application name. For example: Microsoft.WindowsTerminal.yaml.

The publisher and application folders MUST match the values used to define the Id. See PackageIdentifier: in the YAML for more detail.
The version in the folder name MUST match the version field value in the YAML file. See PackageVersion: in the YAML for more detail.

There are two primary types of manifests. A single file manifest (singleton) and a multi-file manifest.
[JSON schemas][schemaFolder] have been provided
to help strongly type attributes and requirements.

## YAML Syntax
Each field in the file must be PascalCased and cannot be duplicated.

## Best Practices
The package identifier must be unique. You cannot have multiple submissions with the same package identifier. Only one pull request per package version is allowed.

Avoid creating multiple publisher folders. For example, do not create "Contoso Ltd." if there is already a "Contoso" folder.

All tools must support a silent install to be permitted in the Windows Package Manager Community Repository. If you have an executable that does not support a silent install, then we cannot provide that tool at this time.

Provide as many fields as possible. The more meta-data you provide the better the user experience will be. In some cases, the fields may not yet be supported by the Windows Package Manager client (winget.exe).

The length of strings in this specification should be limited to 100 characters before a line break.
Loading

0 comments on commit bec1439

Please sign in to comment.