|
1 | 1 | # 🧪 RESTful API with Java and Spring Boot |
2 | 2 |
|
3 | | -[](https://github.com/nanotaboada/java.samples.spring.boot/actions/workflows/maven.yml) |
| 3 | +[](https://github.com/nanotaboada/java.samples.spring.boot/actions/workflows/maven-ci.yml) |
4 | 4 | [](https://github.com/nanotaboada/java.samples.spring.boot/actions/workflows/codeql.yml) |
5 | 5 | [](https://sonarcloud.io/summary/new_code?id=nanotaboada_java.samples.spring.boot) |
6 | 6 | [](https://codecov.io/gh/nanotaboada/java.samples.spring.boot) |
@@ -32,6 +32,7 @@ Proof of Concept for a RESTful Web Service built with **Spring Boot 4** targetin |
32 | 32 | - [Reset Database](#reset-database) |
33 | 33 | - [Environment Variables](#environment-variables) |
34 | 34 | - [Command Summary](#command-summary) |
| 35 | +- [Releases](#releases) |
35 | 36 | - [Contributing](#contributing) |
36 | 37 | - [Legal](#legal) |
37 | 38 |
|
@@ -391,6 +392,92 @@ spring.jpa.hibernate.ddl-auto=create-drop |
391 | 392 |
|
392 | 393 | > 💡 **Note:** Always use the Maven wrapper (`./mvnw`) instead of system Maven to ensure consistent builds. |
393 | 394 |
|
| 395 | +## Releases |
| 396 | + |
| 397 | +This project uses **historic football clubs** as release codenames 🏆 (inspired by Ubuntu, Android, and macOS naming conventions). |
| 398 | + |
| 399 | +### Release Naming Convention |
| 400 | + |
| 401 | +Releases follow the pattern: `v{SEMVER}-{CLUB}` (e.g., `v1.0.0-arsenal`) |
| 402 | + |
| 403 | +- **Semantic Version**: Standard versioning (MAJOR.MINOR.PATCH) |
| 404 | +- **Club Name**: Alphabetically ordered codename from the [historic club list](CHANGELOG.md) |
| 405 | + |
| 406 | +### Create a Release |
| 407 | + |
| 408 | +To create a new release, follow this workflow: |
| 409 | + |
| 410 | +#### 1. Create a Release Branch |
| 411 | + |
| 412 | +Branch protection prevents direct pushes to `master`, so all release prep goes through a PR: |
| 413 | + |
| 414 | +```bash |
| 415 | +git checkout master && git pull |
| 416 | +git checkout -b release/v1.0.0-arsenal |
| 417 | +``` |
| 418 | + |
| 419 | +#### 2. Update CHANGELOG.md |
| 420 | + |
| 421 | +Move items from `[Unreleased]` to a new release section in [CHANGELOG.md](CHANGELOG.md), then commit and push the branch: |
| 422 | + |
| 423 | +```bash |
| 424 | +# Move items from [Unreleased] to new release section |
| 425 | +# Example: [1.0.0 - Arsenal] - 2026-XX-XX |
| 426 | +git add CHANGELOG.md |
| 427 | +git commit -m "docs(changelog): prepare release notes for v1.0.0-arsenal" |
| 428 | +git push origin release/v1.0.0-arsenal |
| 429 | +``` |
| 430 | + |
| 431 | +#### 3. Merge the Release PR |
| 432 | + |
| 433 | +Open a pull request from `release/v1.0.0-arsenal` into `master` and merge it. The tag must be created **after** the merge so it points to the correct commit on `master`. |
| 434 | + |
| 435 | +#### 4. Create and Push Tag |
| 436 | + |
| 437 | +After the PR is merged, pull `master` and create the annotated tag: |
| 438 | + |
| 439 | +```bash |
| 440 | +git checkout master && git pull |
| 441 | +git tag -a v1.0.0-arsenal -m "Release 1.0.0 - Arsenal" |
| 442 | +git push origin v1.0.0-arsenal |
| 443 | +``` |
| 444 | + |
| 445 | +#### 5. Automated CD Workflow |
| 446 | + |
| 447 | +This triggers the CD workflow which automatically: |
| 448 | + |
| 449 | +1. Validates the club name |
| 450 | +2. Builds and tests the project with Maven |
| 451 | +3. Publishes Docker images to GitHub Container Registry with three tags |
| 452 | +4. Creates a GitHub Release with auto-generated changelog from commits |
| 453 | + |
| 454 | +#### Pre-Release Checklist |
| 455 | + |
| 456 | +- [ ] Release branch created from `master` |
| 457 | +- [ ] `CHANGELOG.md` updated with release notes |
| 458 | +- [ ] Changes committed and pushed on the release branch |
| 459 | +- [ ] Release PR merged into `master` |
| 460 | +- [ ] Tag created with correct format: `vX.Y.Z-club` |
| 461 | +- [ ] Club name is valid (A-Z from the [historic club list](CHANGELOG.md)) |
| 462 | +- [ ] Tag pushed to trigger CD workflow |
| 463 | + |
| 464 | +### Pull Docker Images |
| 465 | + |
| 466 | +Each release publishes multiple tags for flexibility: |
| 467 | + |
| 468 | +```bash |
| 469 | +# By semantic version (recommended for production) |
| 470 | +docker pull ghcr.io/nanotaboada/java-samples-spring-boot:1.0.0 |
| 471 | + |
| 472 | +# By club name (memorable alternative) |
| 473 | +docker pull ghcr.io/nanotaboada/java-samples-spring-boot:arsenal |
| 474 | + |
| 475 | +# Latest release |
| 476 | +docker pull ghcr.io/nanotaboada/java-samples-spring-boot:latest |
| 477 | +``` |
| 478 | + |
| 479 | +> 💡 See [CHANGELOG.md](CHANGELOG.md) for the complete club list (A-Z) and release history. |
| 480 | +
|
394 | 481 | ## Contributing |
395 | 482 |
|
396 | 483 | Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on: |
|
0 commit comments