simplify workflows

This commit is contained in:
FlorianMichael 2023-03-03 17:19:12 +01:00
parent 80a51ebed2
commit 42ad790415

View File

@ -8,33 +8,25 @@ on: [pull_request, push, workflow_dispatch]
jobs: jobs:
build: build:
strategy: runs-on: ubuntu-22.04
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps: steps:
- name: checkout repository - uses: actions/checkout@v3
uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1
- name: validate gradle wrapper - uses: actions/setup-java@v3
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with: with:
java-version: ${{ matrix.java }} distribution: 'temurin'
distribution: 'microsoft' java-version: 17
- name: make gradle wrapper executable - uses: actions/cache@v3
if: ${{ runner.os != 'Windows' }} with:
run: chmod +x ./gradlew path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: build - name: build
run: ./gradlew build run: ./gradlew build
- name: capture build artifacts - uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v3
with: with:
name: ViaFabricPlus-Artifacts name: Artifacts
path: build/libs/ path: build/libs/