Skip to content

Commit

Permalink
Update release process and documentation
Browse files Browse the repository at this point in the history
- Update npm-publish workflow to focus solely on publishing to NPM without handling release process
- Create comprehensive RELEASING.md documentation with manual and automated steps
- Update README.md to reference the new release documentation
  • Loading branch information
sadjow committed Feb 28, 2025
1 parent dd4b6b3 commit a0ce0e5
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Publish the release to npm
name: Publish to NPM

on:
workflow_dispatch:
push:
release:
types: [created]

Expand All @@ -17,6 +16,6 @@ jobs:
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn dev:build
- run: yarn release
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ yarn test:watch
yarn release
```

For detailed information about the release process, please refer to our [Release Documentation](/docs/RELEASING.md).

## License

<!-- NOTE: If you need a different type of licence, please check with the OSS team before changing it -->
Expand Down
92 changes: 92 additions & 0 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Release Process

This document outlines the release process for the Nuxt UTM module.

## Release Workflow

We follow a two-step release process:

1. **Manual Release Preparation (Local)**:

- Version bump
- CHANGELOG update
- Tag creation
- Git commit

2. **Automated NPM Publishing (GitHub Actions)**:
- Triggered by the newly created release/tag
- Builds and publishes the package to NPM

## Manual Release Steps

To create a new release:

1. Ensure you have the latest changes from the main branch:

```bash
git checkout main
git pull origin main
```

2. Make sure all tests pass:

```bash
yarn test
```

3. Run the release script, which will:

- Bump the version in package.json
- Update the CHANGELOG.md
- Create a git tag
- Commit changes

```bash
yarn release
```

4. Push the changes including the new tag:
```bash
# This will be done automatically by the release script
```

## Automated NPM Publishing

After the manual release process:

1. GitHub Actions workflow [npm-publish.yml](../.github/workflows/npm-publish.yml) will be triggered automatically when:

- A new GitHub release is created
- OR manually triggered via workflow_dispatch

2. The workflow will:
- Check out the repository
- Set up Node.js
- Install dependencies
- Build the module
- Publish to NPM using the credentials stored in GitHub secrets

## Version Numbering

We follow [Semantic Versioning](https://semver.org/) for this project:

- **MAJOR** version for incompatible API changes
- **MINOR** version for backwards-compatible functionality additions
- **PATCH** version for backwards-compatible bug fixes

## Troubleshooting

If the automated publishing fails:

1. Check the GitHub Actions logs for errors
2. Ensure the `npm_token` secret is correctly set in the repository settings
3. Verify that the version in package.json hasn't already been published

## Additional Notes

- The release process uses [changelogen](https://github.com/unjs/changelogen) to generate CHANGELOG entries
- Always verify that the published package works correctly by installing it in a test project

---

For questions or assistance with the release process, please contact the maintainers or email [community@stackbuilders.com](mailto:community@stackbuilders.com).

0 comments on commit a0ce0e5

Please sign in to comment.