12345678910111213141516171819202122232425262728293031 |
- name: Java CI
- on:
- push:
- branches: [master] # Trigger the workflow when pushing to the master branch
- pull_request:
- branches: [master] # Trigger the workflow for pull requests targeting the master branch
- jobs:
- build:
- runs-on: ubuntu-latest # Use the latest available Ubuntu runner
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v4 # Check out the source code from the repository
- - name: Set up JDK 17
- uses: actions/setup-java@v4 # Set up the Java Development Kit
- with:
- java-version: '17' # Specify Java version 17
- distribution: 'temurin' # Use Temurin distribution (successor to AdoptOpenJDK)
- cache: 'maven' # Enable Maven dependency caching for faster builds
- - name: Build with Maven
- run: mvn --batch-mode --update-snapshots package # Compile the project and create the JAR
- - name: Upload JAR Artifact
- uses: actions/upload-artifact@v4 # Upload the built JAR file as a workflow artifact
- with:
- name: missilewars-jar # Name of the uploaded artifact
- path: missilewars-plugin/target/MissileWars-*.jar # Path to the JAR file(s) to upload
|