Repository navigation
93 lines (83 loc) · 4.43 KB
/
Copy pathpullrequest.yml
File metadata and controls
93 lines (83 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build Pull Request
# The red `Build Pull Request` check on every release PR is NOT a broken job and NOT the trigger
# filter - it is GitHub's approval gate for pull requests created with GITHUB_TOKEN: `pull_request`
# events with the opened/synchronize/reopened activity types from GITHUB_TOKEN "create workflow
# runs that require approval" (docs: Events that trigger workflows -> pull_request). Nobody
# approves them, so the run is created with 0 jobs and resolves to `failure` once the release PR
# is merged: it never executes, so it can never go green (0.15.14: run 36324298904,
# event=pull_request, actor=github-actions[bot], 0 jobs, on the release-please branch - the same
# shape on 0.15.13, 0.15.12, 0.15.11, 0.15.10 and 0.15.7).
#
# This workflow declares no `paths:` filter, so it matches *every* pull request - the release PR
# included, on purpose. That is why the run exists at all: a workflow whose trigger does not match
# gets no run whatsoever, so a filter that skipped the release PR's own files
# (.release-please-manifest.json, CHANGELOG.md) would only turn an accepted red check into a
# missing one. Do not "fix" the phantom that way.
#
# The one release-PR run of this workflow that ever executed is 0.15.7 (run 32509901978): it
# carries run_attempt=2 and triggering_actor=robinbraemer, i.e. a human with write access approved
# it from the pull request page, which is the documented manual remedy. No release PR run executes
# without that approval - and that approved attempt is what built `build (17)` / `build (21)` for
# the head that merged.
#
# Consequence, and the reason this note sits above the `on:` block: never add `Build Pull Request`
# (or any `Build Pull Request / ...`) context to main's required status checks. The gated run
# reports no check run at all, so a release PR would sit in "Expected - waiting for status to be
# reported" while release-please.yml retries its merge and finally reds the release job. The only
# contexts a release PR can satisfy are the native matrix check runs of the build release-please.yml
# dispatches for it with `workflow_dispatch` (exempt from the gate): `build (17)` and
# `build (21)`. Nothing is mirrored into branch protection to paper over the gate
# (ReleasePleaseCheckAuditTest), and main is currently unprotected. Making the check real would
# require release-please to open its PR with a GitHub App/PAT token instead of GITHUB_TOKEN - a
# credential change, not a workflow edit.
# ReleaseBranchCheckContractTest pins all of the above.
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Run the full build (incl. the per-platform plugin startup tests) on more than one JDK so a
# JDK-version-dependent DI/reflective startup regression is caught in CI. 17 is the primary
# (release) toolchain and the only one that publishes artifacts; 21 is the highest JDK
# Gradle 8.5 can run on. The Java-26-class reflective/DI failures (Guice 7 provisioning,
# Libp2pEndpointRuntime constructor arity) are additionally guarded by signature-level
# reflective tests that are independent of the running JDK, so they are covered even though
# the build cannot run on JDK 26 until Gradle is upgraded.
java: ['17', '21']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for git describe
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build
- name: Archive artifacts (Connect Bungee)
uses: actions/upload-artifact@v4
if: success() && matrix.java == '17'
with:
name: Connect Bungee
path: bungee/build/libs/connect-bungee.jar
- name: Archive artifacts (Connect Spigot)
uses: actions/upload-artifact@v4
if: success() && matrix.java == '17'
with:
name: Connect Spigot
path: spigot/build/libs/connect-spigot.jar
- name: Archive artifacts (Connect Velocity)
uses: actions/upload-artifact@v4
if: success() && matrix.java == '17'
with:
name: Connect Velocity
path: velocity/build/libs/connect-velocity.jar