2024/11/8 修改了依赖库 更新了Metrics 删除了测试语句 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release 🚀 | |
on: | |
push: | |
tags: | |
- 'v*' # 只在版本标签推送时触发 🔔 | |
workflow_dispatch: # 允许手动触发工作流 | |
inputs: | |
tag: | |
description: '发布的版本号' | |
required: true | |
default: 'v1.0.0' # 默认的版本号 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出代码 📥 | |
uses: actions/checkout@v2 | |
- name: 设置 JDK 版本 ☕ | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' # 设置所需的 Java 版本(Minecraft通常使用Java 11) | |
distribution: 'temurin' | |
- name: 构建 Maven 包 🔧 | |
run: mvn -B package --file pom.xml | |
- name: 发布版本 📝 | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.tag }} # 使用手动输入的标签名 | |
name: '${{ github.event.inputs.tag }}' # 项目名 - 标签名 | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 上传插件 JAR 📦 | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.tag }} # 使用手动输入的标签名 | |
files: | | |
target/*.jar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |