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
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,40 @@ describe('MyComponent', () => {

## 📦 Publishing

### Setup npm Publishing
### Setup Automated Publishing with OIDC (Recommended)

1. Add `NPM_TOKEN` to GitHub repository secrets
2. Update version in `package.json`
3. Create a GitHub release
4. Automated workflow publishes to npm
This template is configured to publish to npm using OpenID Connect (OIDC), which is more secure than using long-lived NPM tokens.

**Initial Setup:**

1. Publish your package to npm manually the first time:
```bash
npm run test:run # Ensure tests pass
npm run lint # Ensure code is clean
npm publish # First publish must be manual
```

2. Configure OIDC on npm:
- Visit your package's access page: `https://www.npmjs.com/package/@yourscope/your-component-name/access`
- Under "Publishing Access", click "Configure OIDC"
- Add GitHub Actions as a trusted publisher with these settings:
- **Provider**: GitHub
- **Organization/Username**: Your GitHub username or organization
- **Repository**: Your repository name
- **Workflow**: `.github/workflows/publish.yml`
- **Environment**: Leave blank (unless you use GitHub environments)

3. Create a GitHub release to trigger automated publishing:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot Recommend npm version and git push --follow-tags

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to use npm version patch (or minor/major) and git push --follow-tags in commit 3c53290.

- Use `npm version` to update version and create a tag: `npm version patch` (or `minor`/`major`)
- Push with tags: `git push --follow-tags`
- Or create a release through GitHub's UI

The GitHub Actions workflow (`.github/workflows/publish.yml`) will automatically publish to npm when you create a new version tag.

### Manual Publishing

If you prefer to publish manually without automation:

```bash
npm run test:run # Ensure tests pass
npm run lint # Ensure code is clean
Expand Down
Loading
Loading