mirror of
https://github.com/runelite/plugin-hub.git
synced 2025-12-23 22:48:49 -05:00
not using bash gives us more flexibility and significantly reduces build times via parallelism. Additionally this includes support for GitHub Actions which also significantly reduces build times.
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
FORCE_BUILD:
|
|
description: "List of plugins to build, or 'ALL'"
|
|
required: false
|
|
COMMIT_RANGE:
|
|
description: "Commit range to build 1234abc..5689def"
|
|
required: false
|
|
push:
|
|
pull_request:
|
|
jobs:
|
|
execute:
|
|
# any forks that predate this repo having an action will have actions
|
|
# enabled by default, which will fail in a lot of cases because the branch
|
|
# is new, which makes the differential build fail
|
|
if: github.event_name != 'push' || github.repository_owner == 'runelite'
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 11
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.gradle/caches/
|
|
~/.gradle/wrapper/
|
|
key: package-2.0.0
|
|
- name: prepare
|
|
run: |
|
|
pushd package
|
|
./gradlew --build-cache prep
|
|
popd
|
|
- name: build
|
|
env:
|
|
REPO_CREDS: ${{ secrets.REPO_CREDS }}
|
|
REPO_ROOT: ${{ secrets.REPO_ROOT }}
|
|
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
|
# workflow_dispatch
|
|
FORCE_BUILD: ${{ github.event.inputs.FORCE_BUILD }}
|
|
COMMIT_RANGE: ${{ github.event.inputs.COMMIT_RANGE }}
|
|
# push
|
|
COMMIT_BEFORE: ${{ github.event.before }}
|
|
COMMIT_AFTER: ${{ github.event.after }}
|
|
# pull_request
|
|
PR_BEFORE: ${{ github.event.pull_request.base.sha }}
|
|
PR_AFTER: ${{ github.event.pull_request.head.sha }}
|
|
PACKAGE_IS_PR: ${{ github.event_name == 'pull_request' }}
|
|
run: |
|
|
if $PACKAGE_IS_PR; then
|
|
export PACKAGE_COMMIT_RANGE="$PR_BEFORE..$PR_AFTER"
|
|
else
|
|
export PACKAGE_COMMIT_RANGE="${COMMIT_RANGE:-${COMMIT_BEFORE:+$COMMIT_BEFORE..$COMMIT_AFTER}}"
|
|
fi
|
|
java -XX:+UseParallelGC -jar package/package/build/libs/package.jar |