Skip to content

Release Prep

Release Prep #18

Workflow file for this run

name: Build and test with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Download dependencies
run: |
set -x
./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies
- name: Build with Maven
env:
SPRING_AI_OPENAI_API_KEY: ${{ secrets.SPRING_AI_OPENAI_API_KEY }}
run: ./mvnw -B test -Pci
- name: Import GPG Key
if: github.ref == 'refs/heads/main'
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
echo "default-key $(gpg --list-keys --with-colons | grep pub | cut -d':' -f5)" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
- name: Generate settings.xml
if: github.ref == 'refs/heads/main'
run: |
mkdir -p ~/.m2
echo "<settings>
<servers>
<server>
<id>github</id>
<username>${{ github.actor }}</username>
<password>${{ secrets.GITHUB_TOKEN }}</password>
</server>
</servers>
</settings>" > ~/.m2/settings.xml
- name: Deploy Snapshot (only for main)
if: github.ref == 'refs/heads/main'
run: |
./mvnw -B deploy -DskipTests