Overview
Polymart is a marketplace for Minecraft resources, including plugins, mods, and other server tools. MCReleaser integrates with Polymart’s API to automate the release process, handling both metadata updates and file uploads.
The platform converts your markdown descriptions to HTML and supports three release tags (release, beta, snapshot) to categorize your updates.
Required Credentials
To publish to Polymart, you need:
- Polymart API Key: An API key from your Polymart account
- Resource ID: The numeric ID of your resource on Polymart
Find your API key in your Polymart account settings. The resource ID can be found in your resource’s URL:
https://polymart.org/resource/[resource-id]
Configuration Options
The Polymart API key for authentication.-e POLYMART_KEY="your_api_key_here"
The numeric resource ID of your Polymart resource.Example: 12345-e POLYMART_RESOURCE="12345"
The release tag for this update. This affects how the version is displayed and categorized on Polymart.Valid values:
release - Stable release version
beta - Beta testing version
snapshot - Development snapshot
-e POLYMART_TAG="release"
Implementation Details
The Polymart platform implementation performs a two-step upload process:
-
Post Update: Sends metadata to Polymart’s
doPostUpdate endpoint:
- API key and resource ID
- Version number and tag
- Update title (from
NAME)
- Update description (markdown converted to HTML)
- File name
- Returns an S3 upload URL and fields
-
File Upload: Uses the S3 upload URL to upload the actual file:
- Constructs a multipart form with the provided fields
- Uploads the primary file from your bundle
Polymart uses Amazon S3 for file storage. The API provides a pre-signed upload URL that MCReleaser uses to upload your file directly to S3.
Polymart only supports uploading a single file per version. MCReleaser will use the primary file from your bundle.
Markdown Conversion
MCReleaser automatically converts your markdown description to HTML for Polymart compatibility. This means you can write your changelogs in markdown format:
## What's New in 2.0.0
### Features
- Added new economy system
- Improved performance by 50%
### Bug Fixes
- Fixed balance sync issues
- Resolved crash on startup
This will be automatically converted to properly formatted HTML for display on Polymart.
Complete Example
java \
-Dname="BetterEconomy v2.0.0" \
-Dversion="2.0.0" \
-Ddescription="## What's New\n\n- Added vault support\n- Fixed balance commands" \
-DpolymartKey="your_api_key_here" \
-DpolymartResource="12345" \
-DpolymartTag="release" \
-jar mcreleaser.jar
Beta and Snapshot Releases
You can publish beta or snapshot versions by changing the tag:
# Beta release
docker run \
-v $(pwd)/build/libs:/app/artifacts \
-e NAME="BetterEconomy v2.1.0-beta" \
-e VERSION="2.1.0-beta" \
-e DESCRIPTION="Beta version with experimental features" \
-e POLYMART_KEY="$POLYMART_KEY" \
-e POLYMART_RESOURCE="12345" \
-e POLYMART_TAG="beta" \
ghcr.io/hsgamer/mcreleaser:master
# Snapshot release
docker run \
-v $(pwd)/build/libs:/app/artifacts \
-e NAME="BetterEconomy Snapshot" \
-e VERSION="2.2.0-SNAPSHOT" \
-e DESCRIPTION="Development snapshot - use at your own risk!" \
-e POLYMART_KEY="$POLYMART_KEY" \
-e POLYMART_RESOURCE="12345" \
-e POLYMART_TAG="snapshot" \
ghcr.io/hsgamer/mcreleaser:master
Source Code Reference
The Polymart platform implementation can be found in:
- Platform logic:
polymart/src/main/java/me/hsgamer/mcreleaser/polymart/PolymartPlatform.java
- Configuration keys:
polymart/src/main/java/me/hsgamer/mcreleaser/polymart/PolymartPropertyKey.java
Key Implementation Features
// Markdown to HTML conversion
String description = CommonPropertyKey.DESCRIPTION.getValue();
String textDescription = MarkdownToHTMLConverter.convert(description);
// Post update request
Map<String, String> jsonBody = new HashMap<>();
jsonBody.put("api_key", PolymartPropertyKey.KEY.getValue());
jsonBody.put("product", PolymartPropertyKey.RESOURCE.getValue());
jsonBody.put("version", CommonPropertyKey.VERSION.getValue());
jsonBody.put("file_name", fileBundle.primaryFile().getName());
jsonBody.put("tag", PolymartPropertyKey.TAG.getValue("release"));
jsonBody.put("update_title", CommonPropertyKey.NAME.getValue());
jsonBody.put("update_description", textDescription);
// Parse S3 upload URL from response
JsonObject responseNode = JsonParser.parseString(responseBody).getAsJsonObject();
JsonObject uploadNode = responseNode.getAsJsonObject("response").getAsJsonObject("upload");
String uploadUrl = uploadNode.get("url").getAsString();
JsonObject fieldsNode = uploadNode.getAsJsonObject("fields");
// Upload to S3 with provided fields
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
fieldsNode.entrySet().forEach(entry -> {
builder.addTextBody(entry.getKey(), entry.getValue().getAsString());
});
builder.addBinaryBody("file", fileBundle.primaryFile());
API Endpoints
Polymart uses the following API endpoints:
- Post Update:
https://api.polymart.org/v1/doPostUpdate
- Creates the update metadata and returns S3 upload credentials
- File Upload: S3 URL provided in the response
- Direct upload to Amazon S3 storage