ci: 添加自动化构建脚本
All checks were successful
Publish Project / build (push) Successful in 1m39s

This commit is contained in:
2025-06-15 09:29:34 +08:00
parent 8c6af8e95e
commit cfbed99ece
2 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
name: Publish Project
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Build Project
run: chmod +x gradlew && ./gradlew build --no-daemon
- name: Publish to Release
uses: softprops/action-gh-release@v2
with:
files: build/*.jar

View File

@@ -3,6 +3,9 @@
plugins { plugins {
id("java") id("java")
} }
base {
archivesName = "HamsterScript"
}
group = "cn.hamster3.mc.plugin" group = "cn.hamster3.mc.plugin"
version = "1.1.0" version = "1.1.0"
@@ -41,7 +44,6 @@ tasks {
options.encoding = "UTF-8" options.encoding = "UTF-8"
} }
withType<Jar> { withType<Jar> {
archiveBaseName = "HamsterScript"
from(rootProject.file("LICENSE")) from(rootProject.file("LICENSE"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDirectory = rootProject.layout.buildDirectory destinationDirectory = rootProject.layout.buildDirectory