-
Notifications
You must be signed in to change notification settings - Fork 4
Ci/winget bootstrap #66
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a086212
ci: one-off winget bootstrap (delete after use)
elkaix 8110450
ci: switch to push trigger for bootstrap
elkaix 4b1c8f9
ci: fix wingetcreate new flags (no --submit, add --no-open)
elkaix 95d8377
ci: use wingetcreate submit with generated manifests instead of inter…
elkaix dcc75b1
ci: retrigger bootstrap
elkaix 3902a28
ci: fix YAML parse error in bootstrap (replace here-strings with arra…
elkaix d5c0921
ci: fix PS7 byte[] from Invoke-WebRequest Content
elkaix 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,82 @@ | ||
| name: WinGet bootstrap (one-off, delete after use) | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["ci/winget-bootstrap"] | ||
|
|
||
| jobs: | ||
| bootstrap: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Generate manifests and submit to winget-pkgs | ||
| shell: pwsh | ||
| env: | ||
| WINGET_TOKEN: ${{ secrets.WINGET_SUBMIT_TOKEN }} | ||
| run: | | ||
| $ErrorActionPreference = "Stop" | ||
|
Comment on lines
+14
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add token validation before proceeding. The reference workflow ( Proposed fix run: |
$ErrorActionPreference = "Stop"
+ if (-not $env:WINGET_TOKEN) {
+ throw "WINGET_SUBMIT_TOKEN is not configured"
+ }
$version = "0.30.0"🤖 Prompt for AI Agents |
||
| $version = "0.30.0" | ||
| $pkgId = "PythoughtsLabs.PythinkerCode" | ||
| $installerUrl = "https://github.com/Pythoughts-labs/pythinker-code/releases/download/v$version/PythinkerSetup-$version.exe" | ||
|
|
||
| $wcUrl = "https://github.com/microsoft/winget-create/releases/download/v1.12.8.0/wingetcreate.exe" | ||
| $wcSha = "8BD738851B524885410112678E3771B341C5C716DE60FBBECB88AB0A363ED85D" | ||
| Invoke-WebRequest -Uri $wcUrl -OutFile wingetcreate.exe | ||
| if ((Get-FileHash wingetcreate.exe -Algorithm SHA256).Hash -ne $wcSha) { throw "hash mismatch" } | ||
|
|
||
| $sha256 = [System.Text.Encoding]::UTF8.GetString((Invoke-WebRequest -Uri "$installerUrl.sha256").Content).Trim().Split()[0] | ||
| Write-Host "SHA256: $sha256" | ||
|
|
||
| Invoke-WebRequest -Uri $installerUrl -OutFile installer.exe | ||
| $header = [System.Text.Encoding]::ASCII.GetString([System.IO.File]::ReadAllBytes("installer.exe")[0..65535]) | ||
| $installerType = if ($header -match "Inno Setup") { "inno" } elseif ($header -match "Nullsoft") { "nullsoft" } else { "exe" } | ||
| $silentSwitch = if ($installerType -eq "inno") { "/VERYSILENT /NORESTART" } else { "/S" } | ||
| Write-Host "Installer type: $installerType" | ||
|
|
||
| $dir = "manifests\p\PythoughtsLabs\PythinkerCode\$version" | ||
| New-Item -ItemType Directory -Force -Path $dir | Out-Null | ||
|
|
||
| @("PackageIdentifier: $pkgId", | ||
| "PackageVersion: $version", | ||
| "DefaultLocale: en-US", | ||
| "ManifestType: version", | ||
| "ManifestVersion: 1.6.0") -join "`n" | | ||
| Set-Content -Path "$dir\$pkgId.yaml" -Encoding UTF8 | ||
|
|
||
| @("PackageIdentifier: $pkgId", | ||
| "PackageVersion: $version", | ||
| "Platform:", | ||
| "- Windows.Desktop", | ||
| "MinimumOSVersion: 10.0.17763.0", | ||
| "InstallerType: $installerType", | ||
| "Installers:", | ||
| "- Architecture: x64", | ||
| " InstallerUrl: $installerUrl", | ||
| " InstallerSha256: $sha256", | ||
| " InstallerSwitches:", | ||
| " Silent: $silentSwitch", | ||
| " SilentWithProgress: $silentSwitch", | ||
| "ManifestType: installer", | ||
| "ManifestVersion: 1.6.0") -join "`n" | | ||
| Set-Content -Path "$dir\$pkgId.installer.yaml" -Encoding UTF8 | ||
|
|
||
| @("PackageIdentifier: $pkgId", | ||
| "PackageVersion: $version", | ||
| "PackageLocale: en-US", | ||
| "Publisher: Pythoughts Labs", | ||
| "PublisherUrl: https://pythinker.com", | ||
| "PackageName: Pythinker Code", | ||
| "PackageUrl: https://pythinker.com", | ||
| "License: Apache-2.0", | ||
| "LicenseUrl: https://github.com/Pythoughts-labs/pythinker-code/blob/main/LICENSE", | ||
| "ShortDescription: Terminal-native review-first AI engineering agent", | ||
| "Moniker: pythinker", | ||
| "Tags:", | ||
| "- ai", | ||
| "- agent", | ||
| "- cli", | ||
| "ManifestType: defaultLocale", | ||
| "ManifestVersion: 1.6.0") -join "`n" | | ||
| Set-Content -Path "$dir\$pkgId.locale.en-US.yaml" -Encoding UTF8 | ||
|
|
||
| Write-Host "Generated:"; Get-ChildItem $dir | ||
| .\wingetcreate.exe submit $dir --token $env:WINGET_TOKEN | ||
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.
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.
Restrict workflow permissions to minimum required scope.
The workflow runs with default broad permissions. For security, explicitly set minimal permissions. Since this workflow only downloads external tools and doesn't interact with the repository, consider:
Or if no repository access is needed:
🧰 Tools
🪛 zizmor (1.25.2)
[info] 8-8: workflow or action definition without a name (anonymous-definition): this job
(anonymous-definition)
🤖 Prompt for AI Agents