add package uploading

This commit is contained in:
TopchetoEU 2025-01-24 02:45:26 +02:00
parent 1e982cd2ef
commit 6125772038
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
9 changed files with 39 additions and 10 deletions

View File

@ -25,10 +25,14 @@ jobs:
gradle-version: "8.10" gradle-version: "8.10"
- name: Build - name: Build
run: gradle build run: gradle build
- name: Publish
run: gradle publish
env:
ACCESS_TOKEN: "${{github.token}}"
REPO_URL: "${{github.api_url}}/packages/${{github.repository_owner}}/maven"
- name: Create release - name: Create release
uses: "https://gitea.com/actions/gitea-release-action@main" uses: "https://gitea.com/actions/gitea-release-action@main"
with: with:
# api_key: "${{secrets.TOKEN}}"
files: | files: |
LICENSE LICENSE
build/libs/*.jar build/libs/*.jar

View File

@ -9,4 +9,7 @@ java {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(17); languageVersion = JavaLanguageVersion.of(17);
} }
withJavadocJar();
withSourcesJar();
} }

View File

@ -1,5 +1,6 @@
plugins { plugins {
id("java"); id("java");
id("maven-publish");
} }
version = rootProject.version; version = rootProject.version;
@ -20,3 +21,27 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2"); testImplementation("org.junit.jupiter:junit-jupiter:5.9.2");
testRuntimeOnly("org.junit.platform:junit-platform-launcher"); testRuntimeOnly("org.junit.platform:junit-platform-launcher");
} }
publishing {
repositories {
maven {
name = "Gitea";
url = uri(System.getenv("REPO_URL") ?: "");
credentials(HttpHeaderCredentials::class) {
name = "Authorization";
value = "token ${System.getenv("ACCESS_TOKEN")}";
}
authentication {
create<HttpHeaderAuthentication>("header");
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"]);
}
}
}

View File

@ -32,7 +32,7 @@ public final class FunctionScope {
} }
/** /**
* @returns If a variable with the same name exists, the old variable. Otherwise, the given variable * @return If a variable with the same name exists, the old variable. Otherwise, the given variable
*/ */
public Variable define(Variable var) { public Variable define(Variable var) {
if (passthrough) return null; if (passthrough) return null;
@ -48,7 +48,7 @@ public final class FunctionScope {
} }
/** /**
* @returns A variable with the given name, or null if a global variable * @return A variable with the given name, or null if a global variable
*/ */
public Variable define(String name) { public Variable define(String name) {
return define(new Variable(name, false)); return define(new Variable(name, false));

View File

@ -175,7 +175,7 @@ public final class VariableList implements Iterable<Variable> {
this.offset = () -> offset; this.offset = () -> offset;
} }
/** /**
* @param offset Will offset the indices by the size of the given list * @param prev Will offset the indices by the size of the given list
*/ */
public VariableList(IndexType type, VariableList prev) { public VariableList(IndexType type, VariableList prev) {
this.indexType = type; this.indexType = type;

View File

@ -1,4 +1,4 @@
project_group = me.topchetoeu project_group = me.topchetoeu.j2s
project_name = j2s project_name = j2s
project_version = 0.10.5-beta project_version = 0.10.5-beta
main_class = me.topchetoeu.j2s.repl.SimpleRepl main_class = me.topchetoeu.j2s.repl.SimpleRepl

View File

@ -31,8 +31,6 @@ public interface DebugHandler {
* Called when a script has been loaded * Called when a script has been loaded
* @param filename The name of the source * @param filename The name of the source
* @param source The name of the source * @param source The name of the source
* @param breakpoints A set of all the breakpointable locations in this source
* @param map The source map associated with this file. null if this source map isn't mapped
*/ */
public void onSourceLoad(Filename filename, String source); public void onSourceLoad(Filename filename, String source);

View File

@ -429,7 +429,6 @@ public abstract class Value {
} }
} }
/** @internal */
public List<String> toReadableLines(Environment env, HashSet<ObjectValue> passed) { public List<String> toReadableLines(Environment env, HashSet<ObjectValue> passed) {
return Arrays.asList(toString(env)); return Arrays.asList(toString(env));
} }

View File

@ -9,7 +9,7 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"; id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0";
} }
// rootProject.name = properties.project_name; rootProject.name = extra.properties["project_name"].toString();
include(":lib"); include(":lib");
include(":common"); include(":common");