mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 13:23:01 +08:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
|
name: "Lint and Build"
|
||
|
on:
|
||
|
workflow_dispatch: ~
|
||
|
push:
|
||
|
paths:
|
||
|
- "**.java"
|
||
|
branches:
|
||
|
- "development"
|
||
|
jobs:
|
||
|
Build-Server-Jar:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout LintRatchet
|
||
|
uses: actions/checkout@v2
|
||
|
with:
|
||
|
ref: LintRatchet
|
||
|
- name: Checkout branch
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Setup Java
|
||
|
uses: actions/setup-java@v3
|
||
|
with:
|
||
|
distribution: temurin
|
||
|
java-version: '17'
|
||
|
- name: Cache gradle files
|
||
|
uses: actions/cache@v2
|
||
|
with:
|
||
|
path: |
|
||
|
~/.gradle/caches
|
||
|
~/.gradle/wrapper
|
||
|
./.gradle/loom-cache
|
||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }}
|
||
|
restore-keys: |
|
||
|
${{ runner.os }}-gradle-
|
||
|
- name: Run Spotless
|
||
|
run: ./gradlew spotlessApply
|
||
|
- name: Run Gradle
|
||
|
run: ./gradlew && ./gradlew jar
|
||
|
- name: Upload build
|
||
|
uses: actions/upload-artifact@v3
|
||
|
with:
|
||
|
name: Grasscutter
|
||
|
path: grasscutter-*.jar
|
||
|
- name: Commit any Spotless changes
|
||
|
uses: EndBug/add-and-commit@v9
|
||
|
with:
|
||
|
add: '-u'
|
||
|
default_author: github_actions
|
||
|
message: 'Fix whitespace'
|