Yatopia/.github/workflows/build.yml

79 lines
2.0 KiB
YAML

name: Yatopia Build Script
on:
push:
paths-ignore:
- '*.md'
- 'Jenkinsfile'
branches:
- ver/1.17
- dev/*
- staging/1.17
pull_request:
paths-ignore:
- '*.md'
- 'Jenkinsfile'
jobs:
validation:
name: "Gradle Wrapper Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
build:
needs: validation
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '16' ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Pull Gradle Cache
uses: actions/cache@v2
id: gradle-cache
with:
path: ~/.gradle
key: ${{ runner.os }}-mavenCache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-openjdk-${{ matrix.java }}
- name: Configure git
run: |
git config --global user.email "ci@github.com"
git config --global user.name "Github CI"
git config --global gc.auto 0
sudo chmod -R -f 777 ./gradlew
- name: Apply Patches
run: |
./gradlew applyPatches
- name: Get MC Version
run: echo "::set-output name=mcver::$(cat "Paper/work/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)"
id: mcver
- name: Pull Maven Cache
uses: actions/cache@v2
id: maven-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mavenCache-${{ hashFiles('**/pom.xml') }}
- name: Build Yatopia
run: |
./gradlew generatePaperclipPatch --no-build-cache
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Yatopia-${{ matrix.java }}
path: yatopia-${{ steps.mcver.outputs.mcver }}-paperclip.jar