From 2f5fcdbcbe9127a30e4e29da3245955fb8df4132 Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Tue, 28 Jan 2025 14:31:05 +0100 Subject: [PATCH] Add CI GH action workflow --- .github/workflows/continuous-integration.yml | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..9e991c4 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,38 @@ +name: CI/CD build + +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' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Build with Maven and deploy to Sonatype snapshot repository + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + run: | + mvn -Pjavadoc -Prelease --batch-mode --update-snapshots deploy + + - name: Generate Java docs + run: mvn -Pjavadoc -B javadoc:aggregate + + - name: Capture project version + run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV