Skip to content

edit

edit #291

Workflow file for this run

name: CI/CD
on:
pull_request:
branches: main
types: [opened, synchronize, reopened]
push:
branches: main
paths-ignore: [ "README.md", "doc/**" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' #Eclipse Temurin
- uses: oneteme/automation-scripts/.github/actions/sonar-java-scan@main
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Extract project version
id: mvnVer
run: echo "version=$(mvn help:evaluate -DforceStdout -Dexpression=project.version -q)" >>$GITHUB_OUTPUT
outputs:
version: ${{ steps.mvnVer.outputs.version }}
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref_name == 'main' && endsWith(needs.build.outputs.version, '-SNAPSHOT')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' #Eclipse Temurin
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- uses: oneteme/automation-scripts/.github/actions/mvn-deploy@main
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}