Skip to content

Sync with template v23 #525

Sync with template v23

Sync with template v23 #525

Workflow file for this run

# Builds the project, as a first line of defense against bad commits.
name: Check Build
permissions:
id-token: write
attestations: write
on:
push:
paths: [
'.github/workflows/check-build.yml',
'**src/**',
'**/*gradle*'
]
pull_request:
paths: [
'.github/workflows/check-build.yml',
'**src/**',
'**/*gradle*'
]
schedule:
# At 00:00 UTC on the second day of every second month.
- cron: '0 0 2 */2 *'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
java: [
25
]
os: [
ubuntu-latest
]
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository under $GITHUB_WORKSPACE, so the workflow can access it.
# https://github.com/actions/checkout
- name: Checkout sources
uses: actions/checkout@v6
# Setup Java for the build.
# https://github.com/actions/setup-java
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java }}
# Setup Gradle for the build.
# https://github.com/gradle/actions/blob/main/setup-gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Make Gradle wrapper executable
if: runner.os != 'Windows'
run: chmod +x ./gradlew
# Build the project.
- name: Build project
shell: bash
run: ./gradlew build --stacktrace
# Upload build artifacts to the workflow report.
# This is fail-soft if no matching file exists.
# https://github.com/actions/upload-artifact
- name: Upload Fabric jar
uses: actions/upload-artifact@v7
with:
archive: false
path: |
fabric/build/libs/*.jar
!**/**-sources.jar
- name: Upload Fabric sources jar
uses: actions/upload-artifact@v7
with:
archive: false
path: fabric/build/libs/*-sources.jar
- name: Upload NeoForge jar
uses: actions/upload-artifact@v7
with:
archive: false
path: |
neoforge/build/libs/*.jar
!**/**-sources.jar
- name: Upload NeoForge sources jar
uses: actions/upload-artifact@v7
with:
archive: false
path: neoforge/build/libs/*-sources.jar
# Attest artifacts
# https://github.com/actions/attest
- name: Generate artifact attestation
uses: actions/attest@v4
with:
subject-path: |
**/build/libs/*.jar
!buildSrc/**
!common/**