Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Package

# Publishes to npm with GitHub Actions trusted publishing (OIDC, with
# provenance): no npm token or 2FA code is stored or needed. Every merge to
# main publishes its package.json version once; a version that is already on
# npm is skipped. Requires the package's trusted publisher on npmjs.com to
# point at this repository and this workflow file.

on:
push:
branches:
- main
workflow_dispatch:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict manual publishing to main

When a maintainer dispatches this workflow with a non-main ref, actions/checkout checks out the selected branch and the unconditional final step publishes its package version, allowing unmerged code to reach npm without passing the required PR-to-main path. Remove workflow_dispatch or guard the publish job so it can run only for refs/heads/main.

AGENTS.md reference: AGENTS.md:L10-L10

Useful? React with 👍 / 👎.


permissions:
contents: read
id-token: write

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
Comment on lines +19 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Give each release a unique concurrency group

If three pushes reach main while the first workflow is still running, all runs use the same concurrency group; GitHub retains only one pending run and replaces that pending run when the third arrives, even with cancel-in-progress: false. The middle commit's unique patch version is therefore never tested or published, violating the requirement that every main update be released; key the group by commit SHA or remove workflow-level concurrency.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.


jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false

- name: Skip versions already on npm
id: version
run: |
name=$(node -p 'require("./package.json").name')
version=$(node -p 'require("./package.json").version')
if npm view "$name@$version" version >/dev/null 2>&1; then
echo "$name@$version is already published; nothing to do."
echo "publish=false" >> "$GITHUB_OUTPUT"
else
echo "publish=true" >> "$GITHUB_OUTPUT"
Comment on lines +40 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bump the npm version for this update

This commit changes configuration but leaves both package manifests at the already released 1.2.10, so when this exact commit reaches main, the version check succeeds and every install, test, and publish step is skipped. Increment package.json and package-lock.json so this update receives the required release rather than silently doing nothing.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

fi

- if: steps.version.outputs.publish == 'true'
run: npm ci

- if: steps.version.outputs.publish == 'true'
run: npm test

- if: steps.version.outputs.publish == 'true'
run: npm run test:package

- if: steps.version.outputs.publish == 'true'
run: npm publish
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ This file is the repository's shared source of truth for local agents, scheduled
## Release and review

- Every update to main requires an npm patch version bump and publication, including code, documentation, and configuration. Run `npm version patch` once for the release and include its package.json and package-lock.json changes in the same integration to main. No changes means no release.
- Use a PR to main. Include `@codex review` in change commit messages and request `@codex review` on the PR. After each update, wait at least five minutes and for review plus CI to complete on the current head. Inspect inline findings as well as summary comments; fix actionable findings and repeat. A stale review or passing local test does not authorize ignoring current CI failures.
- Before opening or updating a PR, run Matt Pocock's `code-review` skill against the main merge base and resolve substantive findings locally. GitHub CI is the expensive gate, so it should only see reviewed work. Then use a PR to main and wait for CI on the current head; a passing local test does not authorize ignoring current CI failures. Codex review is not part of this process: don't put `@codex review` in commit messages or PR comments unless the maintainer asks for it.
- Prioritize substantive defects and regressions in supported workflows. Document and defer obscure edge cases, speculative hardening, and cosmetic objections instead of extending a sound release into an endless review loop.
- Publish from a clean build of the merged main commit, then create a `v<version>` tag and GitHub release with the accumulated changelog notes. Verify npm, the tag, the release, and a fresh `npx -y mcp-3d-printer-server` startup before declaring the release complete. Never move a published tag.
- The main-branch Publish Package workflow (`.github/workflows/publish.yml`) runs the checks and `npm publish` with trusted publishing; do not publish from a local checkout. Verify that workflow and the exact npm version before claiming publication. Then create a `v<version>` tag and GitHub release with the accumulated changelog notes. Verify npm, the tag, the release, and a fresh `npx -y mcp-3d-printer-server` startup before declaring the release complete. Never move a published tag.
- Changes to src/, scripts/, or printer behavior need a present-tense CHANGELOG.md entry under `## Unreleased`, including evidence limits (mocked transports versus real hardware).
- Never add AI or agent attribution anywhere in Git or GitHub: no `Co-Authored-By` trailers for Claude, Codex, or other assistants, no "Generated with" footers, and no agent session links in commits, PR titles or bodies, review replies, issue comments, or release notes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove AI attribution from the commit metadata

The commit being reviewed ends with a “Generated with Claude Code” footer and an agent session URL, directly violating the newly added prohibition on AI attribution in Git. Remove both pieces of attribution from the commit message before integrating it.

AGENTS.md reference: AGENTS.md:L12-L12

Useful? React with 👍 / 👎.

- Preserve original authorship when integrating contributor PRs. Credit code, issue reports, hardware evidence, and useful superseded proposals in CONTRIBUTORS.md.

## Community triage
Expand Down
Loading