Skip to content

ci: sign OpenUPM package via Unity UPM CLI on release#776

Merged
IvanMurzak merged 3 commits into
mainfrom
worktree-414-sign-openupm-package
May 23, 2026
Merged

ci: sign OpenUPM package via Unity UPM CLI on release#776
IvanMurzak merged 3 commits into
mainfrom
worktree-414-sign-openupm-package

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

Summary

  • Adds a sign-and-publish-upm job to .github/workflows/release.yml that signs com.ivanmurzak.unity.mcp with Unity's UPM CLI on every release and attaches the signed .tgz (containing package/.attestation.p7m) to the GitHub Release.
  • The job is continue-on-error: true and exits early with a ::warning:: when the three required repo secrets (UPM_SERVICE_ACCOUNT_KEY_ID, UPM_SERVICE_ACCOUNT_KEY_SECRET, UPM_ORG_ID) are missing, so the existing release pipeline keeps shipping unchanged until they are configured.
  • New docs/openupm-signing.md documents the one-time setup (Unity org + service account + GitHub secrets), the cross-repo PR needed on openupm/openupm to flip the listing's trackingMode: gittrackingMode: githubRelease, the verification procedure, and troubleshooting. Linked from docs/_sidebar.md under "Development".

Implements the procedure documented at https://openupm.com/docs/signing-upm-packages.html and https://openupm.com/blog/signing-upm-packages-with-openupm/, modeled on the OpenUPM example repo https://github.com/openupm/com.example.signed-upm.

Operational follow-up (out of scope for this PR — see docs/openupm-signing.md)

  1. Create a Unity organization service account with package-signing permission and set the three UPM_* repo secrets.
  2. Open a PR against openupm/openupm (data/packages/com.ivanmurzak.unity.mcp.yml) changing trackingMode: gittrackingMode: githubRelease. Per the OpenUPM blog this should land before the first signed release ships so OpenUPM does not race-publish the unsigned git tag.

Test plan

  • release.yml is parseable YAML (validated with PyYAML).
  • New job's needs:, if:, continue-on-error:, env: structure follows the same shape as the existing publish-unity-installer / publish-mcp-server jobs.
  • The Verify signing secrets step short-circuits the job (exit non-zero → continue-on-error keeps workflow green) when secrets are absent, so the PR is safe to merge even before the Unity-org credentials are provisioned.
  • EditMode tests NOT run locally — the diff is exclusively .github/workflows/ YAML + docs (zero .cs / Unity asset changes). The worktree's first-time unity-mcp-server.exe binary download failed during setup, leaving the local MCP gate at localhost:5940 unreachable; the profile does not document a recovery path for this case. CI's full matrix is the authoritative gate for these files. See the iteration report's pipeline-improvement brief.

Closes #414

Adds a `sign-and-publish-upm` job to .github/workflows/release.yml that
runs Unity's `upm pack` with service-account credentials on every
successful version-bump release. The signed .tgz (containing the
required `package/.attestation.p7m` attestation) is attached to the
GitHub Release alongside the existing Unity package and server zip
assets so OpenUPM can serve a signed tarball once its listing is
flipped to `trackingMode: githubRelease`.

The job is `continue-on-error: true` and short-circuits with a warning
when the three required repo secrets (`UPM_SERVICE_ACCOUNT_KEY_ID`,
`UPM_SERVICE_ACCOUNT_KEY_SECRET`, `UPM_ORG_ID`) are absent, so the
existing release pipeline keeps shipping unchanged until the
maintainer configures a Unity-organization service account.

docs/openupm-signing.md captures the one-time setup (Unity org +
service account, GitHub secrets, and the cross-repo PR against
openupm/openupm to flip `trackingMode`), the verification procedure,
and troubleshooting notes. Linked from docs/_sidebar.md under
"Development".

Closes #414
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   12 files    564 suites   45m 41s ⏱️
  954 tests   953 ✅ 1 💤 0 ❌
5 724 runs  5 718 ✅ 6 💤 0 ❌

Results for commit c0fc102.

…m job; recommend OpenUPM asset prefix unconditionally

Apply 03a review-pass findings against the new sign-and-publish-upm job and the OpenUPM signing docs.

release.yml:
- Drop dead PACKAGE_NAME / PACKAGE_VERSION exports in the metadata step; keep printf as log-only.
- Wire the existing PACKAGE_ARCHIVE env export through to the attach step so the exact verified archive is uploaded (was globbing /tmp/signed-upm-dist/*.tgz).
- Include archive paths in the 'wrong count' error so a future failure is debuggable from the log alone.

docs/openupm-signing.md:
- Recommend githubReleaseAssetName unconditionally for the openupm/openupm listing PR; the release already ships multiple asset types and adding a prefix guard is a one-line future-proof.

simplify-pass: 1
Address pass-2 review findings on the sign-and-publish-upm job's verify step:

- Assert the signed archive basename begins with the documented
  `com.ivanmurzak.unity.mcp-` prefix that docs/openupm-signing.md
  tells OpenUPM to consume via `githubReleaseAssetName`. Without
  this guard, a future `upm pack` naming change would let CI pass
  while OpenUPM silently failed to pick up the signed tarball.
- Capture `tar -tzf` output into a single variable, then grep it
  twice locally. Saves one tarball walk per release; cosmetic but
  removes a duplicated traversal.

simplify-pass: 2
@IvanMurzak IvanMurzak merged commit f4c8d1c into main May 23, 2026
16 checks passed
@IvanMurzak IvanMurzak deleted the worktree-414-sign-openupm-package branch May 23, 2026 08:18
@IvanMurzak IvanMurzak self-assigned this May 23, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label May 23, 2026
IvanMurzak added a commit that referenced this pull request May 23, 2026
…ing success (#778)

Restructured Unity-MCP's release.yml so the GitHub Release is the atomic publish point gated on every prerequisite (tests, builds, signed UPM tarball, release notes); reverted #776's soft-fail signing to a hard gate; removed three post-release publish jobs; rewrote docs/openupm-signing.md to reflect blocking semantics. Pass-1 simplify hardened the atomic publish.\n\nCloses #777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package dont got signature

1 participant