[ci skip] Publish PR API and dev bundles (#12672)

* Setup PR publishing

also remove the JDK matrix, it's pointless with one value and other parts of the workflow depend on a single value...

* Use PaperMC action

* Change base PR maven url

* Update action

* Update action

* Update action

* Update action

* Update action

* Re-enable javadoc...?

* Delete PR comment workflow

* Rename publish tag

* comment broken jd link

* update bot name
This commit is contained in:
Jason Penilla
2025-06-16 17:35:54 -07:00
committed by GitHub
parent ba7fb23ddd
commit 39203a65e0
5 changed files with 55 additions and 97 deletions

View File

@@ -19,18 +19,16 @@ jobs:
# The goal of the build workflow is split into multiple requirements.
# 1. Run on pushes to same repo.
# 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
# 3. Run on labeled PRs that have the build-pr-jar flag.
# 3. Run on labeled PRs that have the publish-pr flag.
if: >
(
(github.event_name == 'push')
|| (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build-pr-jar')
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'publish-pr')
)
runs-on: ubuntu-latest
strategy:
matrix:
java: [21]
fail-fast: true
steps:
- if: ${{ github.event_name == 'push' }}
@@ -43,10 +41,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: JDK ${{ matrix.java }}
- name: JDK 21
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: 21
distribution: 'zulu'
- name: Setup Gradle
@@ -73,14 +71,14 @@ jobs:
if (event_name === "push" && ref_type === "branch") {
const {data: pulls} = await github.rest.pulls.list({ owner, repo, head: `${owner}:${ref_name}`, state: "open" });
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "build-pr-jar"));
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "publish-pr"));
if (pull) {
result["pr"] = pull.number;
result["action"] = "paperclip";
core.notice(`This is a push action but to a branch with an open PR with the build paperclip label (${JSON.stringify(result)})`);
return result;
}
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "build-pr-jar")) {
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "publish-pr")) {
result["pr"] = event.pull_request.number;
result["action"] = "paperclip";
core.notice(`This is a pull request action with a build paperclip label (${JSON.stringify(result)})`);
@@ -102,7 +100,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (${{ matrix.java }})
name: Test Results
path: |
**/build/test-results/test/TEST-*.xml
@@ -116,6 +114,13 @@ jobs:
with:
name: paper-${{ fromJSON(steps.determine.outputs.result).pr }}
path: paper-server/build/libs/paper-paperclip-*-mojmap.jar
- name: Publish Artifacts
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
uses: PaperMC/action-pr-publishing/upload@paper
with:
# TODO fallback for failing javadoc
publishing-task: ":paper-api:publishAllPublicationsTo_githubPackages_PRsRepository publishDevBundlePublicationTo_githubPackages_PRsRepository -PpublishDevBundle"
event_file:
name: "Event File"
# Only run on PRs if the source branch is on someone else's repo