Skip to content

Commit

Permalink
Add github action to build the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Renaldas Szentiks committed Nov 23, 2023
1 parent afd76a9 commit 81cd468
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

name: Build

on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version (major.minor.patch)'
required: false
default: ''
push:
branches:
- 'develop'
- 'release/*'
pull_request:
branches:
- 'develop'
- 'release/*'

jobs:
build:
name: Build Job
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Prepare version
if: ${{ inputs.releaseVersion != '' }}
run: 'mvn --batch-mode release:update-versions -DdevelopmentVersion=${{ inputs.releaseVersion }}'

- name: Build & Test with Maven
run: 'mvn clean install'

- name: Save Package / Artifact
if: ${{ inputs.releaseVersion != '' }}
uses: actions/upload-artifact@v3
with:
name: 'aem-package'
path: all/target/*.zip

0 comments on commit 81cd468

Please sign in to comment.