|
| 1 | +# How to Release Coolify CLI |
| 2 | + |
| 3 | +This guide explains the release process for the Coolify CLI. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Write access to the `coollabsio/coolify-cli` repository |
| 8 | +- All changes merged to the target branch (`v4.x`) |
| 9 | +- All tests passing (`go test ./internal/...`) |
| 10 | + |
| 11 | +## Release Process |
| 12 | + |
| 13 | +### 1. Update Version Number |
| 14 | + |
| 15 | +Edit `cmd/root.go` and update the `CliVersion` variable: |
| 16 | + |
| 17 | +```go |
| 18 | +var CliVersion = "1.x.x" // Change to your new version |
| 19 | +``` |
| 20 | + |
| 21 | +**Version Format:** Use semantic versioning: `MAJOR.MINOR.PATCH` (e.g., `1.2.3`) |
| 22 | +- **MAJOR**: Breaking changes |
| 23 | +- **MINOR**: New features (backwards compatible) |
| 24 | +- **PATCH**: Bug fixes (backwards compatible) |
| 25 | + |
| 26 | +### 2. Commit and Push Version Change |
| 27 | + |
| 28 | +```bash |
| 29 | +git add cmd/root.go |
| 30 | +git commit -m "chore: bump version to 1.x.x" |
| 31 | +git push origin v4.x |
| 32 | +``` |
| 33 | + |
| 34 | +### 3. Create a GitHub Release |
| 35 | + |
| 36 | +1. Go to https://github.com/coollabsio/coolify-cli/releases/new |
| 37 | +2. Click "Choose a tag" and create a new tag: |
| 38 | + - **Tag name**: `v1.x.x` (must start with `v`, e.g., `v1.2.3`) |
| 39 | + - **Target**: `v4.x` (or your target branch) |
| 40 | +3. **Release title**: `v1.x.x` (same as tag name) |
| 41 | +4. **Description**: Write release notes describing: |
| 42 | + - New features |
| 43 | + - Bug fixes |
| 44 | + - Breaking changes (if any) |
| 45 | + - Example: |
| 46 | + ```markdown |
| 47 | + ## What's New |
| 48 | + - Added support for database management |
| 49 | + - Improved error messages for API failures |
| 50 | + |
| 51 | + ## Bug Fixes |
| 52 | + - Fixed panic when config file is missing |
| 53 | + |
| 54 | + ## Breaking Changes |
| 55 | + - None |
| 56 | + ``` |
| 57 | +5. Click "Publish release" |
| 58 | + |
| 59 | +### 4. Automated Build Process |
| 60 | + |
| 61 | +Once you publish the release: |
| 62 | + |
| 63 | +1. GitHub Actions automatically triggers the `release-cli.yml` workflow |
| 64 | +2. GoReleaser builds binaries for: |
| 65 | + - **Linux**: amd64, arm64 |
| 66 | + - **macOS (Darwin)**: amd64, arm64 |
| 67 | + - **Windows**: amd64, arm64 |
| 68 | +3. Binaries are automatically uploaded to the release |
| 69 | +4. The release becomes available at: |
| 70 | + - GitHub: `https://github.com/coollabsio/coolify-cli/releases/tag/v1.x.x` |
| 71 | + - Install script: `curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash` |
| 72 | + |
| 73 | +### 5. Verify the Release |
| 74 | + |
| 75 | +After the workflow completes (usually 2-5 minutes): |
| 76 | + |
| 77 | +1. Check the release page has all platform binaries |
| 78 | +2. Test the install script: |
| 79 | + ```bash |
| 80 | + curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash |
| 81 | + coolify version |
| 82 | + ``` |
| 83 | +3. Test the auto-update functionality: |
| 84 | + ```bash |
| 85 | + # If you have an older version installed |
| 86 | + coolify update |
| 87 | + coolify version # Should show the new version |
| 88 | + ``` |
| 89 | +4. Verify the version matches your release |
| 90 | + |
| 91 | +## Troubleshooting |
| 92 | + |
| 93 | +### Build Failed |
| 94 | +- Check the GitHub Actions logs at https://github.com/coollabsio/coolify-cli/actions |
| 95 | +- Common issues: |
| 96 | + - Syntax errors in Go code |
| 97 | + - Test failures |
| 98 | + - GoReleaser configuration issues |
| 99 | + |
| 100 | +### Version Not Updating |
| 101 | +- Ensure you committed the version change in `cmd/root.go` |
| 102 | +- The tag must start with `v` (e.g., `v1.2.3`, not `1.2.3`) |
| 103 | +- Check that the workflow has write permissions |
| 104 | + |
| 105 | +### Install Script Not Finding New Version |
| 106 | +- Wait a few minutes for GitHub's CDN to update |
| 107 | +- Check that binaries were uploaded to the release |
| 108 | +- Verify the tag format is correct (`v1.x.x`) |
| 109 | + |
| 110 | +## Release Checklist |
| 111 | + |
| 112 | +Before creating a release: |
| 113 | + |
| 114 | +- [ ] All tests pass: `go test ./internal/...` |
| 115 | +- [ ] Code is formatted: `go fmt ./...` |
| 116 | +- [ ] Version updated in `cmd/root.go` |
| 117 | +- [ ] Changes merged to `v4.x` branch |
| 118 | +- [ ] Release notes prepared |
| 119 | + |
| 120 | +After creating a release: |
| 121 | + |
| 122 | +- [ ] GitHub Actions workflow completed successfully |
| 123 | +- [ ] All platform binaries are present on the release page |
| 124 | +- [ ] Install script downloads the new version |
| 125 | +- [ ] `coolify version` returns the correct version |
| 126 | + |
| 127 | +## Configuration Files |
| 128 | + |
| 129 | +The release process uses these configuration files: |
| 130 | + |
| 131 | +- `.goreleaser.yml` - GoReleaser configuration (build matrix, archives, etc.) |
| 132 | +- `.github/workflows/release-cli.yml` - GitHub Actions workflow |
| 133 | +- `scripts/install.sh` - User-facing install script |
| 134 | +- `cmd/root.go` - Contains `CliVersion` variable (line 22) |
| 135 | + |
| 136 | +## Notes |
| 137 | + |
| 138 | +- The CLI has auto-update checking built-in (checks every 10 minutes) |
| 139 | +- Users can manually update with `coolify update` |
| 140 | +- Install script supports version pinning: `bash install.sh v1.2.3` |
| 141 | +- Releases are immutable - if you need to fix something, create a new patch version |
0 commit comments