-
-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (72 loc) · 2.08 KB
/
build-prs.yml
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
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/a65628b0c89dec60b357ce3f8f6bfa62934b8357/src/actionsTemplate/resources/.github/workflows/build-prs.yml
name: Build and test PRs
on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
version:
- 1.7.10
- 1.10.2
- 1.12.2
- 1.16.5
- 1.18.2
- 1.19.2
- 1.20.1
- 1.21.1
- 1.21.4
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java ${{ inputs.java }}
uses: neoforged/actions/setup-java@main
with:
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- name: Build with Gradle
run: ./gradlew publish -PminecraftVersion=${{ matrix.version }}
- name: Store repository
uses: actions/upload-artifact@v4
with:
name: repo-${{ matrix.version }}
path: repo
merge-repos:
name: Merge Maven Repositories
runs-on: ubuntu-latest
needs: build
if: success() || failure()
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: repo-*
path: repo
merge-multiple: true
# the maven-metadata will only be from a single repo and thus wrong
- name: Remove incorrect maven-metadata files
run: find -name maven-metadata.xml* -exec rm {} \;
- name: Upload repository for manual consumption
uses: actions/upload-artifact@v4
with:
name: repo
path: repo
- name: Upload repository for PR-Publishing
uses: actions/upload-artifact@v4
with:
name: maven-publish
path: repo