Skip to content

Commit f4a2fd7

Browse files
committed
chore: add initial project configuration files and CI workflows
1 parent f15cb53 commit f4a2fd7

11 files changed

Lines changed: 6832 additions & 10 deletions

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @OneLiteFeatherNET/titan-maintainers
2+
/.github/CODEOWNERS @OneLiteFeatherNET/core-team

.github/workflows/build-pr.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build PR
2+
on: [pull_request]
3+
jobs:
4+
build_pr:
5+
if: github.repository_owner == 'OneLiteFeatherNET'
6+
name: Build Pull Request Branch
7+
runs-on: ${{ matrix.os }}
8+
env:
9+
ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }}
10+
ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
- name: Setup Java
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 24
22+
- name: Setup Gradle
23+
uses: gradle/actions/setup-gradle@v4
24+
- name: Build on ${{ matrix.os }}
25+
run: ./gradlew clean build test
26+
- name: Generate JaCoCo Coverage Report
27+
if: matrix.os == 'ubuntu-latest'
28+
run: ./gradlew jacocoRootReport
29+
- name: Upload Coverage Report
30+
if: matrix.os == 'ubuntu-latest'
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: jacoco-report
34+
path: |
35+
build/reports/jacoco/jacocoRootReport/html/
36+
build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
37+
- name: Upload Coverage to Codecov
38+
if: matrix.os == 'ubuntu-latest'
39+
uses: codecov/codecov-action@v5
40+
with:
41+
file: build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
42+
fail_ci_if_error: false
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
comment: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Close invalid PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [ opened ]
6+
7+
jobs:
8+
run:
9+
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'main' }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: superbrothers/close-pull-request@v3
13+
with:
14+
comment: "Please do not open pull requests from the `main` branch, create a new branch instead."
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
"on":
3+
push:
4+
branches:
5+
- main
6+
- next
7+
- beta
8+
- "*.x"
9+
10+
permissions:
11+
contents: read # for checkout
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # to be able to publish a GitHub release
19+
issues: write # to be able to comment on released issues
20+
pull-requests: write # to be able to comment on released pull requests
21+
id-token: write # to enable use of OIDC for npm provenance
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "lts/*"
31+
- name: Validate Gradle Wrapper
32+
uses: gradle/actions/wrapper-validation@v4
33+
- name: Setup Java
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: 24
38+
- name: Setup Gradle
39+
uses: gradle/actions/setup-gradle@v4
40+
- name: Install dependencies
41+
run: npm clean-install
42+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
43+
run: npm audit signatures
44+
- name: Release
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }}
49+
ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }}
50+
run: npx semantic-release

.releaserc.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"plugins": [
3+
[
4+
"@semantic-release/commit-analyzer",
5+
{
6+
"preset": "conventionalcommits"
7+
}
8+
],
9+
"@semantic-release/release-notes-generator",
10+
[
11+
"@semantic-release/exec",
12+
{
13+
"verifyConditionsCmd": "./gradlew check",
14+
"publishCmd": "./gradlew -Pversion=${nextRelease.version} publish"
15+
}
16+
],
17+
"@semantic-release/git",
18+
[
19+
"@semantic-release/github",
20+
{
21+
"assets": [
22+
{
23+
"path": "app/build/libs/app-titan.jar"
24+
},
25+
{
26+
"path": "setup/build/libs/setup-titan.jar"
27+
}
28+
],
29+
"labels": false,
30+
"failTitle": false,
31+
"failComment": false,
32+
"successComment": false,
33+
"releasedLabels": false,
34+
"addReleases": false
35+
}
36+
]
37+
]
38+
}

build.gradle.kts

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,88 @@
11
plugins {
2-
id("java")
2+
java
3+
jacoco
4+
`maven-publish`
35
}
4-
5-
group = "net.onelitefeather.vulpes"
6-
version = "1.0-SNAPSHOT"
7-
86
repositories {
97
mavenCentral()
108
}
119

1210
dependencies {
13-
testImplementation(platform("org.junit:junit-bom:5.10.0"))
14-
testImplementation("org.junit.jupiter:junit-jupiter")
11+
implementation(platform(libs.mycelium.bom))
12+
implementation(libs.minestom)
13+
testImplementation(platform(libs.mycelium.bom))
14+
testImplementation(libs.junit.api)
15+
testImplementation(libs.junit.platform.launcher)
16+
testRuntimeOnly(libs.junit.engine)
17+
}
18+
19+
java {
20+
toolchain {
21+
languageVersion.set(JavaLanguageVersion.of(21))
22+
}
23+
withSourcesJar()
24+
withJavadocJar()
25+
1526
}
1627

17-
tasks.test {
18-
useJUnitPlatform()
28+
tasks {
29+
test {
30+
testLogging {
31+
events("passed", "skipped", "failed")
32+
}
33+
}
34+
}
35+
36+
publishing {
37+
publications.create<MavenPublication>("maven") {
38+
from(components["java"])
39+
version = rootProject.version as String
40+
artifactId = "vulpes"
41+
groupId = rootProject.group as String
42+
pom {
43+
name = "Vulpes"
44+
description = "Vulpes for OneLiteFeather"
45+
url = "https://github.com/OneLiteFeatherNET/vulpes"
46+
licenses {
47+
license {
48+
name = "AGPL-3.0"
49+
url = "https://www.gnu.org/licenses/agpl-3.0.en.html"
50+
}
51+
}
52+
developers {
53+
developer {
54+
id = "themeinerlp"
55+
name = "Phillipp Glanz"
56+
email = "p.glanz@madfix.me"
57+
}
58+
developer {
59+
id = "theEvilReaper"
60+
name = "Steffen Wonning"
61+
email = "steffenwx@gmail.com"
62+
}
63+
scm {
64+
connection = "scm:git:git://github.com:OneLiteFeatherNET/vulpes.git"
65+
developerConnection = "scm:git:ssh://git@github.com:OneLiteFeatherNET/vulpes.git"
66+
url = "https://github.com/OneLiteFeatherNET/vulpes"
67+
}
68+
}
69+
}
70+
71+
repositories {
72+
maven {
73+
authentication {
74+
credentials(PasswordCredentials::class) {
75+
// Those credentials need to be set under "Settings -> Secrets -> Actions" in your repository
76+
username = System.getenv("ONELITEFEATHER_MAVEN_USERNAME")
77+
password = System.getenv("ONELITEFEATHER_MAVEN_PASSWORD")
78+
}
79+
}
80+
81+
name = "OneLiteFeatherRepository"
82+
val releasesRepoUrl = uri("https://repo.onelitefeather.dev/onelitefeather-releases")
83+
val snapshotsRepoUrl = uri("https://repo.onelitefeather.dev/onelitefeather-snapshots")
84+
url = if (version.toString().contains("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
85+
}
86+
}
87+
}
1988
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group = net.onelitefeather.vulpes
2+
version = 1.0-SNAPSHOT

0 commit comments

Comments
 (0)