Skip to content

Latest commit

 

History

History
112 lines (91 loc) · 5.8 KB

API_RELEASE.md

File metadata and controls

112 lines (91 loc) · 5.8 KB

Dominion API releases

The API build and Maven Central release workflow in .github/workflows/release.yml runs in LunaDeerMC/DominionAPI and publishes cn.lunadeer:DominionAPI to Maven Central. The workflow, source, version, signing configuration and Repository Secrets all belong to this independent API repository. It does not check out, build or deploy the Dominion plugin or its documentation submodule. The Dominion plugin repository keeps its existing release workflow.

Source and version

gradle.properties is the API release version source. The next prepared release is 4.9.7. API versions are independent of the plugin version. Version 4.9.6 already exists on Maven Central and must not be uploaded again.

The prepared 4.9.7 release also brings existing API master changes to Central; it is not limited to publication tooling. It adds flags for firework entity damage, automatic Nether portals, end-crystal placement and four cushion protections (placement, breaking, monster damage and environmental destruction). Flags.getAll* includes 18 legacy aliases and returns immutable snapshots. Legacy setDefaultValue/setEnable calls throw IllegalArgumentException, FlagGroup rejects legacy flags and duplicate flag-name registration is rejected. Use a matching Dominion runtime that implements the new flags, and review callers that mutate enumeration results or legacy flags when upgrading. Existing public classes, methods and fields have not been removed.

Before releasing, commit and push API source/version changes to this repository's master branch. Each run checks out its triggering commit exactly. A publishing commit must belong to upstream master; the workflow never builds a later branch revision in place of the verified commit. Java 21 runs this repository's Gradle wrapper, and Java 17 compiles the API. The existing PR check and JavaDoc workflows remain available independently.

Repository Secrets

Configure these Secrets on LunaDeerMC/DominionAPI:

Repository Secret Value
MAVEN_CENTRAL_USERNAME Username generated as part of the Central Portal User Token
MAVEN_CENTRAL_PASSWORD Password generated as part of that User Token
SIGNING_PRIVATE_KEY Complete ASCII-armored Dominion API signing private key, including its BEGIN/END lines
SIGNING_PASSWORD Passphrase protecting that private key

The dedicated public verification key is tools/publishing/dominion-api-signing.asc, with fingerprint 969B0B3535BB5FC004EAFB46B12BAD12810B632B. Only the public key is committed. Signing uses the private key in memory during one step; the publishing job disables Gradle caches and does not upload private keys, credentials or keyrings. The Central token is available only to the upload step.

Triggers

Trigger Result
Push to API master Verify the API and publishing helper; no Central upload
Pull request targeting master The same verification without publishing Secrets
Push v<version> tag to DominionAPI Verify, sign and publish the API
Manual workflow with publish unchecked Verify only
Manual workflow on master with publish checked Verify, sign and publish the version in that commit

A release tag must exactly match v plus gradle.properties's version, for example v4.9.7. Push this tag to DominionAPI, not to the Dominion plugin repository. Snapshot versions, publication from forks and manual publication from other branches are rejected.

Verification builds the API binary, source and Javadoc JARs, checks the publication coordinate, compiles an independent consumer against the staged API and executes the publishing helper's offline failure/recovery tests. The signing stage uses:

./gradlew --no-daemon --no-configuration-cache --no-build-cache \
  -Papi_signing=true stageApiForCentral

This stages files under build/central-staging. The helper verifies the allowed coordinate, complete artifacts, metadata, signatures and checksums, then writes build/central/DominionAPI-<version>.zip. It uploads to Central Portal, waits for publication and checks anonymous downloads from Maven Central. After publication, the independent consumer is compiled again using Maven Central instead of the local staging repository. A successful Gradle build alone is not evidence that the version was published.

Results and interrupted publications

The Actions run retains API verification artifacts for 14 days. The publishing job retains the signed Central ZIP and deployment.json in an artifact named dominion-api-central-<version>-<attempt> for 30 days, including after a failed upload or status check. These Actions artifacts follow the repository's access permissions; they are not plugin releases or a replacement for Maven Central.

The publishing helper writes its receipt before polling a known deployment and does not blindly retry an upload with an uncertain result. A GitHub Re-run starts a fresh runner without that receipt, so the publishing job deliberately stops before signing or uploading when GITHUB_RUN_ATTEMPT exceeds 1. Verification jobs may still be rerun.

If the receipt contains a deployment ID, download it and resume status checks with the same Central token configured in the environment:

python3 tools/publishing/central.py resume \
  --receipt /private/path/deployment.json --timeout-seconds 1800

This resumes the existing deployment rather than uploading another one. If the receipt is absent or reports an unknown upload result, inspect Central Portal first. Start a new manual publishing run only after establishing that no prior deployment can still publish that version. A published Central version is immutable; fixes require a new API version.