Initial simple Java project
Java Build / build (push) Failing after 23s

This commit is contained in:
amos
2026-06-02 10:33:12 +08:00
commit 68b22e7302
3 changed files with 53 additions and 0 deletions
+26
View File
@@ -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
+20
View File
@@ -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'
}
}
@@ -0,0 +1,7 @@
package com.example;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello from Gitea Actions!");
}
}