Files
calc/.gitea/workflows/build.yml
angel cfa433fd90
Some checks failed
Build the Jar / build (push) Failing after 11s
fixed build process and added project configuration files from idea
2025-12-14 08:22:47 -06:00

55 lines
1.3 KiB
YAML

name: Build the Jar
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 20
uses: actions/setup-java@v5
with:
java-version: '20'
distribution: 'temurin'
- name: Create output directories
run: |
mkdir -p out/production/Calc
mkdir -p dist
- name: Compile Java files
run: |
javac -encoding UTF-8 -cp "lib/flatlaf-3.7.jar" -d out/production/Calc \
$(find src/main/java -name "*.java")
- name: Copy resources
run: |
if [ -d "src/main/resources" ]; then
cp -r src/main/resources/* out/production/Calc/ 2>/dev/null || true
fi
- name: Create manifest
run: |
echo "Manifest-Version: 1.0" > manifest.txt
echo "Main-Class: dev.sillyangel.calc.Calculator" >> manifest.txt
echo "Class-Path: lib/flatlaf-3.7.jar" >> manifest.txt
- name: Create JAR
run: |
cd out/production/Calc
jar cfm ../../../dist/CalcShortforCalculator.jar ../../../manifest.txt .
cd ../../..
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: CalcShortforCalculator
path: dist/CalcShortforCalculator.jar