Skip to content
New issue

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

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

Already on GitHub? # to your account

Create Github Action to release winget package #142

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

jo-chemla
Copy link

Following issue #141 Uses winget-releaser I suggest you ( @Victor-IX) create a Classic Github Token with public_repo scope is created, following this link, then the Token can be added to the Blender-Launcher-V2 repo as a secret named WINGET_ACC_TOKEN. See below, that user also will have to fork the winget-pkgs repository.

Notes:

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 #172 for information.
Fork microsoft/winget-pkgs under the same account/organization as the project's repository. If you are forking winget-pkgs 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.

Following issue Victor-IX#141 Uses [winget-releaser](https://github.com/vedantmgoyal9/winget-releaser) I suggest you ( @Victor-IX) create a `Classic Github Token` with `public_repo` scope is created, following [this link](https://github.com/settings/tokens/new), then the Token can be added to the Blender-Launcher-V2 repo as a secret named `WINGET_ACC_TOKEN`. See below, that user also will have to fork the winget-pkgs repository.

Notes:
> 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 Victor-IX#172 for information.
> Fork [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs) under the same account/organization as the project's repository. If you are forking winget-pkgs 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.
@Victor-IX
Copy link
Owner

I'm not very familiar with the GitHub token system, so to recap what I did:

I'm not sure how I'm supposed to call the secret key from the repo, or where WINGET_ACC_TOKEN is supposed to go.

Also, I have a security question:
If someone forked the repo and does the same setup, can they override the version present in winget-pkgs with theirs?

@jo-chemla
Copy link
Author

Thanks for taking these steps, forking the winget-pkgs repo and creating a new classic Private access token.
This token can be put as a repository secret by creating a new repo secret with name WINGET_ACC_TOKEN and value the token.

That token is private to you. I did fork the repo but won't (or anyone else) have access to it. From what I understand, I can however create the same action with my classic token, and the release on both repos would trigger a PR to winget-pkgs, probably the last one merged would be the one retained. Not sure how microsoft team dealt with such cases if it did ever happen.

@Victor-IX
Copy link
Owner

Everything is set up! I think you should only run this GitHub action only for stable release and not the pre-release one

@jo-chemla
Copy link
Author

Thanks for these info! If everything is set-up correctly, every new github release of Blender-Launcher-v2 should therefore automatically create a PR to winget-pkgs - or you can fire a winget-release by executing the action manually and specifying a version tag number (I cannot, only the repo owner and contributor should be able to execute these github actions). At least this is what is happening to triplex for which I did the same PR, see here

@Victor-IX Victor-IX merged commit 5760f79 into Victor-IX:main Sep 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants