|
| 1 | +# Release Guide |
| 2 | + |
| 3 | +This guide explains how to set up your NPM account and create releases for the `@kotaicodegmbh/k8s-resources` package. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Node.js and npm installed on your system |
| 8 | +2. Git installed and configured |
| 9 | +3. A GitHub account with access to the repository |
| 10 | +4. An NPM account |
| 11 | + |
| 12 | +## Setting Up NPM |
| 13 | + |
| 14 | +### 1. Create an NPM Account |
| 15 | + |
| 16 | +If you don't have an NPM account: |
| 17 | + |
| 18 | +1. Visit [npmjs.com](https://npmjs.com) |
| 19 | +2. Click "Sign Up" |
| 20 | +3. Follow the registration process |
| 21 | +4. Verify your email address |
| 22 | + |
| 23 | +### 2. Create an NPM Organization |
| 24 | + |
| 25 | +1. Log in to your NPM account |
| 26 | +2. Go to [npmjs.com/org/create](https://npmjs.com/org/create) |
| 27 | +3. Create an organization named "kotaicodegmbh" |
| 28 | +4. Choose the "Free" plan |
| 29 | +5. Add your account as an owner |
| 30 | + |
| 31 | +### 3. Generate an NPM Access Token |
| 32 | + |
| 33 | +1. Log in to your NPM account |
| 34 | +2. Click on your profile picture → "Access Tokens" |
| 35 | +3. Click "Generate New Token" |
| 36 | +4. Select "Automation" token type |
| 37 | +5. Copy the generated token (you won't be able to see it again) |
| 38 | + |
| 39 | +### 4. Add NPM Token to GitHub Secrets |
| 40 | + |
| 41 | +1. Go to your GitHub repository |
| 42 | +2. Navigate to Settings → Secrets and Variables → Actions |
| 43 | +3. Click "New repository secret" |
| 44 | +4. Name: `NPM_TOKEN` |
| 45 | +5. Value: Paste your NPM access token |
| 46 | +6. Click "Add secret" |
| 47 | + |
| 48 | +## Creating a Release |
| 49 | + |
| 50 | +### 1. Update Version |
| 51 | + |
| 52 | +Update the version in `package.json`: |
| 53 | + |
| 54 | +```bash |
| 55 | +npm version patch # for bug fixes (0.0.X) |
| 56 | +npm version minor # for new features (0.X.0) |
| 57 | +npm version major # for breaking changes (X.0.0) |
| 58 | +``` |
| 59 | + |
| 60 | +This will: |
| 61 | +- Update the version in `package.json` |
| 62 | +- Create a git commit |
| 63 | +- Create a git tag |
| 64 | + |
| 65 | +### 2. Push Changes |
| 66 | + |
| 67 | +Push your changes and the new tag to GitHub: |
| 68 | + |
| 69 | +```bash |
| 70 | +git push origin main |
| 71 | +git push origin --tags |
| 72 | +``` |
| 73 | + |
| 74 | +### 3. Release Process |
| 75 | + |
| 76 | +The GitHub Actions workflow will automatically: |
| 77 | + |
| 78 | +1. Run tests |
| 79 | +2. Build the package |
| 80 | +3. Create a GitHub release with auto-generated notes |
| 81 | +4. Publish to NPM as `@kotaicodegmbh/k8s-resources` |
| 82 | + |
| 83 | +You can monitor the release progress in: |
| 84 | +- GitHub Actions tab |
| 85 | +- GitHub Releases page |
| 86 | +- NPM package page |
| 87 | + |
| 88 | +## Verifying the Release |
| 89 | + |
| 90 | +### 1. Check GitHub Release |
| 91 | + |
| 92 | +1. Go to your repository's "Releases" page |
| 93 | +2. Verify the new release is listed |
| 94 | +3. Check the release notes are accurate |
| 95 | + |
| 96 | +### 2. Check NPM Package |
| 97 | + |
| 98 | +1. Visit [npmjs.com/package/@kotaicodegmbh/k8s-resources](https://npmjs.com/package/@kotaicodegmbh/k8s-resources) |
| 99 | +2. Verify the new version is listed |
| 100 | +3. Check the package details |
| 101 | + |
| 102 | +### 3. Test Installation |
| 103 | + |
| 104 | +Test the package installation in a new project: |
| 105 | + |
| 106 | +```bash |
| 107 | +npm install @kotaicodegmbh/k8s-resources |
| 108 | +``` |
| 109 | + |
| 110 | +## Troubleshooting |
| 111 | + |
| 112 | +### Common Issues |
| 113 | + |
| 114 | +1. **NPM Authentication Failed** |
| 115 | + - Verify your NPM token is correctly set in GitHub secrets |
| 116 | + - Check if your NPM account has access to the organization |
| 117 | + |
| 118 | +2. **Release Failed** |
| 119 | + - Check GitHub Actions logs for error messages |
| 120 | + - Verify all tests pass locally |
| 121 | + - Ensure the version number is unique |
| 122 | + |
| 123 | +3. **Package Not Published** |
| 124 | + - Verify the NPM token has publish permissions |
| 125 | + - Check if the package name is available |
| 126 | + - Ensure the organization exists and you have access |
| 127 | + |
| 128 | +### Getting Help |
| 129 | + |
| 130 | +If you encounter issues: |
| 131 | + |
| 132 | +1. Check the [GitHub Actions documentation](https://docs.github.com/en/actions) |
| 133 | +2. Review the [NPM documentation](https://docs.npmjs.com/) |
| 134 | +3. Open an issue in the repository |
0 commit comments