Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Action to Update the Windows installer to Winget #500

Merged
merged 7 commits into from
Jan 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/winget-update/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Submit package to Windows Package Manager Community Repository

on:
release:
types: [published]

jobs:

winget:
royshil marked this conversation as resolved.
Show resolved Hide resolved
name: Publish winget package
runs-on: windows-latest
steps:
- name: Submit package to Windows Package Manager Community Repository
run: |
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
$installerUrl = $github.release.assets | Where-Object -Property name -match 'obs-backgroundremoval-*-windows-x64-Installer.exe' | Select -ExpandProperty browser_download_url -First 1
.\wingetcreate.exe update RoyShilkrot.obs-backgroundremoval -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.UPDATETHIS_PAT }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this secrets.UPDATETHIS_PAT needed somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can change it to the same that you want, but it should be a build variable with a PAT token that has "public_repo" permission

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain the PAT token? is this something that Winget expects? i would need to sign up somewhere to get it?

i can add it as a repo secret

Copy link
Contributor Author

@MrHinsh MrHinsh Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a GitHub PAT token. Winget-Create creates a Pull Request on Github for the submission.

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

Yes, you would create a classic PAT and add it as a secret on the repo. Then update the "secret."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@royshil do you have a variable name for your secret that I can use?

Copy link
Collaborator

@royshil royshil Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't have a PAT yet
what sort of permissions does the PAT need though? i'd like to avoid the less secured "classic" PATs
i can create one and add it as a secret

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only needs "public_repo"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MrHinsh marked this conversation as resolved.
Show resolved Hide resolved
Loading