Skip to content

Commit

Permalink
Create maven.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
darksoulq authored Jan 2, 2025
1 parent 6a421d8 commit 57819b9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 57819b9

Please sign in to comment.