Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PR workflow #5

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 61 additions & 5 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,64 @@ on:

jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 21
gradle_tasks: makeModuleMetadata
jar_compatibility: false
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

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
Loading