mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
a5a4f5c3ea
* Attempt cache gradle properly * Save artifacts on standard build * Dont build on bad path and standardize pr action * Don't do caching for PR builds * Correct exclusion paths * Allow manual trigger of build action
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
name: Build Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- '.github/ISSUE_TEMPLATE/*.yml'
|
|
- '.idea/copyright/*.xml'
|
|
- '.gitignore'
|
|
- 'CONTRIBUTING.md'
|
|
- 'LICENSE'
|
|
- 'Jenkinsfile '
|
|
- 'README.md'
|
|
- 'licenseheader.txt'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 17
|
|
distribution: temurin
|
|
|
|
- name: Check if the author has forked the API repo
|
|
uses: Kas-tle/ForkFinder@v1.0.1
|
|
id: find_forks
|
|
with:
|
|
owner: GeyserMC
|
|
repo: api
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Use author's API repo if it exists
|
|
if: steps.find_forks.outputs.target_branch_found == 'true'
|
|
env:
|
|
API_FORK_URL: ${{ steps.find_forks.outputs.user_fork_url }}
|
|
API_FORK_BRANCH: ${{ github.event.pull_request.head.ref }}
|
|
run: |
|
|
git clone "${API_FORK_URL}" --single-branch --branch "${API_FORK_BRANCH}" api
|
|
cd api
|
|
./gradlew publishToMavenLocal
|
|
|
|
- name: Checkout repository and submodules
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
path: geyser
|
|
|
|
- name: Build Geyser
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
arguments: build
|
|
build-root-directory: geyser
|
|
|
|
- name: Archive artifacts (Geyser Fabric)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser Fabric
|
|
path: geyser/bootstrap/fabric/build/libs/Geyser-Fabric.jar
|
|
if-no-files-found: error
|
|
- name: Archive artifacts (Geyser Standalone)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser Standalone
|
|
path: geyser/bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
|
if-no-files-found: error
|
|
- name: Archive artifacts (Geyser Spigot)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser Spigot
|
|
path: geyser/bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
|
if-no-files-found: error
|
|
- name: Archive artifacts (Geyser BungeeCord)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser BungeeCord
|
|
path: geyser/bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
|
if-no-files-found: error
|
|
- name: Archive artifacts (Geyser Sponge)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser Sponge
|
|
path: geyser/bootstrap/sponge/build/libs/Geyser-Sponge.jar
|
|
if-no-files-found: error
|
|
- name: Archive artifacts (Geyser Velocity)
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: Geyser Velocity
|
|
path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
if-no-files-found: error
|