Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,40 @@ jobs:
path: package/*.mcdr
retention-days: 5

# 3. 发布任务 (仅当构建成功且是 Tag 推送时运行)
# 3. 发布任务 (构建成功后,如果是 Tag 推送或 Main 分支版本更新时运行)
release:
name: Publish Release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Version info
id: version
run: |
VERSION=$(jq -r .version mcdreforged.plugin.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: SakuraFlow-Build
path: package/

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v') || steps.version.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || format('v{0}', env.VERSION) }}
files: package/*.mcdr
generate_release_notes: true
4 changes: 2 additions & 2 deletions mcdreforged.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "sakura_flow",
"version": "0.2.3-preview2",
"version": "0.3.0",
"name": "Sakura Flow",
"description": "一款专注于依赖管理与深度交互的 MCDReforged 待办事项插件。",
"author": "Sakura-Ex",
Expand All @@ -11,4 +11,4 @@
"resources": [
"lang"
]
}
}