Skip to content

Commit a213146

Browse files
author
j-zhangyiyuan
committed
fix: Java README version stuck at 1.0.5-01; release sed regex can't match numeric qualifiers
The qualifier group \(-[a-z]...)\ requires qualifiers to start with a letter. Numeric-only qualifiers like \-01\ don't match, so the Maven snippet was never updated past 1.0.5-01. Fix the regex to accept any alphanumeric qualifier start character: \(-[a-zA-Z0-9][a-zA-Z0-9.-]*)\ Also update the stale README versions to 1.0.6 (latest release). Closes #2209
1 parent f324f72 commit a213146

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/java-publish-maven.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ jobs:
200200
run: |
201201
VERSION="${{ steps.versions.outputs.release_version }}"
202202
203-
# Update release version in README.md (supports any version qualifier like -java.N, -java-preview.N, -beta-java.N)
204-
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*</version>|<version>${VERSION}</version>|g" README.md
205-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" README.md
203+
# Update release version in README.md (matches alpha qualifiers like -preview.2 and numeric like -01, but not -SNAPSHOT)
204+
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\|-[0-9][0-9]*\)*</version>|<version>${VERSION}</version>|g" README.md
205+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\|-[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" README.md
206206
207207
# Update snapshot versions in README.md (must run AFTER release version seds
208208
# because the release copilot-sdk-java: pattern partially matches inside snapshot
209209
# strings — the snapshot-specific seds override with the correct DEV_VERSION)
210210
DEV_VERSION="${{ steps.versions.outputs.dev_version }}"
211-
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md
212-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*-SNAPSHOT|copilot-sdk-java:${DEV_VERSION}|g" README.md
211+
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\|-[0-9][0-9]*\)*-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md
212+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\|-[0-9][0-9]*\)*-SNAPSHOT|copilot-sdk-java:${DEV_VERSION}|g" README.md
213213
214214
# Update version in jbang-example.java
215-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" jbang-example.java
215+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\|-[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" jbang-example.java
216216
sed -i 's|copilot-sdk-java:${project\.version}|copilot-sdk-java:'"${VERSION}"'|g' jbang-example.java
217217
218218
# Commit the documentation changes before release:prepare (requires clean working directory)

java/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Replace `${copilot.sdk.version}` with the latest release from Maven Central.
3232
<dependency>
3333
<groupId>com.github</groupId>
3434
<artifactId>copilot-sdk-java</artifactId>
35-
<version>1.0.5-01</version>
35+
<version>1.0.9-preview.3</version>
3636
</dependency>
3737
```
3838

3939
### Gradle
4040

4141
```groovy
42-
implementation 'com.github:copilot-sdk-java:1.0.9-preview.3-01'
42+
implementation 'com.github:copilot-sdk-java:1.0.9-preview.3'
4343
```
4444

4545
#### Snapshot Builds

java/jbang-example.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///usr/bin/env jbang "$0" "$@" ; exit $?
2-
//DEPS com.github:copilot-sdk-java:1.0.9-preview.3-01
2+
//DEPS com.github:copilot-sdk-java:1.0.9-preview.3
33
import com.github.copilot.CopilotClient;
44
import com.github.copilot.generated.AssistantMessageEvent;
55
import com.github.copilot.generated.SessionUsageInfoEvent;

0 commit comments

Comments
 (0)