-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.08 KB
/
ci.yml
File metadata and controls
71 lines (60 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
# Ensure only the latest run per branch/PR remains active.
# This reduces duplicate notifications when pushing multiple commits quickly.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (JDK 25 on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Temurin JDK 25
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
# Use wrapper if present; otherwise fall back to provisioned Gradle 9.2.1
- name: Make gradlew executable (non-Windows)
if: hashFiles('gradlew') != '' && runner.os != 'Windows'
run: chmod +x ./gradlew
- name: Build with Gradle Wrapper (Unix)
if: hashFiles('gradlew') != '' && runner.os != 'Windows'
run: |
./gradlew --version
./gradlew build --no-daemon
./gradlew shadowJar --no-daemon
- name: Build with Gradle Wrapper (Windows)
if: hashFiles('gradlew.bat') != '' && runner.os == 'Windows'
run: |
./gradlew.bat --version
./gradlew.bat build --no-daemon
./gradlew.bat shadowJar --no-daemon
- name: Set up Gradle 9.2.1 (fallback when no wrapper)
if: hashFiles('gradlew') == '' && hashFiles('gradlew.bat') == ''
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: '9.2.1'
- name: Build with Gradle CLI (fallback)
if: hashFiles('gradlew') == '' && hashFiles('gradlew.bat') == ''
run: |
gradle --version
gradle build --no-daemon
gradle shadowJar --no-daemon
- name: Upload runnable JAR
uses: actions/upload-artifact@v4
with:
name: terminalchess-${{ matrix.os }}-jdk25
path: |
build/libs/*all.jar