Add CI GitHub Action and rename snapshot publish workflow

This commit is contained in:
Dariusz Jędrzejczyk 2025-03-18 13:23:35 +01:00 • committed by Christian Tzolov
commit ec5383c23a
2 changed files with 23 additions and 1 deletions

22
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: CI
on:
pull_request: {}
jobs:
build:
name: Build branch
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Build
run: mvn verify

44
.github/workflows/publish-snapshot.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Publish Snapshot
on:
push:
branches: [ "main" ]
jobs:
build:
name: Build branch
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate Java docs
run: mvn -Pjavadoc -B javadoc:aggregate
- name: Build with Maven and deploy to Sonatype snapshot repository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
run: |
mvn -Pjavadoc -Prelease --batch-mode --update-snapshots deploy
- name: Capture project version
run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV