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
58 changes: 58 additions & 0 deletions .github/workflows/publish-client-and-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release Client and Server

on:
workflow_dispatch:

jobs:
build:
runs-on: macos-latest
environment: release

permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Verify publication configuration
run: ./gradlew kotlin-sdk-server:jreleaserConfig kotlin-sdk-client:jreleaserConfig
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build with Gradle
run: ./gradlew clean kotlin-sdk-server:assemble kotlin-sdk-client:assemble
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
Comment on lines +44 to +45
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

These environment variables duplicate the JRELEASER_GPG_SECRET_KEY and JRELEASER_GPG_PASSPHRASE variables already set above. Consider removing the duplicates to reduce configuration redundancy.

Copilot uses AI. Check for mistakes.

- name: Publish to Maven Central Portal
id: publish
run: ./gradlew kotlin-sdk-server:publish kotlin-sdk-client:publish kotlin-sdk-server:jreleaserFullRelease kotlin-sdk-client:jreleaserFullRelease --info --stacktrace -Djreleaser.verbose=true
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

These environment variables are duplicated again in the publish step. The JRELEASER_* prefixed versions should be sufficient for JReleaser operations.

Suggested change
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}

Copilot uses AI. Check for mistakes.
9 changes: 9 additions & 0 deletions buildSrc/src/main/kotlin/mcp.jreleaser.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,13 @@ jreleaser {
files = false
}
}

release {
github {
skipRelease = true
skipTag = true
overwrite = false
token = "none"
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

Using a hardcoded 'none' token value could cause authentication issues. Consider using a proper environment variable or removing this line if GitHub token authentication is handled elsewhere.

Suggested change
token = "none"
token = System.getenv("GITHUB_TOKEN")

Copilot uses AI. Check for mistakes.
}
}
}
Loading