Skip to content

ci: Lint check

ci: Lint check #7

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
# - uses: webiny/action-conventional-commits@v1.2.0 # prevent builds without conventional commits?
- name: Increment version
id: increment-version
uses: RichardInnocent/semantic-versioning-maven@v0.1.0
- name: Set up JDK 21
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version # skip anything build-related on unnecessary commits
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: Setup Node.js environment
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version # skip anything build-related on unnecessary commits
uses: actions/setup-node@v4.0.0
# with:
# cache: npm
- name: Build with Maven
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version # skip anything build-related on unnecessary commits
run: ./mvnw -B package -Drevision='${{ steps.increment-version.outputs.new-version }}' -Dchangelog='' --file pom.xml -P ci
- name: Update pom.xml
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version # skip anything build-related on unnecessary commits
run: ./mvnw org.codehaus.mojo:versions-maven-plugin:2.7:set-property -Dproperty=revision -DnewVersion='${{ steps.increment-version.outputs.new-version }}'
- name: push
if: steps.increment-version.outputs.previous-version != steps.increment-version.outputs.new-version # skip anything build-related on unnecessary commits
uses: github-actions-x/commit@v2.9
with:
push-branch: "main"
commit-message: "ci: Bump revision to ${{steps.increment-version.outputs.new-version}}"
files: pom.xml
# - name: Submit Dependency Snapshot
# uses: advanced-security/maven-dependency-submission-action@v3