-
Notifications
You must be signed in to change notification settings - Fork 0
feat(release): bootstrap first-time winget submissions #28
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Winget submit | ||
|
monit-reviewer marked this conversation as resolved.
|
||
| description: Submit an existing winget package update or bootstrap a first-time package submission on a Windows runner. | ||
| inputs: | ||
| package-id: | ||
| description: "Winget PackageIdentifier, for example OpenCLICollective.codereview-cli" | ||
| required: true | ||
| version: | ||
| description: "PackageVersion to publish" | ||
| required: true | ||
| final-tag: | ||
| description: "GitHub release tag containing the published assets" | ||
| required: true | ||
| repo: | ||
| description: "GitHub repository containing the release assets, owner/name" | ||
| required: true | ||
| working-directory: | ||
| description: "Tool root containing packaging/winget templates" | ||
| required: false | ||
| default: "." | ||
| bootstrap: | ||
| description: "Allow first-time package submission if the winget package does not exist" | ||
| required: false | ||
| default: "false" | ||
| github-token: | ||
| description: "GitHub token for release asset download and winget-pkgs existence lookup" | ||
| required: true | ||
| winget-token: | ||
| description: "GitHub token used by wingetcreate to submit to microsoft/winget-pkgs" | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Assert Windows runner | ||
| shell: bash | ||
| env: | ||
| RUNNER_OS_NAME: ${{ runner.os }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [ "$RUNNER_OS_NAME" != "Windows" ]; then | ||
| echo "::error::winget-submit requires a Windows runner because wingetcreate.exe is Windows-only" | ||
| exit 1 | ||
| fi | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - shell: bash | ||
| run: pip install "PyYAML==6.0.2" | ||
| - shell: bash | ||
| env: | ||
| ACTION_PATH: ${{ github.action_path }} | ||
| PACKAGE_ID: ${{ inputs.package-id }} | ||
| VERSION: ${{ inputs.version }} | ||
| FINAL_TAG: ${{ inputs.final-tag }} | ||
| REPO: ${{ inputs.repo }} | ||
| WORKING_DIRECTORY: ${{ inputs.working-directory }} | ||
| BOOTSTRAP: ${{ inputs.bootstrap }} | ||
| WINGET_GITHUB_TOKEN: ${{ inputs.github-token }} | ||
| WINGET_TOKEN: ${{ inputs.winget-token }} | ||
| run: | | ||
| set -euo pipefail | ||
| python "$ACTION_PATH/winget_submit.py" submit \ | ||
|
monit-reviewer marked this conversation as resolved.
|
||
| --package-id "$PACKAGE_ID" \ | ||
| --version "$VERSION" \ | ||
| --final-tag "$FINAL_TAG" \ | ||
| --repo "$REPO" \ | ||
| --working-dir "$WORKING_DIRECTORY" \ | ||
| --bootstrap "$BOOTSTRAP" \ | ||
| --github-token "$WINGET_GITHUB_TOKEN" \ | ||
| --winget-token "$WINGET_TOKEN" | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.