@@ -19,18 +19,16 @@ jobs:
1919 # The goal of the build workflow is split into multiple requirements.
2020 # 1. Run on pushes to same repo.
2121 # 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
22- # 3. Run on labeled PRs that have the build -pr-jar flag.
22+ # 3. Run on labeled PRs that have the publish -pr flag.
2323 if : >
2424 (
2525 (github.event_name == 'push')
2626 || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
27- || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build -pr-jar ')
27+ || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'publish -pr')
2828 )
2929
3030 runs-on : ubuntu-latest
3131 strategy :
32- matrix :
33- java : [21]
3432 fail-fast : true
3533 steps :
3634 - if : ${{ github.event_name == 'push' }}
@@ -43,10 +41,10 @@ jobs:
4341 uses : actions/checkout@v4
4442 with :
4543 ref : ${{ github.event.pull_request.head.sha }}
46- - name : JDK ${{ matrix.java }}
44+ - name : JDK 21
4745 uses : actions/setup-java@v4
4846 with :
49- java-version : ${{ matrix.java }}
47+ java-version : 21
5048 distribution : ' zulu'
5149
5250 - name : Setup Gradle
@@ -73,14 +71,14 @@ jobs:
7371
7472 if (event_name === "push" && ref_type === "branch") {
7573 const {data: pulls} = await github.rest.pulls.list({ owner, repo, head: `${owner}:${ref_name}`, state: "open" });
76- const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "build -pr-jar "));
74+ const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "publish -pr"));
7775 if (pull) {
7876 result["pr"] = pull.number;
7977 result["action"] = "paperclip";
8078 core.notice(`This is a push action but to a branch with an open PR with the build paperclip label (${JSON.stringify(result)})`);
8179 return result;
8280 }
83- } else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "build -pr-jar ")) {
81+ } else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "publish -pr")) {
8482 result["pr"] = event.pull_request.number;
8583 result["action"] = "paperclip";
8684 core.notice(`This is a pull request action with a build paperclip label (${JSON.stringify(result)})`);
@@ -102,7 +100,7 @@ jobs:
102100 if : always()
103101 uses : actions/upload-artifact@v4
104102 with :
105- name : Test Results (${{ matrix.java }})
103+ name : Test Results
106104 path : |
107105 **/build/test-results/test/TEST-*.xml
108106
@@ -116,6 +114,13 @@ jobs:
116114 with :
117115 name : paper-${{ fromJSON(steps.determine.outputs.result).pr }}
118116 path : paper-server/build/libs/paper-paperclip-*-mojmap.jar
117+
118+ - name : Publish Artifacts
119+ if : fromJSON(steps.determine.outputs.result).action == 'paperclip'
120+ uses : PaperMC/action-pr-publishing/upload@paper
121+ with :
122+ # TODO fallback for failing javadoc
123+ publishing-task : " :paper-api:publishAllPublicationsTo_githubPackages_PRsRepository publishDevBundlePublicationTo_githubPackages_PRsRepository -PpublishDevBundle"
119124 event_file :
120125 name : " Event File"
121126 # Only run on PRs if the source branch is on someone else's repo
0 commit comments