|
| 1 | +# Release Process (v1.0.0) |
| 2 | + |
| 3 | +## Version |
| 4 | + |
| 5 | +> **The `[semantic version]` is bumped according to releases, new features, and breaking changes.** |
| 6 | +> |
| 7 | +> *The `main` branch uses the semantic version of the last released version. |
| 8 | +
|
| 9 | +## Process |
| 10 | + |
| 11 | +**Note**: this guide assumes that the your git `torrust` remote is like this: |
| 12 | + |
| 13 | +```sh |
| 14 | +git remote show torrust |
| 15 | +``` |
| 16 | + |
| 17 | +```s |
| 18 | +* remote torrust |
| 19 | + Fetch URL: [email protected]:torrust/torrust-index-api-lib.git |
| 20 | + Push URL: [email protected]:torrust/torrust-index-api-lib.git |
| 21 | +... |
| 22 | +``` |
| 23 | + |
| 24 | +### 1. The `main` branch is ready for a release |
| 25 | + |
| 26 | +```sh |
| 27 | +npm install && npm run build |
| 28 | +``` |
| 29 | + |
| 30 | +There should be no errors installing or building the library. |
| 31 | + |
| 32 | +### 2. Change the version in the `package.json` file |
| 33 | + |
| 34 | +Change the version in the `package.json` file. For example `3.0.0`. |
| 35 | + |
| 36 | +> NOTICE: The `v` prefix is not needed. |
| 37 | +
|
| 38 | +Install and build to double-check: |
| 39 | + |
| 40 | +```sh |
| 41 | +npm install && npm run build |
| 42 | +``` |
| 43 | + |
| 44 | +Commit the changes: |
| 45 | + |
| 46 | +```sh |
| 47 | +git add -A |
| 48 | +git commit -m "feat: release [semantic version]" |
| 49 | +``` |
| 50 | + |
| 51 | +### 3. Create a new tag an push to the remote |
| 52 | + |
| 53 | +```sh |
| 54 | +git tag v[semantic version] |
| 55 | +git push torrust && git push torrust v[semantic version] |
| 56 | +``` |
| 57 | + |
| 58 | +For example: |
| 59 | + |
| 60 | +```sh |
| 61 | +git tag v3.0.0 |
| 62 | +git push torrust && git push torrust v3.0.0 |
| 63 | +``` |
| 64 | + |
| 65 | +### 4. Manually publish the NPM package |
| 66 | + |
| 67 | +```sh |
| 68 | +npm publish |
| 69 | +``` |
| 70 | + |
| 71 | +> IMPORTANT: |
| 72 | +> |
| 73 | +> - You will require to login. |
| 74 | +> - You have to have permission for publishing on the Torrust namespace. |
| 75 | +
|
| 76 | +If you get an error because you were not logged in, just retry the same command after the login. |
| 77 | + |
| 78 | +### 4. Check the package is published |
| 79 | + |
| 80 | +You should receive an email when the package is published. |
| 81 | + |
| 82 | +You can also check on the NPM registry: <https://www.npmjs.com/package/torrust-index-api-lib>. |
0 commit comments