Skip to content

Improve code style #143

Improve code style

Improve code style #143

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
pull-requests: write
jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Define Versions
id: versions
run: |
versions="["
for item in $(ls mc); do
versions+="\"$item\", "
done
versions="${versions%,*}]"
echo "versions=$versions" >> "$GITHUB_OUTPUT"
build:
needs: define-versions
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.define-versions.outputs.versions) }}
name: Build ${{ matrix.version }}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary-as-pr-comment: on-failure
- name: Generate ${{ matrix.version }}
run: ./gradlew :mc:${{ matrix.version }}:runServer --stacktrace
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: data-${{ matrix.version }}
path: mc/${{ matrix.version }}/run/server/minecraft-data
if-no-files-found: error
repackage:
needs: build
name: Repackage versions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: merged-data
path: artifacts/*
if-no-files-found: error