Java CI #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
schedule: | |
- cron: '22 14 * * 6' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Movecraft-Combat | |
uses: actions/checkout@v3 | |
with: | |
path: Movecraft-Combat | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Cache Maven packages | |
id: cacheMain | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2 | |
restore-keys: ${{ runner.os }}-m2 | |
# Build Movecraft-Combat | |
- name: Build Movecraft-Combat | |
run: mvn -B package -T 1C --file Movecraft-Combat/pom.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Stage jar | |
run: mkdir staging && cp Movecraft-Combat/target/Movecraft-Combat*.jar staging | |
- name: Rename jar | |
run: mv staging/Movecraft-Combat*.jar staging/Movecraft-Combat_$GITHUB_SHA.jar | |
- name: Upload jar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Movecraft-Combat_Dev-Build | |
path: staging/Movecraft-Combat_*.jar |