commit 68b22e73024a630145245ddbb1fbec935b505ca0 Author: amos Date: Tue Jun 2 10:33:12 2026 +0800 Initial simple Java project diff --git a/.gitea/workflows/java-build.yml b/.gitea/workflows/java-build.yml new file mode 100644 index 0000000..87310e1 --- /dev/null +++ b/.gitea/workflows/java-build.yml @@ -0,0 +1,26 @@ +name: Java Build + +on: + push: + branches: [ main, master ] + workflow_dispatch: + +jobs: + build: + runs-on: android + + steps: + - uses: actions/checkout@v4 + + - name: Build with Gradle + run: | + java -version + gradle --version + gradle build --no-daemon + echo "构建成功!" + + - name: Upload JAR + uses: actions/upload-artifact@v4 + with: + name: hello-world + path: build/libs/*.jar diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..11d9df9 --- /dev/null +++ b/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'java' +} + +group = 'com.example' +version = '1.0' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation 'junit:junit:4.13.2' +} + +jar { + manifest { + attributes 'Main-Class': 'com.example.HelloWorld' + } +} diff --git a/src/main/java/com/example/HelloWorld.java b/src/main/java/com/example/HelloWorld.java new file mode 100644 index 0000000..138e3e7 --- /dev/null +++ b/src/main/java/com/example/HelloWorld.java @@ -0,0 +1,7 @@ +package com.example; + +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello from Gitea Actions!"); + } +}