refactor(ai): Improve modularization of AI logic #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Commit Stage | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.editorconfig' | |
- '.gitignore' | |
- '.sdkmanrc' | |
- '*.adoc' | |
- '*.png' | |
- '*.md' | |
- 'docs/**' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/*.md' | |
- '.github/*.yml' | |
- '.github/*.yaml' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '.editorconfig' | |
- '.gitignore' | |
- '.sdkmanrc' | |
- '*.adoc' | |
- '*.png' | |
- '*.md' | |
- 'docs/**' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/*.md' | |
- '.github/*.yml' | |
- '.github/*.yaml' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 | |
with: | |
java-version: 21 | |
distribution: temurin | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 | |
- name: Compile and test | |
run: ./gradlew build -Dorg.gradle.parallel=false | |
- name: Generate SBOMs | |
run: ./gradlew cyclonedxBom | |
- name: Stage artifacts to local directory | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: ./gradlew publish | |
- name: Define environment variables for Java project | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
GROUP=$(./gradlew properties | grep 'group:' | awk '{print $2}') | |
echo "GROUP=$GROUP" >> $GITHUB_ENV | |
echo "group: $GROUP" | |
VERSION=$(./gradlew properties | grep 'version:' | awk '{print $2}') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "version: $VERSION" | |
- name: Release | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: jreleaser/release-action@80ffb38fa759704eed4db5c7fcaae3ac1079473e # v2 | |
with: | |
arguments: full-release | |
env: | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_DEPLOY_MAVEN_NEXUS2_CENTRAL_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }} | |
JRELEASER_DEPLOY_MAVEN_NEXUS2_CENTRAL_TOKEN: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_TOKEN }} | |
JRELEASER_PROJECT_JAVA_GROUP_ID: ${{ env.GROUP }} | |
JRELEASER_PROJECT_VERSION: ${{ env.VERSION }} | |
- name: Upload JReleaser output | |
if: always() | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
with: | |
retention-days: 1 | |
name: jreleaser-output | |
path: | | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties | |
# - name: Deploy and release artifacts | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
# run: | | |
# VERSION=$(./gradlew properties | grep 'version:' | awk '{print $2}') | |
# if [[ $VERSION == *"SNAPSHOT"* ]]; then | |
# ./gradlew jreleaserDeploy | |
# else | |
# ./gradlew jreleaserFullRelease | |
# fi | |
# env: | |
# | |
# - name: Upload JReleaser output | |
# if: always() | |
# uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
# with: | |
# retention-days: 1 | |
# name: jreleaser-output | |
# path: | | |
# build/jreleaser/trace.log | |
# build/jreleaser/output.properties |