-
Notifications
You must be signed in to change notification settings - Fork 97
Move publish step to GitHub Action & use env var instead of --token #594
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
Open
mdanish-kh
wants to merge
5
commits into
microsoft:main
Choose a base branch
from
mdanish-kh:ci-env-var-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
51eead7
Move publish step to GitHub Action & use env var instead of --token
mdanish-kh f51976a
Update README.md with new guidance and markdownlint fixes
mdanish-kh c99ba81
note for bot accounts
mdanish-kh afa48e6
Merge branch 'main' into ci-env-var-action
mdanish-kh 2df8e74
use curl and update readme
mdanish-kh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Submit release to the WinGet community repository | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| publish-winget: | ||
| name: Submit to WinGet repository | ||
|
|
||
| # winget-create is only supported on Windows | ||
| runs-on: windows-latest | ||
|
|
||
| # Only submit stable releases | ||
| if: ${{ !github.event.release.prerelease }} | ||
|
|
||
| # winget-create will read the following environment variable to access the GitHub token needed for submitting a PR | ||
| # See https://aka.ms/winget-create-token | ||
| env: | ||
| WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_CREATE_GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - name: Submit package using wingetcreate | ||
| run: | | ||
| # Get installer info from release event | ||
| $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json | ||
| $msixPackageUrl = $assets | Where-Object -Property name -like '*.msixbundle' | Select-Object -ExpandProperty browser_download_url | ||
| $portablePackageUrl = $assets | Where-Object -Property name -eq 'wingetcreate.exe' | Select-Object -ExpandProperty browser_download_url | ||
| $packageVersion = (${{ toJSON(github.event.release.tag_name) }}).Trim('v') | ||
|
|
||
| # Update package using wingetcreate | ||
| curl.exe -JLO https://aka.ms/wingetcreate/latest | ||
| .\wingetcreate.exe update Microsoft.WingetCreate ` | ||
| --version $packageVersion ` | ||
| --urls $msixPackageUrl "$portablePackageUrl|x64" "$portablePackageUrl|x86" ` | ||
| --submit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where I can get the correct URL for this as it's currently broken. I looked at winget-cli's link and tried to copy it but for winget-create it looks like:
Doesn't say succeeded or failure like how the winget-cli one does