|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This project uses [JReleaser](https://jreleaser.org/) for automated releases to GitHub and Maven Central. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Ensure GitHub secrets are configured (see First-Time Setup below if not already configured). |
| 8 | + |
| 9 | +## Creating a Release |
| 10 | + |
| 11 | +1. **Ensure all changes are committed and pushed** |
| 12 | + |
| 13 | + ```bash |
| 14 | + git status # Should be clean |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Trigger the release workflow** |
| 18 | + - Go to [Actions → Release](../../actions/workflows/release.yml) |
| 19 | + - Click **Run workflow** |
| 20 | + - Enter the release version (e.g., `1.0.0`) |
| 21 | + - Click **Run workflow** |
| 22 | + |
| 23 | +3. **Monitor the workflow** |
| 24 | + - The workflow will: |
| 25 | + - Update version in pom.xml |
| 26 | + - Build and sign artifacts |
| 27 | + - Deploy to Maven Central |
| 28 | + - Create GitHub release with changelog |
| 29 | + - Bump to next SNAPSHOT version |
| 30 | + |
| 31 | +4. **Verify the release** |
| 32 | + - Check [GitHub Releases](../../releases) |
| 33 | + - Check Maven Central (may take ~30 minutes) |
| 34 | + |
| 35 | +## Local Testing (Optional) |
| 36 | + |
| 37 | +Test the configuration before releasing: |
| 38 | + |
| 39 | +```bash |
| 40 | +# Validate configuration |
| 41 | +./mvnw jreleaser:config |
| 42 | + |
| 43 | +# Test build with release profile |
| 44 | +./mvnw clean install -Prelease |
| 45 | + |
| 46 | +# Check assembled artifacts |
| 47 | +ls -la target/staging-deploy/ |
| 48 | +``` |
| 49 | + |
| 50 | +## First-Time Setup |
| 51 | + |
| 52 | +### 1. Generate GPG Keys |
| 53 | + |
| 54 | +```bash |
| 55 | +# Generate key |
| 56 | +gpg --gen-key |
| 57 | + |
| 58 | +# Get key ID |
| 59 | +gpg --list-secret-keys --keyid-format=long |
| 60 | + |
| 61 | +# Export keys |
| 62 | +gpg --armor --export YOUR_KEY_ID > public.key |
| 63 | +gpg --armor --export-secret-keys YOUR_KEY_ID > private.key |
| 64 | + |
| 65 | +# Publish to key server |
| 66 | +gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID |
| 67 | +``` |
| 68 | + |
| 69 | +### 2. Register at Maven Central |
| 70 | + |
| 71 | +1. Sign up at https://central.sonatype.com/ |
| 72 | +2. Verify ownership of your namespace (e.g., `org.codejive.tproxy`) |
| 73 | +3. Get username and password/token |
| 74 | + |
| 75 | +### 3. Configure GitHub Secrets |
| 76 | + |
| 77 | +Add these secrets at [Settings → Secrets and variables → Actions](../../settings/secrets/actions): |
| 78 | + |
| 79 | +| Secret Name | Description | How to Get It | |
| 80 | +| ----------- | ----------- | ------------- | |
| 81 | +| `GPG_PUBLIC_KEY` | Your GPG public key | Copy entire contents of `public.key` file | |
| 82 | +| `GPG_SECRET_KEY` | Your GPG private key | Copy entire contents of `private.key` file | |
| 83 | +| `GPG_PASSPHRASE` | Passphrase for your GPG key | The passphrase you entered when generating the key | |
| 84 | +| `MAVENCENTRAL_USERNAME` | Maven Central username | From your Maven Central account token | |
| 85 | +| `MAVENCENTRAL_PASSWORD` | Maven Central password | From your Maven Central account token | |
| 86 | + |
| 87 | +**Note:** The `GITHUB_TOKEN` is automatically provided by GitHub Actions and doesn't need to be configured. |
| 88 | + |
| 89 | +### 4. Optional: Create a Protected Environment |
| 90 | + |
| 91 | +For additional security, you can create a protected environment: |
| 92 | + |
| 93 | +1. Go to Settings → Environments |
| 94 | +2. Click "New environment" |
| 95 | +3. Name it `jreleaser` |
| 96 | +4. Add protection rules: |
| 97 | + - ✅ Required reviewers (recommended for production releases) |
| 98 | + - ✅ Wait timer (optional delay before deployment) |
| 99 | +5. Add the same secrets to this environment |
| 100 | + |
| 101 | +Then uncomment this line in `.github/workflows/release.yml`: |
| 102 | + |
| 103 | +```yaml |
| 104 | +# environment: jreleaser |
| 105 | +``` |
| 106 | + |
| 107 | +## Version Management |
| 108 | + |
| 109 | +- Development versions use `-SNAPSHOT` suffix (e.g., `1.0.0-SNAPSHOT`) |
| 110 | +- Release versions have no suffix (e.g., `1.0.0`) |
| 111 | +- The workflow automatically bumps to next SNAPSHOT after release |
| 112 | +- Use [semantic versioning](https://semver.org/): MAJOR.MINOR.PATCH |
0 commit comments