Skip to content

Instantly share code, notes, and snippets.

@joegasper
Last active November 13, 2023 01:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joegasper/5fa53706510253ceb3a09be28c5f323d to your computer and use it in GitHub Desktop.
Save joegasper/5fa53706510253ceb3a09be28c5f323d to your computer and use it in GitHub Desktop.
winget - Update Existing Package Manifest

Update Existing Package Manifest for winget

You can find all the winget manifests in GitHub, the Publii manifest, and more details on Microsoft Learn.

You will need to have signed the Contributor License Agreement.

This example will be for TidyCustoms Publii application: https://getpublii.com

  1. Ensure there are no open pull requests for the manifest you are updating. Search on your application name, i.e., "publii".

  2. Install or update wingetcreate application tool for generating and submitting manifests.

     winget install wingetcreate
     winget upgrade wingetcreate
    
  3. Prepare a folder to work in to store manifest output files for testing.

     C:
     md C:\winget
     cd C:\winget	
    
  4. Now you will generate new manifest files. Update the version number and download URL to match latest version as needed.

     wingetcreate.exe update TidyCustoms.Publii -u 'https://getpublii.com/download/Publii-0.41.1.exe|x64' -v 0.41.1 -o .\publii
    

    Note: The architecture has been forced to be x64 for this installation as x64 is a requirement and ensures winget knows it is x64.

    This will output three files in a subfolder of the OUT folder (-o .\publii). These files will eventually be submitted to GitHub.

  5. Check the manifest files for any attributes that need manual updating (i.e., copyright, terms/privacy URLs, description, DisplayName).

  6. Validate the manifest files:

     winget validate --manifest R:\winget\publii\manifests\t\TidyCustoms\Publii\0.41.1\
    
  7. Next, test the installation using the generated manifest files.

    The first time, from an elevated command prompt, you will need to enable installations from local manifest files:

     winget settings --enable LocalManifestFiles
    

    Point to the folder where the manifest files were created and install the software with winget:

     winget install --manifest R:\winget\publii\manifests\t\TidyCustoms\Publii\0.41.1\
    

    After installation, run the application and ensure it is working properly. You are now ready to submit it to GitHub.

  8. Finally, for submission to GitHub, you will need a GitHub personal access token (PAT) - treat this as your password! Note the required and suggested PAT scoped permissions.

    You also need to have forked the winget-pkgs repository to your GitHub account:

    Go to https://github.com/microsoft/winget-pkgs and click Fork.

    If you have an existing fork for winget-pkgs, be sure to synchronize your fork to catch up before continuing.

    Submit the updated manifest:

     wingetcreate.exe submit --token <Your GitHub PAT> R:\winget\publii\manifests\t\TidyCustoms\Publii\0.41.1\
    

    A new pull request will be automatically generated, and you will be launched to the pull request - be sure to check all the boxes on the pull request template (as you should have already completed each step).

    You can expect it to take a couple of days for the pull request to be approved and the new manifest files to be active.


This process could be automated with a GitHub action, see:

Automatically upgrade your package on winget with GitHub actions

GitHub Action: winget package submission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment