Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/vedantmgoyal9/winget-releaser

Publish new releases of your application to the Windows Package Manager easily.
https://github.com/vedantmgoyal9/winget-releaser

actions github-actions hacktoberfest windows winget

Last synced: 3 months ago
JSON representation

Publish new releases of your application to the Windows Package Manager easily.

Lists

README

        

Logo WinGet Releaser (GitHub Action)

![GitHub contributors (via allcontributors.org)][github-all-contributors-badge]
![GitHub issues][github-issues-badge]
![GitHub release (latest by date)][github-release-badge]
![GitHub Repo stars][github-repo-stars-badge]
![GitHub][github-license-badge]
[![Badge](https://img.shields.io/badge/docs.bittu.eu.org%2Fdocs%2Fwinget--releaser--playground-abcdef?style=flat&logo=windowsterminal&label=Playground%20(dry-run))][playground-link]

Publish new releases of your application to the Windows Package Manager easily.

![pr-example-screenshot][pr-screenshot-image]

Creating manifests and pull requests for every release of your application can be time-consuming and error-prone.

WinGet Releaser allows you to automate this process, with pull requests that are trusted amongst the community, often
expediting the amount of time it takes for a submission to be reviewed.

## Getting Started 🚀

> [!IMPORTANT]
> At least **one** version of your package should already be present in the [Windows Package Manager Community Repository][winget-pkgs-repo].
> The action will use that version as a base to create manifests for new versions of the package.

1. You will need to create a _classic_ Personal Access Token (PAT) with `public_repo` scope. _New_ fine-grained PATs aren't supported by the action. Review https://github.com/vedantmgoyal2009/winget-releaser/issues/172 for information.

2. Fork [microsoft/winget-pkgs][winget-pkgs-repo] under the same account/organization as the project's repository. If you are forking [winget-pkgs][winget-pkgs-repo] on a different account (e.g. bot/personal account), you can use the `fork-user` input to specify the username of the account where the fork is present.

- Ensure that the fork is up-to-date with the upstream. You can use **[ Pull App][pull-app-auto-update-forks]** which keeps your fork up-to-date via automated pull requests.

3. Add the action to your workflow file (e.g. `.github/workflows/.yml`).

> [!IMPORTANT]
> The action will only work when the release is **published** (not a draft), because the release assets (binaries) aren't available publicly until the release is published.

> [!NOTE]
> In case you're pinning the action to a commit hash, you'll need to update the hash frequently to get the latest features & bug fixes. Therefore, it is **highly** recommended to setup dependabot auto-updates for your repository. Check out [keeping your actions up to date with Dependabot][dependabot-setup-guide] for guidance on how to do this. (Yes, it also supports updating actions pinned to a commit hash!)

## Examples 📝

Workflow with the minimal configuration
Workflow with a filter to only publish .exe files
Workflow to publish multiple packages
Workflow with implementation of custom package version

```yaml
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Package.Identifier
max-versions-to-keep: 5 # keep only latest 5 versions
token: ${{ secrets.WINGET_TOKEN }}
```

```yaml
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Package.Identifier
installers-regex: '\.exe$' # Only .exe files
token: ${{ secrets.WINGET_TOKEN }}
```

```yaml
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
steps:
- name: Publish X to WinGet
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Package.Identifier
installers-regex: '\.exe$' # Only .exe files
token: ${{ secrets.WINGET_TOKEN }}
- name: Publish Y to WinGet
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Package.Identifier
installers-regex: '\.msi$' # Only .msi files
token: ${{ secrets.WINGET_TOKEN }}
```

```yaml
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
steps:
- name: Get version
id: get-version
run: |
# Finding the version from release name
$VERSION="${{ github.event.release.name }}" -replace '^.*/ '
"version=$VERSION" >> $env:GITHUB_OUTPUT
shell: pwsh
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Package.Identifier
version: ${{ steps.get-version.outputs.version }}
token: ${{ secrets.WINGET_TOKEN }}
```

## Configuration Options ⚒️

- `identifier`: The package identifier of the package to be updated in the [WinGet Community Repository][winget-pkgs-repo].

- **Required**: ✅
- **Example**: `identifier: Publisher.Package # Microsoft.Excel`

- `version`: The `PackageVersion` of the package you want to release.

- **Required**: ❌ (defaults to tag, excluding `v` prefix: `v1.0.0` -> `1.0.0`)
- **Example**: `version: ${{ github.event.release.tag_name }} # For tags without the 'v' prefix`

- `installers-regex`: A regular expression to match the installers from the release artifacts which are to be published to Windows Package
Manager (WinGet).

- **Required**: ❌ (Default value: `.(exe|msi|msix|appx)(bundle){0,1}$`)
- **Example**: `installers-regex: '\.exe$' # All EXE's`

- `max-versions-to-keep`: The maximum number of versions of the package to keep in the [WinGet Community Repository][winget-pkgs-repo]. If after the current release, the number of versions exceeds this limit, the oldest version will be deleted.

- **Required**: ❌ (Default value: `0` - unlimited)
- **Example**: `max-versions-to-keep: 5 # keep only the latest 5 versions`

- `release-tag`: The GitHub release tag of the release you want to publish to Windows Package Manager (WinGet).

- **Required**: ❌ (Default value: `${{ github.event.release.tag_name || github.ref_name }}`)
- **Example**: `release-tag: ${{ inputs.version }} # workflow_dispatch input 'version'`

- `token`: The GitHub token with which the action will authenticate with GitHub API and create a pull request on the [WinGet Community Repository][winget-pkgs-repo]. **The token should have a `public_repo` scope.**

- **Required**: ✅
- **Example**: `token: ${{ secrets.WINGET_TOKEN }} # Repository secret called 'WINGET_TOKEN'`

> [!WARNING]
> Do **not** directly put the token in the action. Instead, create a repository secret containing the token and use that in the workflow. Refer to [using encrypted secrets in a workflow][gh-encrypted-secrets] for more information.

- `fork-user`: The GitHub username of the user where a fork of [winget-pkgs][winget-pkgs-repo] is present. This
fork will be used to create the pull request.
- **Required**: ❌ (Default value: `${{ github.repository_owner }} # repository owner`)
- **Example**: `fork-user: dotnet-winget-bot # for example purposes only`

🚀 Integrating with Komac logo - Supercharging WinGet Releaser

The action uses [Komac][komac-repo] under the hood to create manifests and publish them to the [Windows Package Manager Community Repository][winget-pkgs-repo] because of its unique capability to update installer URLs with respect to architecture, installer type, scope, etc.

I'm grateful to [Russell Banks][russellbanks-github-profile], the creator of Komac, for creating such an amazing & wonderful winget manifest creator, which is the core of this action. Again, it is because of Komac that the action can now be used on any platform (Windows, Linux, macOS) and not just Windows (as it was before).

## 🌟 Stargazers over time 👀

[![Stargazers over time](https://starchart.cc/vedantmgoyal2009/winget-releaser.svg)](https://starchart.cc/vedantmgoyal2009/winget-releaser)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):




Baptiste Augrain
Baptiste Augrain

💻 🤔 🐛
Christian Brabandt
Christian Brabandt

🐛
CodeDoctor
CodeDoctor

🐛
Doug P
Doug P

🐛
Eric Trenkel
Eric Trenkel

💵 🐛
Fndroid
Fndroid

💵
Frans van Dorsselaer
Frans van Dorsselaer

🤔


Gerardo Grignoli
Gerardo Grignoli

📖
Justin M. Keyes
Justin M. Keyes

🤔
Kei Touge
Kei Touge

🐛
Marc Auberer
Marc Auberer

🐛
Maxim
Maxim

🐛
Michael Lohr
Michael Lohr

📖
Russell Banks
Russell Banks

🤔 📖


Tim Brinkley
Tim Brinkley

🐛 💵
Tom Payne
Tom Payne

🐛
Vedant
Vedant

💻
igoogolx
igoogolx

🐛 💻
ilike2burnthing
ilike2burnthing

🐛
isaak654
isaak654

🐛
repolevedavaj
repolevedavaj

🐛


sitiom
sitiom

📖 🐛 💻

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Contributions of any kind welcome!

[playground-link]: https://docs.bittu.eu.org/docs/winget-releaser-playground
[dependabot-setup-guide]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot#example-dependabotyml-file-for-github-actions
[github-all-contributors-badge]: https://img.shields.io/github/all-contributors/vedantmgoyal2009/winget-releaser/main?logo=opensourceinitiative&logoColor=white
[github-issues-badge]: https://img.shields.io/github/issues/vedantmgoyal2009/winget-releaser?logo=target
[github-release-badge]: https://img.shields.io/github/v/release/vedantmgoyal2009/winget-releaser?logo=github
[github-repo-stars-badge]: https://img.shields.io/github/stars/vedantmgoyal2009/winget-releaser?logo=githubsponsors
[github-license-badge]: https://img.shields.io/github/license/vedantmgoyal2009/winget-releaser?logo=gnu
[pr-screenshot-image]: https://github.com/vedantmgoyal2009/winget-releaser/blob/main/.github/pull-request-by-action-example.png
[winget-pkgs-repo]: https://github.com/microsoft/winget-pkgs
[komac-repo]: https://github.com/russellbanks/komac
[russellbanks-github-profile]: https://github.com/russellbanks
[pull-app-auto-update-forks]: https://github.com/wei/pull
[gh-encrypted-secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow