Skip to content

Commit d51532f

Browse files
chore: release Java SDK 2.0.6 with GitHub Release workflow
Adds .github/workflows/release.yml that runs on v*.*.* tag push, builds the agent jar with sources + javadoc, runs the smoke test, and publishes a GitHub Release with the assets attached. Maven Central publishing continues on the existing Woodpecker pipeline in parallel — the two run independently on tag push. Bumps pom.xml + keploy-sdk/pom.xml to 2.0.6 so the on-disk version matches the v2.0.6 tag this commit will be tagged with.
1 parent 9f23d02 commit d51532f

3 files changed

Lines changed: 100 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release
2+
3+
# Triggers on a v*.*.* tag push and creates a GitHub Release with the
4+
# Keploy Java agent jar attached as a downloadable asset. Maven Central
5+
# publishing happens in parallel via the Woodpecker pipeline at
6+
# .woodpecker/release.yml — this workflow does not touch Central.
7+
8+
on:
9+
push:
10+
tags:
11+
- 'v*.*.*'
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Resolve release version
26+
id: ver
27+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
28+
29+
- name: Set up JDK 17
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: temurin
33+
java-version: '17'
34+
cache: maven
35+
36+
- name: Set release version in poms
37+
run: >-
38+
mvn -B -ntp versions:set
39+
-DnewVersion=${{ steps.ver.outputs.version }}
40+
-DprocessAllModules=true
41+
-DgenerateBackupPoms=false
42+
43+
- name: Build agent jar with sources and javadoc
44+
# `release` profile attaches the source jar; the inner pom always
45+
# attaches the javadoc jar. -Dgpg.skip=true keeps the signing step
46+
# in the release profile inert (signing happens on Woodpecker
47+
# where the GPG key is wired up).
48+
run: mvn -B -ntp -P release -DskipTests -Dgpg.skip=true clean verify
49+
50+
- name: Smoke test java agent
51+
run: ./scripts/smoke-javaagent.sh
52+
53+
- name: Stage release assets
54+
run: |
55+
set -euxo pipefail
56+
version="${{ steps.ver.outputs.version }}"
57+
mkdir -p release-assets
58+
cp "keploy-sdk/target/keploy-sdk-${version}.jar" "release-assets/keploy-sdk-${version}.jar"
59+
cp "keploy-sdk/target/keploy-sdk-${version}.jar" "release-assets/keploy-sdk.jar"
60+
if [[ -f "keploy-sdk/target/keploy-sdk-${version}-sources.jar" ]]; then
61+
cp "keploy-sdk/target/keploy-sdk-${version}-sources.jar" "release-assets/"
62+
fi
63+
if [[ -f "keploy-sdk/target/keploy-sdk-${version}-javadoc.jar" ]]; then
64+
cp "keploy-sdk/target/keploy-sdk-${version}-javadoc.jar" "release-assets/"
65+
fi
66+
cp "keploy-sdk/pom.xml" "release-assets/keploy-sdk-${version}.pom"
67+
ls -la release-assets/
68+
69+
- name: Publish GitHub Release
70+
env:
71+
GITHUB_TOKEN: ${{ github.token }}
72+
TAG: ${{ github.ref_name }}
73+
run: |
74+
set -euxo pipefail
75+
# Pre-release flag: anything with a hyphen suffix (e.g. v2.0.6-rc1)
76+
prerelease_flag=()
77+
if [[ "$TAG" == *-* ]]; then
78+
prerelease_flag=(--prerelease)
79+
fi
80+
# Idempotent publish: if a previous run already created the
81+
# release record, --clobber overwrites partial assets so a
82+
# rerun ends in the same state either way.
83+
if gh release view "$TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then
84+
echo "Release $TAG already exists — uploading assets with --clobber"
85+
gh release upload "$TAG" \
86+
--repo "${{ github.repository }}" \
87+
--clobber \
88+
release-assets/*
89+
else
90+
gh release create "$TAG" \
91+
--repo "${{ github.repository }}" \
92+
--title "Java SDK $TAG" \
93+
--target "${{ github.sha }}" \
94+
--generate-notes \
95+
"${prerelease_flag[@]}" \
96+
release-assets/*
97+
fi

‎keploy-sdk/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<artifactId>java-sdk</artifactId>
99
<groupId>io.keploy</groupId>
10-
<version>2.0.5</version>
10+
<version>2.0.6</version>
1111
</parent>
1212

1313
<artifactId>keploy-sdk</artifactId>
14-
<version>2.0.5</version>
14+
<version>2.0.6</version>
1515
<name>Keploy Java Coverage Agent</name>
1616
<description>Java dynamic dedup coverage agent for Keploy Enterprise</description>
1717
<url>https://github.com/keploy/java-sdk</url>

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.keploy</groupId>
88
<artifactId>java-sdk</artifactId>
9-
<version>2.0.5</version>
9+
<version>2.0.6</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Keploy Java Coverage Agent</name>

0 commit comments

Comments
 (0)