|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This project uses [JReleaser](https://jreleaser.org/) for automated releases to GitHub Releases and Maven Central. |
| 4 | + |
| 5 | +## Creating a Release |
| 6 | + |
| 7 | +1. **Ensure all changes are committed and pushed** |
| 8 | + |
| 9 | + ```bash |
| 10 | + git status # Should be clean |
| 11 | + ``` |
| 12 | + |
| 13 | +2. **Trigger the release workflow** |
| 14 | + - Go to [Actions → Release](../../actions/workflows/release.yml) |
| 15 | + - Click **Run workflow** |
| 16 | + - Enter the release version (e.g., `1.0.0`) |
| 17 | + - Click **Run workflow** |
| 18 | + |
| 19 | +3. **What the workflow does** |
| 20 | + - Updates all `pom.xml` versions to the release version |
| 21 | + - Builds and signs artifacts (JARs, sources, javadoc) for both modules |
| 22 | + - Deploys staging artifacts to local directories |
| 23 | + - Commits and pushes the version change |
| 24 | + - Creates a GitHub Release with auto-generated changelog |
| 25 | + - Publishes both `miniterm` and `miniterm-ffm` to Maven Central |
| 26 | + - Bumps versions to the next `-SNAPSHOT` and pushes |
| 27 | + |
| 28 | +4. **Verify the release** |
| 29 | + - Check [GitHub Releases](../../releases) |
| 30 | + - Check [Maven Central](https://central.sonatype.com/search?q=g:org.codejive.miniterm) (may take ~30 minutes) |
| 31 | + |
| 32 | +## Local Testing (Optional) |
| 33 | + |
| 34 | +```bash |
| 35 | +# Validate JReleaser configuration |
| 36 | +./mvnw jreleaser:config |
| 37 | + |
| 38 | +# Test build with release profile (produces staged artifacts) |
| 39 | +./mvnw clean deploy -Prelease |
| 40 | + |
| 41 | +# Inspect staged artifacts (all modules land here) |
| 42 | +ls target/staging-deploy/ |
| 43 | +``` |
| 44 | + |
| 45 | +## First-Time Setup |
| 46 | + |
| 47 | +### 1. Generate GPG Keys |
| 48 | + |
| 49 | +```bash |
| 50 | +gpg --gen-key |
| 51 | +gpg --list-secret-keys --keyid-format=long |
| 52 | + |
| 53 | +# Export keys (replace KEY_ID with your key ID) |
| 54 | +gpg --armor --export KEY_ID > public.key |
| 55 | +gpg --armor --export-secret-keys KEY_ID > private.key |
| 56 | + |
| 57 | +# Publish to key server |
| 58 | +gpg --keyserver keyserver.ubuntu.com --send-keys KEY_ID |
| 59 | +``` |
| 60 | + |
| 61 | +### 2. Register at Maven Central |
| 62 | + |
| 63 | +1. Sign up at https://central.sonatype.com/ |
| 64 | +2. Verify namespace ownership for `org.codejive` |
| 65 | +3. Generate a user token (username + password) |
| 66 | + |
| 67 | +### 3. Configure GitHub Secrets |
| 68 | + |
| 69 | +Add at [Settings → Secrets → Actions](../../settings/secrets/actions): |
| 70 | + |
| 71 | +| Secret | Description | |
| 72 | +|--------|-------------| |
| 73 | +| `GPG_PUBLIC_KEY` | Contents of `public.key` | |
| 74 | +| `GPG_SECRET_KEY` | Contents of `private.key` | |
| 75 | +| `GPG_PASSPHRASE` | Passphrase used when generating the GPG key | |
| 76 | +| `MAVENCENTRAL_USERNAME` | Maven Central token username | |
| 77 | +| `MAVENCENTRAL_PASSWORD` | Maven Central token password | |
| 78 | + |
| 79 | +`GITHUB_TOKEN` is provided automatically by GitHub Actions. |
| 80 | + |
| 81 | +### 4. Optional: Protected Environment |
| 82 | + |
| 83 | +For an extra approval gate, create a `jreleaser` environment under Settings → Environments, add the same secrets there, and uncomment the `environment: jreleaser` line in `.github/workflows/release.yml`. |
| 84 | + |
| 85 | +## Version Management |
| 86 | + |
| 87 | +- Development versions use `-SNAPSHOT` suffix (e.g., `1.0.0-SNAPSHOT`) |
| 88 | +- The workflow automatically bumps to the next patch SNAPSHOT after each release |
| 89 | +- Use [semantic versioning](https://semver.org/): `MAJOR.MINOR.PATCH` |
| 90 | +- Use [conventional commits](https://www.conventionalcommits.org/) for automatic changelog entries (`feat:`, `fix:`, `docs:`, etc.) |
0 commit comments