This project uses NPM Provenance for automated publishing from GitHub Actions. This is similar to RubyGems trusted publishing, but not fully tokenless yet.
| Feature | RubyGems Trusted Publishing | NPM Provenance |
|---|---|---|
| Token Required | ❌ No | |
| OIDC Attestation | ✅ Yes | ✅ Yes |
| Proof of Origin | ✅ Yes | ✅ Yes |
| Supply Chain Security | ✅ Yes | ✅ Yes |
NPM provenance adds cryptographic proof that your package was built from your GitHub repo, even though you still need a token for authentication.
# Login to NPM
npm login
# First-time publish to claim the package name
npm publish --access public- Go to https://www.npmjs.com/settings/[your-username]/tokens
- Click "Generate New Token"
- Select "Automation" (not Classic or Granular)
- Copy the token
- Go to https://github.com/mensfeld/craftdesk/settings/secrets/actions
- Click "New repository secret"
- Name:
NPM_TOKEN - Value: Paste your NPM automation token
- Click "Add secret"
- Go to https://www.npmjs.com/package/craftdesk/access
- Under "Publishing access" → Enable "Require packages to be published with provenance"
- This ensures all future publishes must include provenance
# 1. Update version in package.json
npm version patch # or minor, major
# 2. Update CHANGELOG.md with changes
# 3. Commit and push
git add package.json CHANGELOG.md
git commit -m "Bump version to $(node -p "require('./package.json').version")"
git push
# 4. Create GitHub release
gh release create v$(node -p "require('./package.json').version") \
--title "v$(node -p "require('./package.json').version")" \
--notes "See CHANGELOG.md for details"
# 5. GitHub Actions will automatically publish to NPM ✅# Go to GitHub Actions → Publish to NPM → Run workflow
# Optionally specify a version to bumpCreate scripts/release.sh:
#!/bin/bash
set -e
VERSION_TYPE=${1:-patch} # patch, minor, or major
echo "Creating $VERSION_TYPE release..."
# Update version
npm version $VERSION_TYPE --no-git-tag-version
NEW_VERSION=$(node -p "require('./package.json').version")
# Update changelog placeholder
echo "Please update CHANGELOG.md with changes for v$NEW_VERSION"
read -p "Press enter when done..."
# Commit changes
git add package.json CHANGELOG.md
git commit -m "Bump version to $NEW_VERSION"
git push
# Create release
gh release create "v$NEW_VERSION" \
--title "Release v$NEW_VERSION" \
--notes-file CHANGELOG.md
echo "✅ Release v$NEW_VERSION created!"
echo "🚀 GitHub Actions will publish to NPM automatically"Usage:
chmod +x scripts/release.sh
./scripts/release.sh patch # x.y.z → x.y.(z+1)
./scripts/release.sh minor # x.y.z → x.(y+1).0
./scripts/release.sh major # x.y.z → (x+1).0.0Based on .npmignore and package.json "files" field:
✅ Included:
dist/(compiled JavaScript)bin/(CLI entry point)README.mdCHANGELOG.mdLICENSE.mdpackage.json
❌ Excluded:
src/(TypeScript source)tests/.github/docs/coverage/- Development config files
After publishing, verify provenance:
# Check the package on NPM
npm view craftdesk
# Verify provenance signature
npm audit signaturesYou should see a ✅ indicator on the NPM package page showing provenance is enabled.
- Check NPM_TOKEN is valid and has publish permissions
- Ensure package name isn't already taken by someone else
- Try
npm whoamito verify authentication
- Ensure
id-token: writepermission is in workflow - Check that you're publishing from GitHub Actions (not local)
- Verify repository is public (provenance requires public repos)
- You forgot to bump the version in package.json
- Run
npm version patchbefore creating release
# One-time setup
npm login
npm publish --access public # Claims package name
# Add NPM_TOKEN to GitHub secrets
# Every release after that
npm version patch
git add package.json CHANGELOG.md
git commit -m "Bump to 0.3.1"
git push
gh release create v0.3.1 --title "v0.3.1" --generate-notes
# ✅ GitHub Actions publishes automatically with provenanceNPM is working on full OIDC publishing (like RubyGems), but it's not available yet. When it arrives, you'll be able to remove the NPM_TOKEN secret entirely. Track progress at: npm/rfcs#626