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
20 changes: 10 additions & 10 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ jobs:
exit 1
fi
else
# Split version: supports both "0.1.32" and "0.1.32-java.0" formats
# Split version: supports "0.1.32", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
# Validate RELEASE_VERSION format explicitly to provide clear errors
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-java\.[0-9]+)?$'; then
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P or M.M.P-java.N (e.g., 1.2.3 or 1.2.3-java.0)." >&2
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-java(-preview)?\.[0-9]+)?$'; then
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-java.N, or M.M.P-java-preview.N (e.g., 1.2.3, 1.2.3-java.0, or 1.2.3-java-preview.0)." >&2
exit 1
fi
# Extract the base M.M.P portion (before any qualifier)
Expand Down Expand Up @@ -121,21 +121,21 @@ jobs:
# Update CHANGELOG.md with release version and Reference implementation sync hash
./.github/scripts/release/update-changelog.sh "${VERSION}" "${REFERENCE_IMPL_HASH}"

# Update version in README.md (supports versions like 1.0.0 and 0.1.32-java.0)
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}</version>|<version>${VERSION}</version>|g" README.md
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" README.md
# Update version in README.md (supports versions like 1.0.0, 0.1.32-java.0, and 0.3.0-java-preview.0)
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}</version>|<version>${VERSION}</version>|g" README.md
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" README.md

# Update snapshot version in README.md
DEV_VERSION="${{ steps.versions.outputs.dev_version }}"
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md

# Update version in jbang-example.java
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" jbang-example.java
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" jbang-example.java
sed -i 's|copilot-sdk-java:${project\.version}|copilot-sdk-java:'"${VERSION}"'|g' jbang-example.java

# Update version in cookbook files (hardcoded for direct GitHub browsing and JBang usage)
find src/site/markdown/cookbook -name "*.md" -type f -exec \
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" {} \;
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" {} \;

# Commit the documentation changes before release:prepare (requires clean working directory)
git add CHANGELOG.md README.md jbang-example.java src/site/markdown/cookbook/
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:

# Get the previous tag for generating notes
PREV_TAG=$(git tag --list 'v*' --sort=-version:refname \
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-java\.[0-9]+)?$' \
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-java(-preview)?\.[0-9]+)?$' \
| grep -Fxv "${CURRENT_TAG}" \
| head -n 1)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Java SDK for programmatic control of GitHub Copilot CLI, enabling you to build A
<dependency>
<groupId>com.github</groupId>
<artifactId>copilot-sdk-java</artifactId>
<version>0.3.0-java-preview.0</version>
<version>0.3.0-java-preview.1</version>
</dependency>
```

Expand All @@ -60,7 +60,7 @@ Snapshot builds of the next development version are published to Maven Central S
### Gradle

```groovy
implementation 'com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0'
implementation 'com.github:copilot-sdk-java:0.3.0-java-preview.1'
```

## Quick Start
Expand Down
2 changes: 1 addition & 1 deletion jbang-example.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.generated.SessionUsageInfoEvent;
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/cookbook/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang BasicErrorHandling.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class BasicErrorHandling {
## Handling specific error types

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import java.util.concurrent.ExecutionException;

Expand Down Expand Up @@ -99,7 +99,7 @@ public class SpecificErrorHandling {
## Timeout handling

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotSession;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -130,7 +130,7 @@ public class TimeoutHandling {
## Aborting a request

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotSession;
import com.github.copilot.sdk.json.MessageOptions;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -162,7 +162,7 @@ public class AbortRequest {
## Graceful shutdown

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;

public class GracefulShutdown {
Expand Down Expand Up @@ -192,7 +192,7 @@ public class GracefulShutdown {
## Try-with-resources pattern

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -224,7 +224,7 @@ public class TryWithResources {
## Handling tool errors

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/cookbook/managing-local-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jbang ManagingLocalFiles.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.generated.SessionIdleEvent;
Expand Down Expand Up @@ -161,7 +161,7 @@ session.send(new MessageOptions().setPrompt(prompt));
## Interactive file organization

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import java.io.BufferedReader;
import java.io.InputStreamReader;

Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/cookbook/multiple-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang MultipleSessions.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -123,7 +123,7 @@ try {
## Managing session lifecycle with CompletableFuture

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import java.util.concurrent.CompletableFuture;
import java.util.List;

Expand Down
6 changes: 3 additions & 3 deletions src/site/markdown/cookbook/persisting-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang PersistingSessions.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -127,7 +127,7 @@ public class DeleteSession {
## Getting session history

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.generated.UserMessageEvent;
Expand Down Expand Up @@ -162,7 +162,7 @@ public class SessionHistory {
## Complete example with session management

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import java.util.Scanner;

public class SessionManager {
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/cookbook/pr-visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jbang PRVisualization.java github/copilot-sdk
## Full example: PRVisualization.java

```java
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1-java-preview.0
//DEPS com.github:copilot-sdk-java:0.3.0-java-preview.1
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.generated.AssistantMessageEvent;
import com.github.copilot.sdk.generated.ToolExecutionStartEvent;
Expand Down
Loading