Files
plugin-hub/.github/workflows/build.yml
Max Weber 531a9a8554 package: use a central verification-metadata file
This lets us have better control over which dependencies are verified,
as changes to runelite-client's dependencies cause all Hub plugins with
pinned deps to fail, as the new transitive deps aren't pinned. Moving
this file into this repo not only lets us update it in these situations,
but also means individual plugin authors don't need to touch Gradle's
verification and all of it's associated pains. This also allows plugins
to pull a dependency that another plugin pulls already with no extra
work.
2021-02-26 10:23:08 -07:00

96 lines
3.0 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:
build:
# 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.4
- name: prepare
run: |
pushd package
./gradlew --build-cache prep
./gradlew --build-cache --project-dir verification-template :verifyCore
popd
- name: build
env:
REPO_CREDS: ${{ secrets.REPO_CREDS }}
REPO_ROOT: ${{ secrets.REPO_ROOT }}
# 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: |
COMMAND_SECRET="$(openssl rand -hex 32)"
echo "::add-mask::$COMMAND_SECRET"
echo "::stop-commands::$COMMAND_SECRET"
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
exec java -XX:+UseParallelGC -cp package/package/build/libs/package.jar net.runelite.pluginhub.packager.Packager
- uses: actions/upload-artifact@v2
with:
name: manifest_diff
path: /tmp/manifest_diff
retention-days: 1
upload:
if: (github.event_name != 'push' || github.repository_owner == 'runelite') && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: upload-2.0.4
- uses: actions/download-artifact@v2
with:
name: manifest_diff
path: /tmp
- name: upload
env:
REPO_CREDS: ${{ secrets.REPO_CREDS }}
REPO_ROOT: ${{ secrets.REPO_ROOT }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
pushd package
./gradlew :upload:run
popd