Skip to content

Commit 3163994

Browse files
feat: Added ci and devcontainer json with java 25
1 parent f962bc5 commit 3163994

3 files changed

Lines changed: 116 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "o7studios/gentle",
3+
"image": "ubuntu:latest",
4+
"customizations" : {
5+
"jetbrains" : {
6+
"backend" : "IntelliJ"
7+
}
8+
},
9+
"features": {
10+
"ghcr.io/devcontainers/features/git" : {},
11+
"ghcr.io/devcontainers/features/java:1": {"version": "25", "installGradle": true,}
12+
},
13+
"remoteUser": "ubuntu"
14+
}

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: "⚙️ CI & Release Workflow"
2+
on:
3+
push:
4+
pull_request:
5+
types: [ opened, reopened ]
6+
7+
env:
8+
JAVA_VERSION: '25'
9+
JAVA_DISTRIBUTION: 'temurin'
10+
11+
permissions:
12+
contents: write
13+
packages: write
14+
15+
jobs:
16+
lint:
17+
name: "🧹 Lint Code"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: "📥 Checkout Code (Full History)"
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
25+
- name: "☕ Setup Java ${{ env.JAVA_VERSION }}"
26+
uses: actions/setup-java@v5
27+
with:
28+
distribution: ${{ env.JAVA_DISTRIBUTION }}
29+
java-version: ${{ env.JAVA_VERSION }}
30+
31+
- name: "⚡ Setup Gradle with Cache"
32+
uses: gradle/actions/setup-gradle@v5
33+
34+
- name: "🔍 Run Check"
35+
run: ./gradlew check
36+
37+
test:
38+
name: "✅ Run Tests"
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: "📥 Checkout Code (Full History)"
42+
uses: actions/checkout@v5
43+
with:
44+
fetch-depth: 0
45+
46+
- name: "☕ Setup Java ${{ env.JAVA_VERSION }}"
47+
uses: actions/setup-java@v5
48+
with:
49+
distribution: ${{ env.JAVA_DISTRIBUTION }}
50+
java-version: ${{ env.JAVA_VERSION }}
51+
52+
- name: "⚡ Setup Gradle with Cache"
53+
uses: gradle/actions/setup-gradle@v5
54+
55+
- name: "🧪 Run Unit Tests"
56+
run: ./gradlew test
57+
58+
releaser:
59+
name: "🏁 Release"
60+
if: startsWith(github.ref, 'refs/tags/')
61+
needs:
62+
- test
63+
- lint
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: "📥 Checkout Code (Full History)"
67+
uses: actions/checkout@v5
68+
with:
69+
fetch-depth: 0
70+
71+
- name: "☕ Setup Java ${{ env.JAVA_VERSION }}"
72+
uses: actions/setup-java@v5
73+
with:
74+
distribution: ${{ env.JAVA_DISTRIBUTION }}
75+
java-version: ${{ env.JAVA_VERSION }}
76+
77+
- name: "⚡ Setup Gradle with Cache"
78+
uses: gradle/actions/setup-gradle@v5
79+
80+
- name: "🚀 Publish to Maven Central"
81+
env:
82+
GPG_KEY: ${{ secrets.GPG_KEY }}
83+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
84+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
85+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
86+
run: |
87+
RAW_TAG="${GITHUB_REF##*/}"
88+
VERSION="${RAW_TAG#v}"
89+
90+
[[ "$VERSION" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
91+
./gradlew publishToCentralPortal -Pversion="$VERSION"
92+
93+
- name: "📦 Build all shadowJARs"
94+
run: ./gradlew clean shadowJar
95+
96+
- name: "🚀 Create GitHub Release"
97+
uses: softprops/action-gh-release@v2
98+
with:
99+
files: |
100+
build/libs/*.jar
101+
generate_release_notes: true

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)