- Align
LICENSE, the package license identifier, README badges, and contribution terms with the XHToken community license. Preserve contributor attribution and third-party notices. Verify community, conduct, and security contacts against the community policies. - Set
mainas the default branch. Pull requests targetmain; Check validates pushes and pull requests for that branch. - Configure the
npmenvironment withNPM_TOKEN, a granular token with publication rights to the package scope. Publication checks for this secret before the verification matrix. Validation runs withpublish=falsedo not require publication credentials. - Configure the
live-testsenvironment withXCOSPAN_LIVE_CONFIGusing the schema in Testing. Live models checks for this secret before installing dependencies. - Apply the desired environment approval rules. A publication can require approval for both its credential check and its publishing job.
- Protect
mainagainst force pushes and deletion, and require the Check jobs before merging. Branch protection and environment controls depend on repository permissions and the GitHub plan. - Check the repository's Actions page after changes to branches or workflow settings. Verify the intended triggers and results before publishing a version.
Pull request / main
-> workflow and shell validation
-> commit-history secret scan and dependency audit
-> Linux + macOS + Windows, Node 22 + 24
-> types, formatting, unit tests
-> build and inspect npm tarball
-> native plugin add / check / update / remove against the tarball registry
-> clean npm install -> native host and TUI tests
-> clean Bun install -> exports and native extraction
-> npm publish --dry-run
-> verified tarball + SHA-256 artifact
Version tag on main
-> exact version and source validation
-> the same verification pipeline
-> verify artifact checksum -> publish that tarball with NPM_TOKEN
-> GitHub release with the published tarball and checksum
Build and host versions come from package.json. Actions are pinned to commit SHAs. Runtime package tests install from the tarball in temporary consumer directories. Publish jobs use the verified tarball and checksum produced by the verification job.
Run the Release workflow manually on a branch, leaving publish disabled:
gh workflow run release.yml --ref main -f publish=falseWith publish=false, the workflow runs version checks, platform verification, artifact transfer, checksum verification, and npm publish --dry-run. Registry upload requires publish=true and publication credentials.
For local artifact verification:
bun run check
bun run test:package --output dist/release
bun run test:package --artifact /absolute/path/to/package.tgzDownload the npm-package artifact from a successful workflow to inspect the exact candidate.
The package name and publishConfig in package.json define the destination. Confirm the signed-in account has publish rights to its scope with npm whoami and npm's package or organization settings.
The release workflow reads NPM_TOKEN from GitHub Actions secrets. Configure a granular token with publish access to @iflytekopensource and Bypass 2FA enabled. Store the token in the secret manager, track its expiry, and rotate it before expiration. npm limits write tokens to 90 days. Use a prerelease version and an explicit next or test dist-tag during testing.
npm is retiring direct publication with bypass-2FA tokens in January 2027. To migrate the release workflow to OIDC, configure the package's trusted publisher:
| Field | Value |
|---|---|
| GitHub owner | XHToken |
| Repository | opencode-XCoSpan |
| Workflow filename | release.yml |
| Environment | npm |
| Allowed action | Direct publishing with npm publish |
The GitHub npm environment can require maintainer review. For the OIDC migration, grant the publishing job id-token: write, remove NODE_AUTH_TOKEN, and retain npm 12.2.0 or later. Ensure the package's repository URL matches the publishing repository. Verify an actual publication before retiring the token.
New trusted-publisher configurations must complete their first successful publication within 48 hours. npm generates provenance for public packages from public repositories; private repositories do not produce that provenance. Maintainers manage repository visibility in GitHub settings.
- Update
package.json,bun.lock, andCHANGELOG.mdtogether. Describe user-visible changes and breaking contracts. Documentation and diagrams use relative links and ship in the package; artifact validation checks their targets. Verify README rendering on GitHub and npm after publication. - Merge the reviewed revision into
mainand inspect its CI result. - Push a tag matching the exact version, such as
v0.1.0orv0.2.0-rc.1. The Release workflow rejects version mismatches and commits outsidemain. - Approve the GitHub environment if configured. Stable versions publish to
latest; prereleases publish tonext. - Verify the registry version, dist-tag, and integrity, then run the README's unversioned
opencode plugin add @iflytekopensource/opencode-xcospancommand in a clean OpenCode environment. Confirm existing model accounts,/xcospansetup, update and removal. Run the real-model quick-start journey withXCOSPAN_INSTALL_SPECset to the published package to verify registry installation through delivery.
For a manual publish, select the existing version tag and enable publish. Manual branch runs perform release validation. Publication requires a version tag.
Publishing failures fail the workflow. If npm accepted a version but GitHub release creation failed, rerun only the failed job; do not republish that version. npm versions are immutable.
Use a unique prerelease version with an explicit test dist-tag. Publish the verified tarball, download that exact version from npm, compare its integrity, and run test:package --artifact against the downloaded file.
Remove only the test version with npm unpublish <name>@<test-version>. Verify that the version and its dist-tag are no longer available. Unpublishing the last version may require --force and prevents new publications under that package name for 24 hours; the removed version can never be reused. Plan tests around that registry constraint.
Open Actions for run history, or select a workflow below to inspect its runs and available manual inputs. Manual runs use the selected branch or tag.
| Workflow | Trigger | Purpose |
|---|---|---|
| Check | Push or pull request to main; manual |
Run shared repository and package verification |
| Verify | Called by Check and Release | Define shared security, workflow, and platform checks |
| Dependency audit | Weekly; manual | Check dependency advisories |
| Live models | Manual | Exercise configured providers and native terminal interactions |
| Release | Version tag; manual | Validate or publish a version using the selected inputs |
- Live models: explicit manual run with the
live-testsenvironment'sXCOSPAN_LIVE_CONFIGsecret. Supply the JSON schema in Testing, with credentials resolved in provider settings. The runner deletes configuration and request diagnostics after the run. Paid model tests never run for pull requests. - Dependency audit: every verification run, plus weekly and manually triggered
bun audit. - Dependabot: automatic version-update pull requests are paused for Bun and GitHub Actions (
open-pull-requests-limit: 0). Security-update settings remain unchanged. Maintainers review dependency upgrades alongside the verification checks.