|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document describes how to release a new version of `terraform-provider-rediscloud`. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +You need: |
| 8 | +- **Push access to GitHub** - ability to push tags to the repository |
| 9 | +- **PR permissions** - ability to submit and merge pull requests |
| 10 | + |
| 11 | +That's it! The release automation handles everything else (building binaries, GPG signing, publishing to the Terraform Registry). |
| 12 | + |
| 13 | +## Release Steps |
| 14 | + |
| 15 | +### 1. Open a Pull Request to `main` |
| 16 | + |
| 17 | +Create a PR with your changes targeting the `main` branch. The PR should: |
| 18 | +- Include all the changes you want to release |
| 19 | +- Update the CHANGELOG if needed (follow existing format) |
| 20 | +- Pass all required checks before merging |
| 21 | + |
| 22 | +You should get someone to test and review your changes manually before releasing. |
| 23 | + |
| 24 | +### 2. Wait for Smoke Tests to Pass |
| 25 | + |
| 26 | +The PR will automatically run smoke tests via the `Terraform Provider Checks - PR workflow` workflow. |
| 27 | + |
| 28 | +The smoke tests consist of acceptance tests that will check the major resources to ensure that your changes did not cause any major regressions. They will typically take between 30 and 60 minutes. |
| 29 | + |
| 30 | +Additionally, these checks must pass: |
| 31 | +- `go build` - ensures the provider compiles |
| 32 | +- `tfproviderlint` - Terraform provider linting |
| 33 | +- `terraform providers schema` - validates schema generation |
| 34 | +- `go unit test` - runs unit tests |
| 35 | + |
| 36 | +**Do not merge until all smoke tests pass.** |
| 37 | + |
| 38 | +### 3. Merge the Pull Request |
| 39 | + |
| 40 | +Once the smoke tests pass, merge the PR to `main`. |
| 41 | + |
| 42 | +### 4. Tag and Push |
| 43 | + |
| 44 | +After merging to `main`: |
| 45 | + |
| 46 | +```bash |
| 47 | +# Switch to main and pull the merged changes |
| 48 | +git checkout main |
| 49 | +git pull origin main |
| 50 | + |
| 51 | +# Create an annotated tag with the version number |
| 52 | +# Use semantic versioning: v<major>.<minor>.<patch> |
| 53 | +git tag v1.2.3 |
| 54 | + |
| 55 | +# Push the tag to origin |
| 56 | +git push origin v1.2.3 |
| 57 | +``` |
| 58 | + |
| 59 | +**Important:** The tag MUST follow the pattern `v*` (e.g., `v1.2.3`, `v0.5.0`) for the release automation to trigger. |
| 60 | + |
| 61 | +### 5. Automation Takes Over |
| 62 | + |
| 63 | +When you push the tag, the `release` workflow (`.github/workflows/release.yml`) automatically: |
| 64 | + |
| 65 | +1. Checks out the tagged commit |
| 66 | +2. Sets up Go using the version from `go.mod` |
| 67 | +3. Imports the GPG signing key from GitHub secrets |
| 68 | +4. Runs [GoReleaser](https://goreleaser.com/) to: |
| 69 | + - Build binaries for all supported platforms |
| 70 | + - Sign the binaries with GPG |
| 71 | + - Create a GitHub release |
| 72 | + - Publish to the Terraform Registry |
| 73 | + |
| 74 | +**No manual intervention required** - just wait for the workflow to complete (usually 5-10 minutes). |
| 75 | + |
| 76 | +### 6. Create a GitHub Release |
| 77 | + |
| 78 | +To do this: |
| 79 | + |
| 80 | +2. Go to https://github.com/RedisLabs/terraform-provider-rediscloud/releases |
| 81 | +2. Add a new draft release |
| 82 | +3. Update the description with your entries in the `CHANGELOG.md`. |
| 83 | + |
| 84 | +**This step is not required for the release to work** - it's just nice to have for users. |
| 85 | + |
| 86 | +## Additional Resources |
| 87 | + |
| 88 | +- [Terraform Registry Provider Publishing](https://www.terraform.io/docs/registry/providers/publishing.html) |
| 89 | +- [GoReleaser Documentation](https://goreleaser.com/intro/) |
| 90 | +- [Semantic Versioning](https://semver.org/) |
0 commit comments