Skip to content

feat: add maven production release#673

Merged
neelneelneel merged 1 commit intodevfrom
add-maven-release
Mar 6, 2025
Merged

feat: add maven production release#673
neelneelneel merged 1 commit intodevfrom
add-maven-release

Conversation

@kunal0137
Copy link
Copy Markdown
Contributor

Description

add maven production release github action

Changes Made

yaml args in .gitlab file

@kunal0137 kunal0137 requested a review from a team as a code owner March 6, 2025 21:16
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2025

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

feat: add maven production release


User description

Description

add maven production release github action

Changes Made

yaml args in .gitlab file


PR Type

  • Enhancement

Description

  • Add new CI job for production release.

  • Configure pnpm build and Maven deployment.

  • Install dependencies and required tools.

  • Include cleanup step to remove Maven cache.


Changes walkthrough 📝

Relevant files
Enhancement
ci-pnpm-maven.yml
Add CI job for Maven production deployment.                           

.github/workflows/ci-pnpm-maven.yml

  • Introduced new job pnpm_build_release.
  • Set conditional execution for release branch.
  • Added steps for code checkout, dependency installation, build, deploy,
    and cleanup.
  • +36/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    github-actions bot commented Mar 6, 2025

    @CodiumAI-Agent /review

    @github-actions
    Copy link
    Copy Markdown

    github-actions bot commented Mar 6, 2025

    @CodiumAI-Agent /improve

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Configuration

    Review the conditional triggers and environment variable usage to ensure that the workflow safely and reliably initiates production deployments. Confirm that the self-hosted runner and container image fulfill production and security requirements.

    pnpm_build_release:
        runs-on: self-hosted
        if: ${{ vars.RELEASE == 'TRUE' && github.event_name == 'workflow_dispatch' && (github.ref_name == 'main' || github.ref_name == 'dev') }}
        container:
            image: node:18.16.1-bullseye
        steps:
            - name: Checkout code
              uses: actions/checkout@v4
    
            - name: Install dependencies
              run: |
                  echo "Event Name: ${{ github.event_name }}"
                  echo "Release: ${{ vars.RELEASE }}"
                  apt-get update
                  apt-get install -y maven gnupg2
                  echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg2 --batch --import
                  echo "keyserver keyserver.ubuntu.com" > ~/.gnupg/gpg.conf
                  gpg2 --refresh-key
                  npm install -g pnpm@8
                  pnpm install
    
            - name: Build
              env:
                  NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
              run: npx nx run-many -t build -p @semoss/client @semoss/legacy --verbose
    
            - name: Deploy with Maven
              shell: bash
              run: |
                  mvn $MAVEN_CLI_OPTS deploy -P deploy -Dci.version=${{ vars.VERSION }}
              env:
                  GITHUB_REF: ${{ github.ref }}
    
            - name: Remove cache to save space
              run: rm -rf .m2/repository/org/semoss

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fail fast on errors

    Prepend a "set -e" to the bash script so that the deployment step fails immediately
    upon error.

    .github/workflows/ci-pnpm-maven.yml [194-197]

     - name: Deploy with Maven
       shell: bash
       run: |
    +      set -e
           mvn $MAVEN_CLI_OPTS deploy -P deploy -Dci.version=${{ vars.VERSION }}
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion correctly addresses error handling in the deployment step by adding "set -e" to the bash script, which improves reliability in case of failure.

    Medium
    Apply batch mode for GPG

    Append the "--batch" flag to the gpg2 refresh-key command to avoid interactive
    prompts.

    .github/workflows/ci-pnpm-maven.yml [183-185]

     echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg2 --batch --import
     echo "keyserver keyserver.ubuntu.com" > ~/.gnupg/gpg.conf
    -gpg2 --refresh-key
    +gpg2 --batch --refresh-key
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion adds the "--batch" flag to the gpg2 refresh-key command to prevent interactive prompts, which is a useful improvement in a CI environment.

    Low

    @neelneelneel neelneelneel merged commit 0b03b16 into dev Mar 6, 2025
    4 checks passed
    @neelneelneel neelneelneel deleted the add-maven-release branch March 6, 2025 21:30
    @github-actions
    Copy link
    Copy Markdown

    github-actions bot commented Mar 6, 2025

    @CodiumAI-Agent /update_changelog

    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