Skip to content

Commit a958a05

Browse files
committed
Build/CI/Docker: add GHCR publish workflow; update README with GHCR usage; add MIT LICENSE; standardize Java 25; keep personal docs uncommitted; add devcontainer and Dockerfile; enable CI and Release workflows
1 parent 1043ddb commit a958a05

File tree

22 files changed

+771
-58
lines changed

22 files changed

+771
-58
lines changed

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "TerminalChess Dev (Java 25)",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
"features": {
5+
"ghcr.io/devcontainers/features/java:1": {
6+
"version": "25",
7+
"jdkDistro": "temurin"
8+
}
9+
},
10+
"postCreateCommand": "bash -lc 'chmod +x ./gradlew 2>/dev/null || true; ./gradlew --version || true'",
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"java.configuration.runtimes": [
15+
{ "name": "JavaSE-25", "path": "/usr/lib/jvm/temurin-25-jdk" }
16+
]
17+
},
18+
"extensions": [
19+
"vscjava.vscode-java-pack",
20+
"fwcd.kotlin"
21+
]
22+
}
23+
}
24+
}

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git
2+
.gitignore
3+
.gradle
4+
build
5+
out
6+
.idea
7+
*.iml
8+
.DS_Store
9+
Thumbs.db
10+
*.log

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build:
11+
name: Build (JDK 25 on ${{ matrix.os }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ windows-latest, ubuntu-latest, macos-latest ]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Temurin JDK 25
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: 'temurin'
26+
java-version: '25'
27+
28+
# Use wrapper if present; otherwise fall back to provisioned Gradle 9.2.1
29+
- name: Make gradlew executable (non-Windows)
30+
if: hashFiles('gradlew') != '' && runner.os != 'Windows'
31+
run: chmod +x ./gradlew
32+
33+
- name: Build with Gradle Wrapper (Unix)
34+
if: hashFiles('gradlew') != '' && runner.os != 'Windows'
35+
run: |
36+
./gradlew --version
37+
./gradlew build --no-daemon
38+
./gradlew shadowJar --no-daemon
39+
40+
- name: Build with Gradle Wrapper (Windows)
41+
if: hashFiles('gradlew.bat') != '' && runner.os == 'Windows'
42+
run: |
43+
./gradlew.bat --version
44+
./gradlew.bat build --no-daemon
45+
./gradlew.bat shadowJar --no-daemon
46+
47+
- name: Set up Gradle 9.2.1 (fallback when no wrapper)
48+
if: hashFiles('gradlew') == '' && hashFiles('gradlew.bat') == ''
49+
uses: gradle/actions/setup-gradle@v4
50+
with:
51+
gradle-version: '9.2.1'
52+
53+
- name: Build with Gradle CLI (fallback)
54+
if: hashFiles('gradlew') == '' && hashFiles('gradlew.bat') == ''
55+
run: |
56+
gradle --version
57+
gradle build --no-daemon
58+
gradle shadowJar --no-daemon
59+
60+
- name: Upload runnable JAR
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: terminalchess-${{ matrix.os }}-jdk25
64+
path: |
65+
build/libs/*all.jar
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docker Release (GHCR)
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GHCR
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build and push image
27+
uses: docker/build-push-action@v6
28+
with:
29+
context: .
30+
push: true
31+
tags: |
32+
ghcr.io/${{ github.repository_owner }}/terminalchess:latest
33+
ghcr.io/${{ github.repository_owner }}/terminalchess:${{ github.ref_name }}

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Temurin JDK 25
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '25'
23+
24+
- name: Make gradlew executable
25+
run: chmod +x ./gradlew
26+
27+
- name: Build fat JAR
28+
run: |
29+
./gradlew --version
30+
./gradlew clean shadowJar --no-daemon
31+
32+
- name: Create GitHub Release
33+
id: create_release
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
draft: false
37+
prerelease: false
38+
files: |
39+
build/libs/*all.jar
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
### IntelliJ IDEA ###
2-
out/
3-
!**/src/main/**/out/
4-
!**/src/test/**/out/
1+
# Gradle
2+
.gradle/
3+
build/
54

6-
### Eclipse ###
7-
.apt_generated
8-
.classpath
9-
.factorypath
10-
.project
11-
.settings
12-
.springBeans
13-
.sts4-cache
14-
bin/
15-
!**/src/main/**/bin/
16-
!**/src/test/**/bin/
5+
# IntelliJ / IDEA
6+
# Keep project files, but ignore volatile ones if added
7+
.idea/workspace.xml
8+
.idea/tasks.xml
9+
.idea/usage.statistics.xml
10+
.idea/dictionaries/
11+
.idea/AndroidProjectSystem.xml
1712

18-
### NetBeans ###
19-
/nbproject/private/
20-
/nbbuild/
21-
/dist/
22-
/nbdist/
23-
/.nb-gradle/
13+
# Kotlin/Java outputs
14+
out/
2415

25-
### VS Code ###
26-
.vscode/
16+
# OS
17+
.DS_Store
18+
Thumbs.db
2719

28-
### Mac OS ###
29-
.DS_Store
20+
# Logs
21+
*.log

.idea/kotlinc.xml

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/KotlinJavaRuntime.xml

Lines changed: 10 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)