From 57819b9b9ce93e9314db80f154087dd149bb60df Mon Sep 17 00:00:00 2001 From: darksoulq <91909571+darksoulq@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:10:18 +0530 Subject: [PATCH] Create maven.yml --- .github/workflows/maven.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..3db3b4c --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,46 @@ +# .github/workflows/maven-build.yml +name: Maven Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the code + - name: Checkout code + uses: actions/checkout@v3 + + # Step 2: Set up Java JDK 21 + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' # Eclipse Temurin is the recommended distribution + java-version: '21' + + # Step 3: Cache Maven dependencies + - name: Cache Maven dependencies + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + # Step 4: Build with Maven + - name: Build with Maven + run: mvn clean package + + # Step 5: Upload build artifacts + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: wizwig + path: target/*.jar