Skip to content

Add printVersion task to fix CI workflow failure - #5

Merged
jona7o merged 4 commits into
mainfrom
copilot/add-print-version-task
Oct 18, 2025
Merged

jona7o merged 4 commits into
mainfrom
copilot/add-print-version-task

Conversation

Copilot AI commented Oct 18, 2025 •

Copy link
Copy Markdown

The CI workflow was failing with a "Task 'printVersion' not found" error because the build.gradle file was missing the required task that the publish job depends on for version extraction.

Problem

The CI workflow's publish job includes this step:

- name: Extract version
  id: version
  run: |
    VERSION=$(./gradlew -q printVersion --console=plain)
    echo "version=$VERSION" >> $GITHUB_OUTPUT

However, the printVersion task didn't exist in build.gradle, causing the workflow to fail with:

FAILURE: Build failed with an exception.
* What went wrong:
Task 'printVersion' not found in root project 'smithy-mcp'.

Solution

Added a simple Gradle task that prints the project version to stdout:

// Task to print project version (used by CI)
task printVersion {
    doLast {
        println project.version
    }
    description 'Prints the project version'
    group 'help'
}

Testing

The task works correctly with the CI command:

$ ./gradlew -q printVersion --console=plain
1.0.0

This allows the CI to successfully capture the version for creating releases. The task is properly categorized in the "help" group and appears in the task listing for discoverability.

Original prompt

The CI workflow is failing because it's trying to execute a printVersion task that doesn't exist in the build.gradle file. The error shows:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'printVersion' not found in root project 'smithy-mcp'.

Add a printVersion task to the build.gradle file that outputs the project version. This task should:

  1. Print the project version to stdout when executed
  2. Be compatible with the CI workflow command: ./gradlew -q printVersion --console=plain
  3. Allow the CI to capture the version in the VERSION variable

The current project version is set to '1.0.0' in build.gradle line 7.

This pull request was created as a result of the following prompt from Copilot chat.

The CI workflow is failing because it's trying to execute a printVersion task that doesn't exist in the build.gradle file. The error shows:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'printVersion' not found in root project 'smithy-mcp'.

Add a printVersion task to the build.gradle file that outputs the project version. This task should:

  1. Print the project version to stdout when executed
  2. Be compatible with the CI workflow command: ./gradlew -q printVersion --console=plain
  3. Allow the CI to capture the version in the VERSION variable

The current project version is set to '1.0.0' in build.gradle line 7.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Oct 18, 2025
Copilot AI and others added 3 commits October 18, 2025 21:55
Co-authored-by: jona7o <8403631+jona7o@users.noreply.github.com>
Co-authored-by: jona7o <8403631+jona7o@users.noreply.github.com>
Co-authored-by: jona7o <8403631+jona7o@users.noreply.github.com>
Copilot AI changed the title [WIP] Add printVersion task to output project version Add printVersion task to fix CI workflow failure Oct 18, 2025
Copilot AI requested a review from jona7o October 18, 2025 22:02
@jona7o
jona7o marked this pull request as ready for review October 18, 2025 22:02
@jona7o
jona7o merged commit 7bee869 into main Oct 18, 2025
3 checks passed
@jona7o
jona7o deleted the copilot/add-print-version-task branch October 18, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants