mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-25 12:05:14 +01:00
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
name: Yatopia Build Script
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '*.md'
|
|
- 'Jenkinsfile'
|
|
branches:
|
|
- ver/1.16.5
|
|
- dev/*
|
|
- staging/1.16.5
|
|
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: [ '11', '15', '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: Setup Yatopia Project
|
|
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
|
|
./gradlew initGitSubmodules
|
|
|
|
- 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 Minecraft Decompile Cache
|
|
uses: actions/cache@v2
|
|
id: decompile-cache
|
|
with:
|
|
path: Paper/work/Minecraft/${{ steps.mcver.outputs.mcver }}
|
|
key: ${{ hashFiles('Paper/work/BuildData/mappings/bukkit-$STEPS_MCVER_OUTPUTS_MCVER-cl.csrg') }}-${{ steps.mcver.outputs.mcver }}-${{ runner.os }}-openjdk-${{ matrix.java }}-minecraft-decomp
|
|
|
|
- name: Apply Patches
|
|
run: |
|
|
./gradlew setupUpstream
|
|
./gradlew applyPatches
|
|
|
|
- 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 clean build paperclip
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Yatopia-${{ matrix.java }}
|
|
path: yatopia-${{ steps.mcver.outputs.mcver }}-paperclip.jar
|
|
|