Skip to content

Add GitHub Actions workflow for building JARs #1

Add GitHub Actions workflow for building JARs

Add GitHub Actions workflow for building JARs #1

Workflow file for this run

name: Build JARs
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # utile si ton build calcule une version via tags/commits
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Setup Gradle cache
uses: gradle/actions/setup-gradle@v4
- name: Ensure gradlew is executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew --no-daemon clean build -x test
- name: Collect jars
run: |
mkdir -p artifacts
find . -path "*/build/libs/*.jar" \
! -name "*-sources.jar" \
! -name "*-javadoc.jar" \
-exec cp {} artifacts/ \;
ls -lah artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: jars-${{ github.sha }}
path: artifacts/*.jar
if-no-files-found: error
retention-days: 14