Skip to content

cicd#187

Open
yifan3691 wants to merge 6 commits into
zongzibinbin:mainfrom
yifan3691:main
Open

cicd#187
yifan3691 wants to merge 6 commits into
zongzibinbin:mainfrom
yifan3691:main

Conversation

@yifan3691

Copy link
Copy Markdown

cicd

cicd
Copilot AI review requested due to automatic review settings March 29, 2026 05:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to build the Maven project and publish artifacts to GitHub Packages when a GitHub Release event occurs.

Changes:

  • Introduces .github/workflows/maven-publish.yml to run Maven package + deploy on release events.
  • Configures actions/setup-java for Maven publishing via generated settings.xml.

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

Comment thread .github/workflows/maven-publish.yml Outdated
Comment on lines +19 to +34
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

steps: list items are not indented under the steps key. As written, the YAML is invalid and the workflow will fail to load; indent each - name / - uses entry under steps: (e.g., two spaces deeper than steps:).

Suggested change
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/maven-publish.yml Outdated

on:
release:
types: [created]

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow triggers on release: types: [created], which also runs for draft releases and before a release is actually published. If the intent is to publish packages only for finalized releases, use types: [published] (or explicitly handle drafts/prereleases).

Suggested change
types: [created]
types: [published]

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/maven-publish.yml Outdated
Comment on lines +20 to +23
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow sets up JDK 11, but the root pom.xml declares <java.version>1.8</java.version>. Consider aligning the workflow JDK version to the project’s declared target (or updating the POM) to avoid inconsistent build behavior across local/CI environments.

Suggested change
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/maven-publish.yml Outdated
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

actions/setup-java is configured with server-id: github, but the repository POMs do not define any <distributionManagement> repository with id github. As a result, mvn deploy will fail (no deployment repository configured). Add an appropriate <distributionManagement> section (matching github) or pass an explicit deployment repository via Maven CLI options.

Suggested change
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/${{ github.repository }}

Copilot uses AI. Check for mistakes.
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.

3 participants