mirror of
https://github.com/Mr-dayhappy/Minecraft-place-mod.git
synced 2026-10-23 01:53:39 +08:00
ci: 新增 GitHub Actions 编译与发布 workflow
build.yml:push/PR 到 main 及手动触发时编译,产物上传 artifact。release.yml:push v* tag 或手动触发时构建并发 GitHub Release,版本号从 tag 推导(v0.1 → 0.1),用 -Pmod_version 覆盖。均用 JDK 25(temurin),直接 ./gradlew,不依赖额外 action。
This commit is contained in:
1 parent
81521df92b
commit
3cd76bcbba
2 files changed
+90
No files matched your search
@@ -0,0 +1,34 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '25'
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build --stacktrace
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mod-jar
|
||||
path: build/libs/*.jar
|
||||
if-no-files-found: error
|
||||
Reference in new issue
Block a user