Skip to content
Open

1 #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/Build.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Minecraft Mod

on:
push:
tags:
- 'v*' # 只在推送 tag 时触发

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Grant execute permission to gradlew
run: chmod +x gradlew # 确保 gradlew 可执行

- name: Build with Gradle
run: ./gradlew build # 使用正确的命令

- name: Upload to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }} # 修正语法
asset_path: build/libs/*.jar
asset_name: MyMod-${{ github.ref_name }}.jar
asset_content_type: application/java-archive
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# gradle

.gradle/
build/
out/

# idea

.idea/*
!.idea/icon.svg
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# fabric

run/
logs/

/changelog.txt
11 changes: 2 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ plugins {
}

group = 'cn.mcsfs'
version = '1.0-SNAPSHOT'

def getVersionName = {
def tag = System.getenv("GITHUB_REF") ?: "v1.0.0"
tag = tag.replace("refs/tags/v", "").replace("refs/tags/", "")
return tag
}
version = '2025.1'

version = getVersionName()

Expand Down Expand Up @@ -58,5 +52,4 @@ processResources {

tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:none"
}

}
2 changes: 1 addition & 1 deletion gradlew → gradle wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"