From 98552911b90d7a69a125cd658d211257c909157e Mon Sep 17 00:00:00 2001
From: Vedant <83997633+vedantmgoyal9@users.noreply.github.com>
Date: Mon, 24 Jun 2024 17:57:48 +0530
Subject: [PATCH] =?UTF-8?q?feat:=20use=20komac=20v2=20(2.3.0+),=20repo=20m?=
=?UTF-8?q?aintainence=20=F0=9F=8E=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.all-contributorsrc | 4 +-
.github/CODEOWNERS | 2 +-
.github/FUNDING.yml | 6 +-
.github/ISSUE_TEMPLATE/bug.yml | 2 +-
.github/ISSUE_TEMPLATE/config.yml | 2 +-
.github/ISSUE_TEMPLATE/feat.yml | 2 +-
.github/dependabot.yml | 20 ----
.github/komac-logo.svg | 158 ++++++++++++++++++++++++++++++
.github/pull_request_template.md | 5 +
CODE_OF_CONDUCT.md | 2 +-
CONTRIBUTING.md | 2 +-
README.md | 47 +++++----
action.yml | 41 ++++----
13 files changed, 224 insertions(+), 69 deletions(-)
delete mode 100644 .github/dependabot.yml
create mode 100644 .github/komac-logo.svg
create mode 100644 .github/pull_request_template.md
diff --git a/.all-contributorsrc b/.all-contributorsrc
index a0865e0..b1d4de6 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -7,7 +7,7 @@
"contributorsPerLine": 7,
"contributorsSortAlphabetically": true,
"projectName": "winget-releaser",
- "projectOwner": "vedantmgoyal2009",
+ "projectOwner": "vedantmgoyal9",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true,
@@ -24,7 +24,7 @@
]
},
{
- "login": "vedantmgoyal2009",
+ "login": "vedantmgoyal9",
"name": "Vedant",
"avatar_url": "https://avatars.githubusercontent.com/u/83997633?v=4",
"profile": "https://bittu.eu.org",
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 880307e..af36b56 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @vedantmgoyal2009
+* @vedantmgoyal9
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 480ffb5..f0a3291 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,9 +1,9 @@
# These are supported funding model platforms
-github: vedantmgoyal2009 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
+github: vedantmgoyal9 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: vedantmgoyal # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
+ko_fi: vedantmgoyal # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index 06efd97..a8bf1c9 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -2,7 +2,7 @@ name: 'Bug Report'
description: File a bug report
title: '[Bug]: '
labels: [bug, help wanted]
-assignees: vedantmgoyal2009
+assignees: vedantmgoyal9
body:
- type: markdown
attributes:
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 3df4496..c5a14ed 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Review open issues
- url: https://github.com/vedantmgoyal2009/winget-releaser/issues
+ url: https://github.com/vedantmgoyal9/winget-releaser/issues
about: Please ensure you have gone through open issues.
diff --git a/.github/ISSUE_TEMPLATE/feat.yml b/.github/ISSUE_TEMPLATE/feat.yml
index d765dea..ee7dd71 100644
--- a/.github/ISSUE_TEMPLATE/feat.yml
+++ b/.github/ISSUE_TEMPLATE/feat.yml
@@ -2,7 +2,7 @@ name: 'Feature Request'
description: Request a new feature
title: '[Feature/Idea]: '
labels: [feat]
-assignees: vedantmgoyal2009
+assignees: vedantmgoyal9
body:
- type: markdown
attributes:
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 46ed605..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-# To get started with Dependabot version updates, you'll need to specify which
-# package ecosystems to update and where the package manifests are located.
-# Please see the documentation for all configuration options:
-# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
-
-version: 2
-updates:
- # Maintain dependencies for GitHub Actions
- - package-ecosystem: github-actions
- # Workflow files stored in the
- # default location of `.github/workflows`
- directory: /
- schedule:
- interval: daily
- reviewers:
- - vedantmgoyal2009
- commit-message:
- prefix: chore(deps)
- rebase-strategy: auto
- target-branch: main
diff --git a/.github/komac-logo.svg b/.github/komac-logo.svg
new file mode 100644
index 0000000..21cdd86
--- /dev/null
+++ b/.github/komac-logo.svg
@@ -0,0 +1,158 @@
+
+
+
+
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..bec5417
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,5 @@
+### Pull Request Checklist
+
+- [ ] The commit message(s) follows the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) guidelines.
+
+### Changes & Notes
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 87285ca..f8fc470 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -60,7 +60,7 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
-https://github.com/vedantmgoyal2009/winget-releaser/issues.
+https://github.com/vedantmgoyal9/winget-releaser/issues.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 78f578c..81cc8b4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,7 +6,7 @@ Ensure you've read through the documentation so you understand the core concepts
### How to report a bug
-1. Search the [issues](https://github.com/vedantmgoyal2009/winget-releaser/issues) to see if the bug has already been reported by someone else, and/or if it has been already fixed in the latest version.
+1. Search the [issues](https://github.com/vedantmgoyal9/winget-releaser/issues) to see if the bug has already been reported by someone else, and/or if it has been already fixed in the latest version.
2. If you don't find anything, create a new issue with the following information:
- A clear and concise description of what the bug is.
- Steps to reproduce the bug.
diff --git a/README.md b/README.md
index a7532a6..320d88f 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,11 @@
-
WinGet Releaser (GitHub Action)
+
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]
+[)][playground-link]
Publish new releases of your application to the Windows Package Manager easily.
@@ -21,10 +22,11 @@ expediting the amount of time it takes for a submission to be reviewed.
> 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.
+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/vedantmgoyal9/winget-releaser/issues/172 for information.
-2. Fork the [winget-pkgs][winget-pkgs-repo] repository under the same account/organization as your repository on which
- you want to use this action. Ensure that the fork is up-to-date with the upstream repository. You can use **[ Pull App][pull-app-auto-update-forks]** which keeps your fork up-to-date with the upstream repository via automated pull requests.
+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`).
@@ -55,7 +57,7 @@ jobs:
publish:
runs-on: windows-latest
steps:
- - uses: vedantmgoyal2009/winget-releaser@v2
+ - uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Package.Identifier
max-versions-to-keep: 5 # keep only latest 5 versions
@@ -74,7 +76,7 @@ jobs:
publish:
runs-on: windows-latest
steps:
- - uses: vedantmgoyal2009/winget-releaser@v2
+ - uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Package.Identifier
installers-regex: '\.exe$' # Only .exe files
@@ -94,13 +96,13 @@ jobs:
runs-on: windows-latest
steps:
- name: Publish X to WinGet
- uses: vedantmgoyal2009/winget-releaser@v2
+ uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Package.Identifier
installers-regex: '\.exe$' # Only .exe files
token: ${{ secrets.WINGET_TOKEN }}
- name: Publish Y to WinGet
- uses: vedantmgoyal2009/winget-releaser@v2
+ uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Package.Identifier
installers-regex: '\.msi$' # Only .msi files
@@ -126,7 +128,7 @@ jobs:
$VERSION="${{ github.event.release.name }}" -replace '^.*/ '
"version=$VERSION" >> $env:GITHUB_OUTPUT
shell: pwsh
- - uses: vedantmgoyal2009/winget-releaser@v2
+ - uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Package.Identifier
version: ${{ steps.get-version.outputs.version }}
@@ -155,7 +157,7 @@ jobs:
- **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] repository. If after the current release, the number of versions exceeds this limit, the oldest version will be deleted.
+- `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`
@@ -165,7 +167,7 @@ jobs:
- **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] repository. **The token should have a `public_repo` scope.**
+- `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'`
@@ -178,9 +180,15 @@ jobs:
- **Required**: ❌ (Default value: `${{ github.repository_owner }} # repository owner`)
- **Example**: `fork-user: dotnet-winget-bot # for example purposes only`
+
🚀 Integrating with - 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 👀
-[](https://starchart.cc/vedantmgoyal2009/winget-releaser)
+[](https://starchart.cc/vedantmgoyal9/winget-releaser)
## Contributors ✨
@@ -232,13 +240,16 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
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
+[github-all-contributors-badge]: https://img.shields.io/github/all-contributors/vedantmgoyal9/winget-releaser/main?logo=opensourceinitiative&logoColor=white
+[github-issues-badge]: https://img.shields.io/github/issues/vedantmgoyal9/winget-releaser?logo=target
+[github-release-badge]: https://img.shields.io/github/v/release/vedantmgoyal9/winget-releaser?logo=github
+[github-repo-stars-badge]: https://img.shields.io/github/stars/vedantmgoyal9/winget-releaser?logo=githubsponsors
+[github-license-badge]: https://img.shields.io/github/license/vedantmgoyal9/winget-releaser?logo=gnu
+[pr-screenshot-image]: https://github.com/vedantmgoyal9/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
diff --git a/action.yml b/action.yml
index 4858abe..65dfa23 100644
--- a/action.yml
+++ b/action.yml
@@ -1,6 +1,6 @@
name: WinGet Releaser
description: Publish new releases of your application to Windows Package Manager easily.
-author: vedantmgoyal2009 (Vedant)
+author: vedantmgoyal9 (Vedant)
inputs:
identifier:
required: true
@@ -34,20 +34,7 @@ inputs:
runs:
using: composite
steps:
- - uses: actions/setup-go@v5.0.0
- with:
- check-latest: true
- go-version: 1.x
-
- - name: Install dependencies
- if: runner.os != 'Windows'
- run: |
- if [ "$(uname)" == "Darwin" ]; then
- brew install msitools
- else
- sudo apt-get install -y msitools libmsi-dev
- fi
- shell: bash
+ - uses: cargo-bins/cargo-binstall@main
- name: Validate inputs
run: |
@@ -67,8 +54,7 @@ runs:
}
shell: pwsh
- - name: Install winget-pkgs-automation CLI
- run: go install https://github.com/vedantmgoyal2009/winget-pkgs-automation@latest
+ - run: cargo binstall komac
shell: pwsh
- name: Get release information
@@ -85,8 +71,18 @@ runs:
shell: pwsh
- name: Update & submit manifests
- run: winget-pkgs-automation update '{{ inputs.identifier }}' '{{ steps.version-and-urls.outputs.version }}' --urls '{{ steps.version-and-urls.outputs.urls }}' -s --fork-user '{{ inputs.fork-user }}'
+ run: komac update '{{ inputs.identifier }}' --version '{{ steps.version-and-urls.outputs.version }}' --urls '{{ steps.version-and-urls.outputs.urls }}' --submit
env:
+ KOMAC_FORK_OWNER: ${{ inputs.fork-user }}
+ KOMAC_CREATED_WITH: WinGet Releaser
+ KOMAC_CREATED_WITH_URL: ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_ACTION_REPOSITORY }}
+ GITHUB_TOKEN: ${{ inputs.token }}
+ shell: pwsh
+
+ - name: Clean up stale branches (for which PRs have been merged)
+ run: komac cleanup --only-merged
+ env:
+ KOMAC_FORK_OWNER: ${{ inputs.fork-user }}
GITHUB_TOKEN: ${{ inputs.token }}
shell: pwsh
@@ -94,7 +90,7 @@ runs:
if: ${{ inputs.max-versions-to-keep }} > 0
run: |
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
- $Versions = winget-pkgs-automation list-versions '{{ inputs.identifier }}' --json | ConvertFrom-Json | Sort-Object $ToNatural -Descending
+ $Versions = komac list-versions '{{ inputs.identifier }}' --json | ConvertFrom-Json | Sort-Object $ToNatural -Descending
$Reason = 'This version is older than what has been set in `max-versions-to-keep` by the publisher.'
If ($Versions.Count + 1 -gt {{ inputs.max-versions-to-keep }}) {
@@ -103,11 +99,16 @@ runs:
ForEach ($Version in $VersionsToDelete) {
Write-Output "Deleting version: $Version"
- winget-pkgs-automation remove-version '{{ inputs.identifier }}' $Version --reason $Reason --fork-user '{{ inputs.fork-user }}'
+ komac remove '{{ inputs.identifier }}' --version $Version --reason "$Reason" --submit
}
} Else {
Write-Output "No versions to delete. All good :)"
}
+ env:
+ KOMAC_FORK_OWNER: ${{ inputs.fork-user }}
+ KOMAC_CREATED_WITH: WinGet Releaser
+ KOMAC_CREATED_WITH_URL: ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_ACTION_REPOSITORY }}
+ GITHUB_TOKEN: ${{ inputs.token }}
shell: pwsh
branding:
color: blue