|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document outlines the release process for the Nuxt UTM module. |
| 4 | + |
| 5 | +## Release Workflow |
| 6 | + |
| 7 | +We follow a two-step release process: |
| 8 | + |
| 9 | +1. **Manual Release Preparation (Local)**: |
| 10 | + |
| 11 | + - Version bump |
| 12 | + - CHANGELOG update |
| 13 | + - Tag creation |
| 14 | + - Git commit |
| 15 | + |
| 16 | +2. **Automated NPM Publishing (GitHub Actions)**: |
| 17 | + - Triggered by the newly created release/tag |
| 18 | + - Builds and publishes the package to NPM |
| 19 | + |
| 20 | +## Manual Release Steps |
| 21 | + |
| 22 | +To create a new release: |
| 23 | + |
| 24 | +1. Ensure you have the latest changes from the main branch: |
| 25 | + |
| 26 | + ```bash |
| 27 | + git checkout main |
| 28 | + git pull origin main |
| 29 | + ``` |
| 30 | + |
| 31 | +2. Make sure all tests pass: |
| 32 | + |
| 33 | + ```bash |
| 34 | + yarn test |
| 35 | + ``` |
| 36 | + |
| 37 | +3. Run the release script, which will: |
| 38 | + |
| 39 | + - Bump the version in package.json |
| 40 | + - Update the CHANGELOG.md |
| 41 | + - Create a git tag |
| 42 | + - Commit changes |
| 43 | + |
| 44 | + ```bash |
| 45 | + yarn release |
| 46 | + ``` |
| 47 | + |
| 48 | +4. Push the changes including the new tag: |
| 49 | + ```bash |
| 50 | + # This will be done automatically by the release script |
| 51 | + ``` |
| 52 | + |
| 53 | +## Automated NPM Publishing |
| 54 | + |
| 55 | +After the manual release process: |
| 56 | + |
| 57 | +1. GitHub Actions workflow [npm-publish.yml](../.github/workflows/npm-publish.yml) will be triggered automatically when: |
| 58 | + |
| 59 | + - A new GitHub release is created |
| 60 | + - OR manually triggered via workflow_dispatch |
| 61 | + |
| 62 | +2. The workflow will: |
| 63 | + - Check out the repository |
| 64 | + - Set up Node.js |
| 65 | + - Install dependencies |
| 66 | + - Build the module |
| 67 | + - Publish to NPM using the credentials stored in GitHub secrets |
| 68 | + |
| 69 | +## Version Numbering |
| 70 | + |
| 71 | +We follow [Semantic Versioning](https://semver.org/) for this project: |
| 72 | + |
| 73 | +- **MAJOR** version for incompatible API changes |
| 74 | +- **MINOR** version for backwards-compatible functionality additions |
| 75 | +- **PATCH** version for backwards-compatible bug fixes |
| 76 | + |
| 77 | +## Troubleshooting |
| 78 | + |
| 79 | +If the automated publishing fails: |
| 80 | + |
| 81 | +1. Check the GitHub Actions logs for errors |
| 82 | +2. Ensure the `npm_token` secret is correctly set in the repository settings |
| 83 | +3. Verify that the version in package.json hasn't already been published |
| 84 | + |
| 85 | +## Additional Notes |
| 86 | + |
| 87 | +- The release process uses [changelogen](https://github.com/unjs/changelogen) to generate CHANGELOG entries |
| 88 | +- Always verify that the published package works correctly by installing it in a test project |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +For questions or assistance with the release process, please contact the maintainers or email [[email protected]](mailto:[email protected]). |
0 commit comments