Skip to content

Add automated maven central pubslishing#2

Merged
dubdabasoduba merged 4 commits intomasterfrom
add_publishing
Apr 14, 2026
Merged

Add automated maven central pubslishing#2
dubdabasoduba merged 4 commits intomasterfrom
add_publishing

Conversation

@dubdabasoduba
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces automated publishing to Maven Central driven by GitHub tag pushes, adding the Maven build configuration and CI workflow steps needed to produce source/javadoc artifacts and signed releases.

Changes:

  • Adds a release Maven profile to attach sources/javadocs and GPG-sign artifacts.
  • Documents tag conventions, workflow behavior, and required repository secrets in the README.
  • Adds a GitHub Actions workflow to build, deploy, and create GitHub Releases on tag push.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
pom.xml Adds plugin versions and a release profile for sources/javadocs and GPG signing.
README.md Adds publishing documentation (tag conventions, workflow steps, required secrets).
.github/workflows/publish.yml New release workflow triggered by tags to set versions, build, deploy, and create GitHub Releases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread .github/workflows/publish.yml
Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated

- name: Set project version from tag
run: |
mvn -B -ntp versions:set -DnewVersion="${{ steps.version.outputs.VERSION }}"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This step uses versions:set without -DprocessAllModules=true. In this repo, child modules hardcode the parent version (e.g., easy-rules-core/pom.xml), so only updating the root POM will leave module POMs pointing at the old parent version and break the reactor build/deploy.

Suggested change
mvn -B -ntp versions:set -DnewVersion="${{ steps.version.outputs.VERSION }}"
mvn -B -ntp versions:set -DprocessAllModules=true -DnewVersion="${{ steps.version.outputs.VERSION }}"

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/publish.yml
Comment thread pom.xml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dubdabasoduba dubdabasoduba self-assigned this Apr 14, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml Outdated
Comment on lines +60 to +61
sed -i "s#__CENTRAL_USERNAME__#${{ secrets.CENTRAL_USERNAME }}#g" "$HOME/.m2/settings.xml"
sed -i "s#__CENTRAL_PASSWORD__#${{ secrets.CENTRAL_PASSWORD }}#g" "$HOME/.m2/settings.xml"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This sed replacement approach is fragile: secrets containing characters like #, &, or newlines can break the substitution or produce invalid XML, causing deploy failures. Prefer Maven settings env interpolation (${env.CENTRAL_USERNAME}/${env.CENTRAL_PASSWORD}) or actions/setup-java's built-in server-id/server-username/server-password settings generation instead of in-place sed edits.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/publish.yml Outdated
with:
tag_name: ${{ github.ref_name }}
draft: false
prerelease: ${{ steps.reltype.outputs.TYPE == 'snapshot' || contains(github.ref, 'RC') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The prerelease logic includes RC/alpha/beta, but the earlier “Determine release type” step rejects any tag format other than vX.Y.Z or vX.Y.Z-SNAPSHOT (so those tags will never reach this step). Either expand the accepted tag formats (and keep README in sync) or remove the unreachable prerelease conditions.

Suggested change
prerelease: ${{ steps.reltype.outputs.TYPE == 'snapshot' || contains(github.ref, 'RC') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
prerelease: ${{ steps.reltype.outputs.TYPE == 'snapshot' }}

Copilot uses AI. Check for mistakes.
@dubdabasoduba dubdabasoduba merged commit 7001ac9 into master Apr 14, 2026
1 check passed
@dubdabasoduba dubdabasoduba deleted the add_publishing branch April 14, 2026 11:54
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