Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Java Release

# Publishes com.volcengine:ark-runtime to Maven Central. Tags are created
# exclusively by ark-hand after a sync PR lands on main, so a pushed v* tag
# is always a reviewed release snapshot whose tree matches the internal
# source tree. Mirrors the proven setup from volcengine/volcengine-java-sdk:
# the `public` profile in pom.xml wires maven-javadoc/gpg and the
# central-publishing-maven-plugin (tokenAuth, autoPublish); this workflow
# only injects the Central token and the GPG signing key.
#
# The workflow_dispatch input allows re-publishing (or first-publishing) an
# existing tag — e.g. when secrets were still missing when the tag was
# originally pushed.
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag to publish (must already exist, e.g. v0.3.0)"
required: true
type: string

permissions:
contents: read

# Never cancel an in-flight publish; a second dispatch for the same tag
# should queue behind it instead of racing the upload.
concurrency:
group: java-release-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
cancel-in-progress: false

jobs:
release:
name: Build and publish to Maven Central
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Resolve release tag
id: tag
env:
DISPATCH_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }}
run: |
tag="${DISPATCH_TAG:-${GITHUB_REF_NAME}}"
case "${tag}" in
v[0-9]*.[0-9]*.0) ;;
*)
echo "::error::${tag} is not a release tag (expected vMAJOR.MINOR.0)"
exit 1
;;
esac
echo "name=${tag}" >> "$GITHUB_OUTPUT"

- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ steps.tag.outputs.name }}

- name: Verify pom version matches tag
env:
RELEASE_TAG: ${{ steps.tag.outputs.name }}
run: |
version="${RELEASE_TAG#v}"
actual=$(python3 -c "
import re
m = re.search(r'<artifactId>ark-runtime</artifactId>\s*<version>([^<]+)</version>', open('pom.xml').read())
print(m.group(1) if m else 'missing')
")
if [ "${actual}" != "${version}" ]; then
echo "::error::pom.xml ark-runtime version ${actual} does not match tag ${RELEASE_TAG}"
exit 1
fi

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "temurin"
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Check Maven Central version
id: maven_check
env:
RELEASE_TAG: ${{ steps.tag.outputs.name }}
run: |
version="${RELEASE_TAG#v}"
pom_url="https://repo.maven.apache.org/maven2/com/volcengine/ark-runtime/${version}/ark-runtime-${version}.pom"
code=$(curl -sS -o /dev/null -w '%{http_code}' "${pom_url}")
echo "publish_needed=$([ "${code}" = "200" ] && echo false || echo true)" >> "$GITHUB_OUTPUT"

- name: Check publish credentials
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
missing=""
[ -z "${OSSRH_USERNAME}" ] && missing="${missing} OSSRH_USERNAME"
[ -z "${OSSRH_TOKEN}" ] && missing="${missing} OSSRH_TOKEN"
[ -z "${GPG_PRIVATE_KEY}" ] && missing="${missing} GPG_PRIVATE_KEY"
[ -z "${GPG_PASSPHRASE}" ] && missing="${missing} GPG_PASSPHRASE"
if [ -n "${missing}" ]; then
echo "::error::missing repository secrets:${missing}"
exit 1
fi

- name: Publish to Maven Central
if: steps.maven_check.outputs.publish_needed == 'true'
run: |
mvn clean deploy -B -Ppublic -DskipTests \
-Dmaven.javadoc.failOnError=false \
-Dmaven.javadoc.quiet=true
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ automatic retry logic.
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
</dependency>
```

### Gradle

```groovy
implementation 'com.volcengine:ark-runtime:0.2.0'
implementation 'com.volcengine:ark-runtime:0.3.0'
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.3.0
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<packaging>jar</packaging>

<name>ark-runtime</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
// SPDX-License-Identifier: Apache-2.0

/*
* Ark Messages API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.volcengine.ark.runtime.models.messages;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.Objects;

/**
* ContentBlockStart
*/
@JsonPropertyOrder({
ContentBlockStart.JSON_PROPERTY_TYPE,
ContentBlockStart.JSON_PROPERTY_INDEX,
ContentBlockStart.JSON_PROPERTY_CONTENT_BLOCK
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
public class ContentBlockStart implements MessagesStreamEvent {
public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nonnull
private MessagesStreamEventType type = MessagesStreamEventType.CONTENT_BLOCK_START;

public static final String JSON_PROPERTY_INDEX = "index";
@javax.annotation.Nonnull
private Integer index;

public static final String JSON_PROPERTY_CONTENT_BLOCK = "content_block";
@javax.annotation.Nonnull
private ContentBlockStartContentBlock contentBlock;

public ContentBlockStart() {
}

public ContentBlockStart type(@javax.annotation.Nonnull MessagesStreamEventType type) {

this.type = type;
return this;
}

/**
* Get type
* @return type
*/
@javax.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_TYPE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public MessagesStreamEventType getType() {
return type;
}


@JsonProperty(value = JSON_PROPERTY_TYPE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) {
this.type = type;
}

public ContentBlockStart index(@javax.annotation.Nonnull Integer index) {

this.index = index;
return this;
}

/**
* Get index
* @return index
*/
@javax.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_INDEX, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public Integer getIndex() {
return index;
}


@JsonProperty(value = JSON_PROPERTY_INDEX, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setIndex(@javax.annotation.Nonnull Integer index) {
this.index = index;
}

public ContentBlockStart contentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) {

this.contentBlock = contentBlock;
return this;
}

/**
* Get contentBlock
* @return contentBlock
*/
@javax.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public ContentBlockStartContentBlock getContentBlock() {
return contentBlock;
}


@JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setContentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) {
this.contentBlock = contentBlock;
}


@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContentBlockStart contentBlockStart = (ContentBlockStart) o;
return Objects.equals(this.type, contentBlockStart.type) &&
Objects.equals(this.index, contentBlockStart.index) &&
Objects.equals(this.contentBlock, contentBlockStart.contentBlock);
}

@Override
public int hashCode() {
return Objects.hash(type, index, contentBlock);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContentBlockStart {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" index: ").append(toIndentedString(index)).append("\n");
sb.append(" contentBlock: ").append(toIndentedString(contentBlock)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
return o == null ? "null" : o.toString().replace("\n", "\n ");
}

public static class Builder {

private ContentBlockStart instance;

public Builder() {
this(new ContentBlockStart());
}

protected Builder(ContentBlockStart instance) {
this.instance = instance;
}

public ContentBlockStart.Builder type(MessagesStreamEventType type) {
this.instance.type = type;
return this;
}
public ContentBlockStart.Builder index(Integer index) {
this.instance.index = index;
return this;
}
public ContentBlockStart.Builder contentBlock(ContentBlockStartContentBlock contentBlock) {
this.instance.contentBlock = contentBlock;
return this;
}


/**
* returns a built ContentBlockStart instance.
*
* The builder is not reusable.
*/
public ContentBlockStart build() {
try {
return this.instance;
} finally {
// ensure that this.instance is not reused
this.instance = null;
}
}

@Override
public String toString() {
return getClass() + "=(" + instance + ")";
}
}

/**
* Create a builder with no initialized field.
*/
public static ContentBlockStart.Builder builder() {
return new ContentBlockStart.Builder();
}

/**
* Create a builder with a shallow copy of this instance.
*/
public ContentBlockStart.Builder toBuilder() {
return new ContentBlockStart.Builder()
.type(getType())
.index(getIndex())
.contentBlock(getContentBlock());
}


}
Loading
Loading