Skip to content

Add GitHub Actions workflow for Gradle build #1

Add GitHub Actions workflow for Gradle build

Add GitHub Actions workflow for Gradle build #1

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build shadowJar
run: ./gradlew shadowJar
- name: Determine jar name
id: jar
shell: bash
run: |
JAR_PATH="$(ls -1 build/libs/*-all.jar | head -n 1)"
JAR_FILE="$(basename "$JAR_PATH")"
echo "path=$JAR_PATH" >> "$GITHUB_OUTPUT"
echo "name=$JAR_FILE" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.jar.outputs.name }}
path: ${{ steps.jar.outputs.path }}
if-no-files-found: error