Skip to main content
This guide walks project leads through adopting the shared community-workflows infrastructure for CI, snapshot publishing, and Maven Central releases.

Prerequisites

Before starting, ensure you have:
  • A repository under the spring-ai-community GitHub organization
  • Maven wrapper (./mvnw) in your repository root — if missing, run mvn wrapper:wrapper to generate it
  • Standard Maven project structure
  • Repository admin access (for configuring secrets)

Step 1: Add CI Workflow

Create .github/workflows/ci.yml in your repository:
This runs clean verify -B on every push and PR. Optional inputs:

Step 2: Add Snapshot Publishing

Create .github/workflows/publish-snapshot.yml:
Every push to main publishes a SNAPSHOT to Maven Central. This requires the MAVEN_USERNAME and MAVEN_PASSWORD secrets (see Secrets Configuration).

Step 3: Add Release Workflow

Create .github/workflows/release.yml:
The release workflow:
  1. Sets the POM version to the specified release version
  2. Verifies no SNAPSHOT dependencies remain
  3. Builds and runs tests
  4. Deploys to Maven Central with GPG signing (using the release profile)
  5. Creates a Git tag (e.g., v0.1.0) and GitHub Release
Optional inputs:

Secrets Configuration

Organization-Level Secrets (Already Configured)

These secrets are set at the GitHub organization level. Your repository needs to be granted access to them (ask an org admin if they aren’t available):

Repository-Level Secrets

If your project uses CLI tools for integration tests, set these at the repository level (Settings → Secrets and variables → Actions):
Repository-level secrets keep API keys scoped per-project for billing and access control. Do not set API keys at the organization level.

POM Requirements

The release workflow deploys with -Prelease, which activates a Maven profile that handles Central Publishing, GPG signing, and source/javadoc JAR generation.

Performing a Release

Option A: GitHub Actions UI (workflow_dispatch)

This is the primary release method:
1

Navigate to Actions

Go to your repository on GitHub and click the Actions tab.
2

Select the Release workflow

In the left sidebar, click Release.
3

Run workflow

Click Run workflow, enter the release version (e.g., 0.1.0), and click Run workflow.
4

Monitor the run

Watch the workflow run. It will set the version, build, deploy to Maven Central, create a Git tag, and publish a GitHub Release.

Option B: Release Script (CLI)

For command-line releases, use the release script from the community-workflows repository:
The script performs a fresh checkout, sets the version, builds, tags, pushes, and optionally triggers the GitHub Actions release workflow.

Option C: PR-Based Releases (Optional)

For projects that prefer PR-driven releases, copy .github/project.yml.template from community-workflows to .github/project.yml in your repository:
When pr-based-releases is set to true, merging a PR that changes release.current-version to a non-SNAPSHOT version (e.g., 0.1.0) automatically triggers the release workflow.

Projects Using Shared Workflows

CLI Tools Variant

Projects that require CLI tools (Claude, Gemini, Vendir) for integration tests should use the -with-cli workflow variants. These add:
  • Node.js setup and CLI installation
  • API keys passed as environment variables to Maven
  • Optional commit message validation (blocks AI attribution markers)
Example CI with CLI tools:
The -with-cli variants are available for all three workflows: ci-build-with-cli.yml, publish-snapshot-with-cli.yml, and maven-central-release-with-cli.yml. Additional inputs for CLI variants:

Troubleshooting

Organization-level secrets must be explicitly granted access to your repository. Ask an org admin to add your repository to the secret’s access list under Organization Settings → Secrets → Repository access.
If CI fails with Non-resolvable parent POM for ... spring-ai-community-parent, your POM is missing the Central snapshots repository. Add it to your repositories section:
The release workflow checks that no POM files contain SNAPSHOT references after setting the release version. If you have SNAPSHOT dependencies on other community projects, those projects must be released first.
Ensure the GPG_SECRET_KEY secret contains the full ASCII-armored private key. Export it with:
The entire contents of private-key.asc (including the BEGIN and END lines) should be the secret value.
Verify your credentials work by logging in at central.sonatype.com. Try publishing a SNAPSHOT first to confirm the credentials are valid.
Ensure you’re using the -with-cli workflow variant and have set the install-* inputs to true. Check that the corresponding API key secrets are configured at the repository level.