ci: Lint check #7
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
# 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/[email protected] # prevent builds without conventional commits? | |
- name: Increment version | |
id: increment-version | |
uses: RichardInnocent/[email protected] | |
- 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/[email protected] | |
# 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/[email protected] | |
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 |