1
- name : Build Pull Request
1
+ name : Build Remote
2
2
3
- on :
4
- pull_request :
5
- merge_group :
3
+ on :
4
+ workflow_call :
5
+ inputs :
6
+ repository :
7
+ required : true
8
+ description : ' The repo of the remote'
9
+ type : string
10
+ ref :
11
+ required : true
12
+ description : ' The ref of the remote'
13
+ type : string
14
+
15
+ permissions : {}
6
16
7
17
jobs :
8
18
build :
9
19
runs-on : ubuntu-latest
10
20
steps :
21
+ - name : Set Build Number
22
+ run : |
23
+ echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
24
+
11
25
- name : Set up JDK 17
12
26
# See https://github.com/actions/setup-java/commits
13
27
uses : actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
14
28
with :
15
29
java-version : 17
16
30
distribution : temurin
17
31
18
- - name : Check if the author has forked the API repo
19
- # See https://github.com/Kas-tle/find-forks-action/commits
20
- uses : Kas-tle/find-forks-action@1b5447d1e3c7a8ed79583dd817cc5399686eed3a
21
- id : find_forks
22
- with :
23
- owner : GeyserMC
24
- repo : api
25
- token : ${{ secrets.GITHUB_TOKEN }}
26
-
27
- - name : Use author's API repo if it exists
28
- if : ${{ steps.find_forks.outputs.target_branch_found == 'true' }}
29
- env :
30
- API_FORK_URL : ${{ steps.find_forks.outputs.user_fork_url }}
31
- API_FORK_BRANCH : ${{ github.event.pull_request.head.ref }}
32
- run : |
33
- git clone "${API_FORK_URL}" --single-branch --branch "${API_FORK_BRANCH}" api
34
- cd api
35
- ./gradlew publishToMavenLocal
36
-
37
32
- name : Checkout repository and submodules
38
33
# See https://github.com/actions/checkout/commits
39
34
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
40
35
with :
36
+ repository : ${{ inputs.repository }}
37
+ ref : ${{ inputs.ref }}
41
38
submodules : recursive
42
39
path : geyser
43
40
@@ -46,11 +43,12 @@ jobs:
46
43
uses : gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
47
44
48
45
- name : Build Geyser
49
- # See https://github.com/gradle/gradle-build-action /commits
50
- uses : gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 from https://github.com/gradle/actions/commits
46
+ # See https://github.com/gradle/actions /commits
47
+ uses : gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
51
48
with :
52
49
arguments : build
53
50
build-root-directory : geyser
51
+ cache-read-only : true
54
52
55
53
- name : Archive artifacts (Geyser Fabric)
56
54
# See https://github.com/actions/upload-artifact/commits
@@ -101,22 +99,4 @@ jobs:
101
99
with :
102
100
name : Geyser ViaProxy
103
101
path : geyser/bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
104
- if-no-files-found : error
105
-
106
- - name : Trigger Preview Deployment
107
- if : >-
108
- contains(github.event.pull_request.labels.*.name, 'PR: Needs Testing')
109
- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
110
- with :
111
- script : |
112
- github.rest.actions.createWorkflowDispatch({
113
- owner: context.repo.owner,
114
- repo: context.repo.repo,
115
- workflow_id: 'preview.yml',
116
- ref: 'master',
117
- inputs: {
118
- runId: '${{ github.run_id }}',
119
- build: '${{ github.run_number }}',
120
- version: 'pr.${{ github.event.pull_request.number }}'
121
- }
122
- });
102
+ if-no-files-found : error
0 commit comments