Skip to content
Open
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
61 changes: 26 additions & 35 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Build & Publish on Schema Change
name: Build & Publish Java Package

on:
push:
branches:
- main
paths:
- "schemas/**"
- "java/**"
- "java/pom.xml"
workflow_dispatch:

jobs:
Expand All @@ -25,6 +23,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v4
Expand All @@ -50,36 +50,29 @@ jobs:
</settings>
EOF

- name: Read Schema Version
id: schema
- name: Read Version
id: version
run: |
SCHEMA_VERSION=$(cat ../schemas/VERSION | tr -d '\n')
echo "Using schema version: $SCHEMA_VERSION"
echo "schema_version=$SCHEMA_VERSION" >> $GITHUB_OUTPUT
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "value=$VERSION" >> $GITHUB_OUTPUT

- name: Read Implementation Version
id: impl
- name: Generate Changelog
id: changelog
run: |
IMPL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Using implementation version: $IMPL_VERSION"
echo "impl_version=$IMPL_VERSION" >> $GITHUB_OUTPUT

- name: Create Combined Version
id: version
run: |
COMBINED_VERSION="${{ steps.impl.outputs.impl_version }}-schema-${{ steps.schema.outputs.schema_version }}"
echo "Using combined version: $COMBINED_VERSION"
echo "combined_version=$COMBINED_VERSION" >> $GITHUB_OUTPUT
TAG="java-v${{ steps.version.outputs.value }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
LOG=$(git log "$TAG"..HEAD --oneline -- ../java)
else
LOG=$(git log --oneline -20 -- ../java)
fi
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "body<<$EOF" >> $GITHUB_OUTPUT
echo "$LOG" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

- name: Build with Maven
run: mvn clean package

- name: Rename Artifacts for GitHub Release
run: |
mv target/pacts-${{ steps.impl.outputs.impl_version }}.jar target/pacts-${{ steps.version.outputs.combined_version }}.jar
mv target/pacts-${{ steps.impl.outputs.impl_version }}-sources.jar target/pacts-${{ steps.version.outputs.combined_version }}-sources.jar
mv target/pacts-${{ steps.impl.outputs.impl_version }}-javadoc.jar target/pacts-${{ steps.version.outputs.combined_version }}-javadoc.jar

- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -89,17 +82,15 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: java-v${{ steps.version.outputs.combined_version }}
name: Java Package v${{ steps.version.outputs.combined_version }}
tag_name: java-v${{ steps.version.outputs.value }}
name: Java v${{ steps.version.outputs.value }}
body: |
Java package release for version ${{ steps.version.outputs.combined_version }}
## Java Package v${{ steps.version.outputs.value }}

Changes:
- Implementation version: ${{ steps.impl.outputs.impl_version }}
- Schema version: ${{ steps.schema.outputs.schema_version }}
${{ steps.changelog.outputs.body }}
files: |
java/target/pacts-${{ steps.version.outputs.combined_version }}.jar
java/target/pacts-${{ steps.version.outputs.combined_version }}-sources.jar
java/target/pacts-${{ steps.version.outputs.combined_version }}-javadoc.jar
java/target/pacts-${{ steps.version.outputs.value }}.jar
java/target/pacts-${{ steps.version.outputs.value }}-sources.jar
java/target/pacts-${{ steps.version.outputs.value }}-javadoc.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 24 additions & 31 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:
branches:
- main
paths:
- "schemas/**"
- "rust/**"
- "rust/Cargo.toml"
workflow_dispatch:

jobs:
Expand All @@ -24,6 +22,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Rust
uses: dtolnay/rust-toolchain@v1
Expand All @@ -41,49 +41,42 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-

- name: Read Schema Version
id: schema
- name: Read Version
id: version
run: |
SCHEMA_VERSION=$(cat ../schemas/VERSION | tr -d '\n')
echo "Using schema version: $SCHEMA_VERSION"
echo "schema_version=$SCHEMA_VERSION" >> $GITHUB_OUTPUT
VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "value=$VERSION" >> $GITHUB_OUTPUT

- name: Read Implementation Version
id: impl
- name: Generate Changelog
id: changelog
run: |
IMPL_VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "Using implementation version: $IMPL_VERSION"
echo "impl_version=$IMPL_VERSION" >> $GITHUB_OUTPUT

- name: Create Combined Version
id: version
run: |
COMBINED_VERSION="${{ steps.impl.outputs.impl_version }}+schema.${{ steps.schema.outputs.schema_version }}"
echo "Using combined version: $COMBINED_VERSION"
echo "combined_version=$COMBINED_VERSION" >> $GITHUB_OUTPUT
TAG="rust-v${{ steps.version.outputs.value }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
LOG=$(git log "$TAG"..HEAD --oneline -- ../rust)
else
LOG=$(git log --oneline -20 -- ../rust)
fi
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "body<<$EOF" >> $GITHUB_OUTPUT
echo "$LOG" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

- name: Build
run: cargo build --release

- name: Run tests
- name: Run Tests
run: cargo test

- name: Rename staticlib for GitHub Release
run: |
cp target/release/libpacts.a target/release/libpacts-${{ steps.version.outputs.combined_version }}.a

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: rust-v${{ steps.version.outputs.combined_version }}
name: Rust Crate v${{ steps.version.outputs.combined_version }}
tag_name: rust-v${{ steps.version.outputs.value }}
name: Rust v${{ steps.version.outputs.value }}
body: |
Rust crate release for version ${{ steps.version.outputs.combined_version }}
## Rust Crate v${{ steps.version.outputs.value }}

Changes:
- Implementation version: ${{ steps.impl.outputs.impl_version }}
- Schema version: ${{ steps.schema.outputs.schema_version }}
${{ steps.changelog.outputs.body }}
files: |
rust/target/release/libpacts-${{ steps.version.outputs.combined_version }}.a
rust/target/release/libpacts.a
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 11 additions & 22 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>net.hydrius</groupId>
<artifactId>pacts</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The PR description says this is a minor version bump, but the pom.xml change is a patch bump (1.0.1). Please confirm intent and update either the version or the PR description to avoid release confusion.

(Based on your team's feedback about handling PR description/version mismatches without assuming which is correct.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At java/pom.xml, line 8:

<comment>The PR description says this is a minor version bump, but the pom.xml change is a patch bump (1.0.1). Please confirm intent and update either the version or the PR description to avoid release confusion.

(Based on your team's feedback about handling PR description/version mismatches without assuming which is correct.) </comment>

<file context>
@@ -5,7 +5,7 @@
     <groupId>net.hydrius</groupId>
     <artifactId>pacts</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1</version>
     <packaging>jar</packaging>
 
</file context>
Fix with Cubic

<packaging>jar</packaging>

<name>Pacts</name>
Expand All @@ -16,26 +16,6 @@
</properties>

<build>
<resources>
<resource>
<directory>${project.basedir}/../schemas</directory>
<targetPath>schemas</targetPath>
<includes>
<include>**/*.json</include>
<include>VERSION</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>${project.basedir}/../schemas</directory>
<targetPath>schemas</targetPath>
<includes>
<include>**/*.json</include>
<include>VERSION</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -88,6 +68,11 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
</plugin>
</plugins>
</build>

Expand All @@ -96,7 +81,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.21.3</version>
<version>2.0.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -132,6 +117,10 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Loading