diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index adb2676..7bd7fb5 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -41,3 +41,5 @@ Things that span files: Push a `v*` tag matching the `[workspace.package]` version in the root `Cargo.toml`; `release-github.yml` builds five targets (macOS arm64/x64, Linux arm64/x64, Windows x64) and attaches archives plus `checksums.txt`. `release-npm.yml` ("Code Release npm") runs on the same tag and publishes `@ondeinference/onde-code` (a Node launcher in `packaging/npm/onde-code`) plus five platform packages, `@ondeinference/onde-code-{darwin-arm64,darwin-x64,linux-x64,linux-arm64,windows-x64}`. Auth is npm Trusted Publishing; npm authenticates with OIDC, not a token. Trusted Publishers are configured per package (all six point at `release-npm.yml`), so a new package needs one before its first CI publish; run `packaging/npm/scripts/setup-trusted-publishing.sh` to create and attach them. Verify with `npm view @ondeinference/onde-code version`. + +**winget:** `release-winget.yml` files the Package Request issue with `WINGET_ISSUE_TOKEN` (`public_repo`), then opens the manifest PR with `WINGET_PR_TOKEN`, a classic PAT with `public_repo`, `read:org`, `read:discussion`, and `workflow`. The first three cover forking and the `gh pr edit` GraphQL query. `workflow` is there because wingetcreate fast-forwards the token owner's fork before it branches, and GitHub refuses that sync once an upstream commit changes a file under `.github/workflows`. "The forked repository could not be synced with the upstream commits" can mean the PAT lacks `workflow`, or that the fork has simply drifted too far behind upstream; add the scope, or sync the fork by hand and rerun. diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml index bd7887f..4bd6bab 100644 --- a/.github/workflows/release-winget.yml +++ b/.github/workflows/release-winget.yml @@ -98,6 +98,10 @@ jobs: # calls `gh pr edit`, whose GraphQL query resolves # org/team and discussion fields and fails with a # scope error without them. + # WINGET_PR_TOKEN also needs workflow: wingetcreate fast-forwards the token + # owner's fork before it branches, and GitHub refuses that sync when an + # upstream commit changed a file under .github/workflows (seen on sigit + # v1.7.10). - name: File the winget Package Request issue id: issue shell: bash @@ -206,7 +210,7 @@ jobs: WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_PR_TOKEN }} run: | if (-not $env:WINGET_CREATE_GITHUB_TOKEN) { - Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, and read:discussion scopes so wingetcreate can fork microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." + Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, read:discussion, and workflow scopes so wingetcreate can sync its fork of microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." } $version = "${{ steps.release.outputs.version }}" @@ -240,7 +244,7 @@ jobs: WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_PR_TOKEN }} run: | if (-not $env:WINGET_CREATE_GITHUB_TOKEN) { - Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, and read:discussion scopes so wingetcreate can fork microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." + Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, read:discussion, and workflow scopes so wingetcreate can sync its fork of microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." } $tag = "${{ steps.release.outputs.tag }}"