Skip to content

Commit f28dd62

Browse files
committed
Merge and update copyright
2 parents a9c5e30 + 8df56d8 commit f28dd62

File tree

432 files changed

+8991
-1176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+8991
-1176
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- '**'
77

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
118
jobs:
129
check-runner:
1310
name: Check Runner Availability
@@ -45,6 +42,10 @@ jobs:
4542
echo "runner-label=ubuntu-latest" >> $GITHUB_OUTPUT
4643
fi
4744
build:
45+
concurrency:
46+
group: ${{ github.workflow }}-${{ github.ref }}
47+
cancel-in-progress: true
48+
4849
needs: check-runner
4950
runs-on: ${{ needs.check-runner.outputs.runner-label }}
5051

@@ -111,7 +112,7 @@ jobs:
111112
112113
#### [API (Developer Dependency)](https://r2-bucket.edouard127.christmas/${{ env.DATE }}-${{ env.COMMIT_HASH }}/lambda-api-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}-${{ env.COMMIT_HASH }}.jar)
113114
114-
- **Runner:** \`${{ needs.check-runner.outputs.runner-label }}\`
115+
**Runner:** \`${{ needs.check-runner.outputs.runner-label }}\`
115116
EOF
116117
117118
- name: Failover Upload

.github/workflows/close_stale.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/publish-docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Dokka Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: '17'
20+
21+
- name: Build Dokka Documentation
22+
run: ./gradlew dokkaHtmlMultiModule
23+
24+
- name: Upload Documentation Artifact
25+
uses: actions/upload-pages-artifact@v1
26+
with:
27+
path: 'build/dokka/htmlMultiModule'
28+
29+
deploy:
30+
needs: build
31+
runs-on: ubuntu-latest
32+
environment:
33+
name: github-pages
34+
url: ${{ steps.deployment.outputs.page_url }}
35+
permissions:
36+
pages: write
37+
id-token: write
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v1
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Maven Artifacts
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
check-runner:
10+
name: Check Runner Availability
11+
runs-on: ubuntu-latest
12+
13+
outputs:
14+
runner-label: ${{ steps.set-runner.outputs.runner-label }}
15+
16+
steps:
17+
- name: Set runner
18+
id: set-runner
19+
run: |
20+
runners=$(curl -v -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners" --http1.1)
21+
if [ $? -ne 0 ]; then
22+
echo "Error: Failed to fetch runners from GitHub API" >&2
23+
exit 1
24+
fi
25+
26+
runners_count=$(echo "$runners" | jq '.runners | length')
27+
if [ "$runners_count" -eq 0 ]; then
28+
echo "No runners available or failed to retrieve runners." >&2
29+
echo "runner-label=ubuntu-latest" >> $GITHUB_OUTPUT
30+
exit 0
31+
fi
32+
33+
available=$(echo "$runners" | jq '.runners[] | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
34+
if [ $? -ne 0 ]; then
35+
echo "Error: Failed to parse JSON response" >&2
36+
exit 1
37+
fi
38+
39+
if [ -n "$available" ]; then
40+
echo "runner-label=lambda-linux-runner" >> $GITHUB_OUTPUT
41+
else
42+
echo "runner-label=ubuntu-latest" >> $GITHUB_OUTPUT
43+
fi
44+
45+
publish:
46+
concurrency:
47+
group: ${{ github.workflow }}-${{ github.ref }}
48+
cancel-in-progress: true
49+
50+
needs: check-runner
51+
runs-on: ${{ needs.check-runner.outputs.runner-label }}
52+
53+
name: Publish artifacts to maven
54+
55+
steps:
56+
- name: Checkout Repository
57+
uses: actions/checkout@v4
58+
59+
- name: Set up JDK 17
60+
uses: actions/setup-java@v4
61+
with:
62+
distribution: 'temurin'
63+
java-version: '17'
64+
65+
- name: Publish to Maven
66+
run: ./gradlew publish -PreposiliteUsername=${{ secrets.MAVEN_USER }} -PreposilitePassword=${{ secrets.MAVEN_TOKEN }}

.github/workflows/release.yml

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
tags:
66
- '*'
77

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: true
11-
128
jobs:
139
check-runner:
1410
name: Check Runner Availability
@@ -46,6 +42,10 @@ jobs:
4642
echo "runner-label=ubuntu-latest" >> $GITHUB_OUTPUT
4743
fi
4844
build:
45+
concurrency:
46+
group: ${{ github.workflow }}-${{ github.ref }}
47+
cancel-in-progress: true
48+
4949
needs: check-runner
5050
runs-on: ${{ needs.check-runner.outputs.runner-label }}
5151

@@ -58,13 +58,6 @@ jobs:
5858
- name: Checkout Repository
5959
uses: actions/checkout@v4.1.1
6060

61-
- name: Set current date as env variable
62-
run: echo "DATE=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
63-
64-
- name: Get Short Commit Hash
65-
id: vars
66-
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
67-
6861
- name: Set-Up JDK 17
6962
uses: actions/setup-java@v4
7063
with:
@@ -83,41 +76,14 @@ jobs:
8376
- name: Build Lambda
8477
run: ./gradlew build
8578

86-
- name: Upload Lambda Fabric
87-
uses: ryand56/r2-upload-action@latest
88-
with:
89-
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
90-
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY }}
91-
r2-secret-access-key: ${{ secrets.R2_ACCESS_SECRET }}
92-
r2-bucket: ${{ secrets.R2_BUCKET_NAME }}
93-
source-dir: './fabric/build/libs/lambda-fabric-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar'
94-
destination-dir: ${{ env.DATE }}-${{ env.COMMIT_HASH }}
95-
96-
- name: Upload Lambda Forge
97-
uses: ryand56/r2-upload-action@latest
98-
with:
99-
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
100-
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY }}
101-
r2-secret-access-key: ${{ secrets.R2_ACCESS_SECRET }}
102-
r2-bucket: ${{ secrets.R2_BUCKET_NAME }}
103-
source-dir: './forge/build/libs/lambda-forge-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar'
104-
destination-dir: ${{ env.DATE }}-${{ env.COMMIT_HASH }}
105-
106-
- name: Upload Lambda API
107-
uses: ryand56/r2-upload-action@latest
108-
with:
109-
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
110-
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY }}
111-
r2-secret-access-key: ${{ secrets.R2_ACCESS_SECRET }}
112-
r2-bucket: ${{ secrets.R2_BUCKET_NAME }}
113-
source-dir: './common/build/libs/lambda-api-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar'
114-
destination-dir: ${{ env.DATE }}-${{ env.COMMIT_HASH }}
115-
11679
- name: Create Release
11780
uses: softprops/action-gh-release@v2.0.8
11881
with:
11982
name: Lambda ${{ github.ref_name }}
12083
tag_name: ${{ github.ref_name }}
84+
generate_release_notes: true
85+
append_body: true
86+
make_latest: "true"
12187
files: |
12288
fabric/build/libs/lambda-fabric-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar
12389
forge/build/libs/lambda-forge-${{ steps.all.outputs.modVersion }}+${{ steps.all.outputs.minecraftVersion }}.jar

.idea/copyright/Lambda_GNU_v3.xml

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

.idea/copyright/profiles_settings.xml

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

.idea/scopes/Copyright.xml

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

build.gradle.kts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1+
/*
2+
* Copyright 2024 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
import org.gradle.internal.jvm.*
119
import net.fabricmc.loom.api.LoomGradleExtensionAPI
20+
import org.apache.tools.ant.taskdefs.condition.Os
221
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22+
import java.io.FileNotFoundException
323
import java.util.*
424

525
val modId: String by project
@@ -23,6 +43,7 @@ plugins {
2343
id("architectury-plugin") version "3.4-SNAPSHOT"
2444
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
2545
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
46+
id("maven-publish")
2647
}
2748

2849
architectury {
@@ -32,15 +53,50 @@ architectury {
3253
subprojects {
3354
apply(plugin = "dev.architectury.loom")
3455
apply(plugin = "org.jetbrains.dokka")
56+
apply(plugin = "maven-publish")
3557

3658
dependencies {
3759
"minecraft"("com.mojang:minecraft:$minecraftVersion")
3860
"mappings"("net.fabricmc:yarn:$minecraftVersion+$yarnMappings:v2")
3961
}
4062

63+
publishing {
64+
publications {
65+
register<MavenPublication>("maven") {
66+
groupId = mavenGroup
67+
artifactId = if (project.name == "common") modId else "$modId-${project.name}"
68+
version = "$modVersion+$minecraftVersion"
69+
70+
from(components["java"])
71+
}
72+
}
73+
74+
repositories {
75+
maven {
76+
name = "reposilite"
77+
url = uri("https://maven.lambda-client.org/lambda")
78+
credentials(PasswordCredentials::class)
79+
authentication {
80+
create<BasicAuthentication>("basic")
81+
}
82+
}
83+
}
84+
}
85+
4186
if (path == ":common") return@subprojects
4287

4388
tasks {
89+
register<Exec>("renderDoc") {
90+
val javaHome = Jvm.current().javaHome
91+
val gradleWrapper = rootProject.tasks.wrapper.get().jarFile.absolutePath
92+
93+
commandLine = listOf(
94+
findExecutable("renderdoccmd")
95+
?: throw FileNotFoundException("Could not find the renderdoccmd executable"),
96+
"capture", /* Remove the following 2 lines if you don't want api validation */ "--opt-api-validation", "--opt-api-validation-unmute", "--opt-hook-children", "--wait-for-exit", "--working-dir", ".", "$javaHome/bin/java", "-Xmx64m", "-Xms64m", /*"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005",*/ "-Dorg.gradle.appname=gradlew", "-Dorg.gradle.java.home=$javaHome", "-classpath", gradleWrapper, "org.gradle.wrapper.GradleWrapperMain", "${this@subprojects.path}:runClient",
97+
)
98+
}
99+
44100
processResources {
45101
// Replaces placeholders in the mod info files
46102
filesMatching(targets) {
@@ -93,3 +149,10 @@ allprojects {
93149
}
94150
}
95151
}
152+
153+
private fun findExecutable(executable: String): String? {
154+
val isWindows = Os.isFamily(Os.FAMILY_WINDOWS)
155+
val cmd = if (isWindows) "where" else "which"
156+
157+
return ProcessBuilder(cmd, executable).start().inputStream.bufferedReader().readText().trim().takeIf { it.isNotBlank() }
158+
}

common/build.gradle.kts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2024 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
118
val modVersion: String by project
219
val minecraftVersion: String by project
320
val modId: String by project
@@ -32,7 +49,7 @@ dependencies {
3249
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
3350

3451
// Baritone
35-
modImplementation("baritone-api:baritone-unoptimized-fabric:1.10.2")
52+
modImplementation("baritone-api:baritone-unoptimized-fabric:1.10.2") { isTransitive = false }
3653
}
3754

3855
tasks {

0 commit comments

Comments
 (0)