updated requirements #95
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: Release with Maven | |
on: | |
push: | |
branches: [main] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set execute permission for mvnw | |
run: chmod +x ./mvnw | |
- name: Set up the JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Configure Problem Matchers | |
run: | | |
echo "::add-matcher::.github/problem-matcher.json" | |
echo "::remove-matcher owner=java::" | |
- name: Configure Git user | |
run: | | |
git config user.name "${{ github.event.head_commit.committer.name }}" | |
git config user.email "${{ github.event.head_commit.committer.email }}" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Pull latest changes | |
run: | | |
git pull origin main || echo "No changes to pull" | |
- name: Prepare release | |
run: ./mvnw -B release:prepare | |
- name: Build and push Docker image | |
run: | | |
./docker-build.sh | |
- name: Save version number in env | |
run: | | |
VERSION=$(grep 'project.rel.ai.knorket\\:trino-nlp-embeddings=' release.properties | cut -d'=' -f2) | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
echo "Version extracted: ${VERSION}" | |
- name: Publish JAR | |
run: ./mvnw -B release:perform -Darguments="-Dgpg.skip -Dmaven.deploy.skip=true" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: List target directory | |
run: ls -al target/ | |
- name: Run JReleaser | |
uses: jreleaser/release-action@v2 | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ env.VERSION }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
setup-java: false | |
- name: Upload test report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test report ${{ github.job }} | |
path: | | |
release.properties | |
**/surefire-reports/TEST-*.xml | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties | |
retention-days: 5 |