|
| 1 | +# Coinbase Prime Java SDK — Deploy |
| 2 | + |
| 3 | +Canonical repository: [coinbase/prime-sdk-java](https://github.com/coinbase/prime-sdk-java). |
| 4 | + |
| 5 | +This project publishes through the [Sonatype Central Portal](https://central.sonatype.org/publish/publish-portal-maven/) (`central-publishing-maven-plugin` with server id `central`). |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- JDK 11+ |
| 10 | +- Maven 3.8+ |
| 11 | +- GPG key configured (`gpg.keyname` in Maven settings or `pom.xml` properties) |
| 12 | +- Sonatype Central user token ([generate in the portal](https://central.sonatype.com/account); use server id `central` in `~/.m2/settings.xml`) |
| 13 | + |
| 14 | +## Publish with GitHub Actions |
| 15 | + |
| 16 | +Creating a [GitHub Release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) runs [`.github/workflows/publish.yml`](.github/workflows/publish.yml). You can also run the workflow manually from **Actions → publish → Run workflow**, providing the release tag (for example `v1.9.0`). |
| 17 | + |
| 18 | +The workflow checks out the release tag, aligns `pom.xml` version with the tag (for example `v1.9.0` → `1.9.0`), runs Spotless and tests, then runs `mvn clean deploy`. |
| 19 | + |
| 20 | +### Trigger manually from the CLI |
| 21 | + |
| 22 | +Use the [GitHub CLI](https://cli.github.com/) (`gh auth login` if needed). From a clone of this repo: |
| 23 | + |
| 24 | +```bash |
| 25 | +gh workflow run publish -f tag=v1.9.0 |
| 26 | +``` |
| 27 | + |
| 28 | +From another directory, pass the repository explicitly: |
| 29 | + |
| 30 | +```bash |
| 31 | +gh workflow run publish --repo coinbase/prime-sdk-java -f tag=v1.9.0 |
| 32 | +``` |
| 33 | + |
| 34 | +Watch the latest run or list recent publish runs: |
| 35 | + |
| 36 | +```bash |
| 37 | +gh run watch |
| 38 | +gh run list --workflow=publish |
| 39 | +``` |
| 40 | + |
| 41 | +### Release environment secrets |
| 42 | + |
| 43 | +Configure these under **Settings → Environments → release → Environment secrets** (the publish job uses the `release` environment): |
| 44 | + |
| 45 | +| Secret | Description | |
| 46 | +|--------|-------------| |
| 47 | +| `MAVEN_CENTRAL_USERNAME` | Sonatype Central token username | |
| 48 | +| `MAVEN_CENTRAL_TOKEN` | Sonatype Central token password | |
| 49 | +| `MAVEN_GPG_PRIVATE_KEY` | ASCII-armored GPG secret key (`gpg --armor --export-secret-keys KEY_ID`) | |
| 50 | +| `MAVEN_GPG_PASSPHRASE` | Passphrase for that key | |
| 51 | +| `MAVEN_GPG_KEY_ID` | GPG key id used by `maven-gpg-plugin` (`gpg.keyname`) | |
| 52 | + |
| 53 | +### Release checklist |
| 54 | + |
| 55 | +1. Bump `<version>` on `main` (or rely on the workflow to set it from the tag). |
| 56 | +2. Create and push an annotated tag: `git tag v1.9.0 && git push origin v1.9.0` |
| 57 | +3. Create a GitHub Release for that tag (event type **created** triggers publish). |
| 58 | +4. Confirm the workflow succeeded and the artifact appears on [Maven Central](https://central.sonatype.com/artifact/com.coinbase.prime/coinbase-prime-sdk-java). |
0 commit comments