Skip to content

Update build.yml

Update build.yml #5

Workflow file for this run

name: Build CoreProtect
on:
workflow_dispatch: # Manual trigger
push:
branches:
- main # or master, depending on your repo
jobs:
build:
name: Build CoreProtect
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Clone CoreProtect
run: git clone https://github.com/PlayPro/CoreProtect.git
- name: Patch pom.xml
working-directory: ./CoreProtect
run: |
sed -i '7s|<project.branch></project.branch>|<project.branch>development</project.branch>|' pom.xml
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build CoreProtect
run: |
cd CoreProtect
mvn -B verify
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: CoreProtect-Build
path: CoreProtect/target/*.jar