Skip to content

Update README.md

Update README.md #3

name: 插件发布
on:
push:
branches: [ "master","cai"]
jobs:
Build:
runs-on: ubuntu-latest
name: 构建插件
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: 初始化.NET 6
uses: actions/setup-dotnet@v4
env:
DOTNET_CLI_UI_LANGUAGE: zh-CN
with:
dotnet-version: 6.0.x
- name: 构建插件
run: |
dotnet build Plugin.sln -c Release
- name: 下载PluginInfoLoader
run: |
wget -q https://github.com/ACaiCat/PluginInfoLoaderr/releases/download/v1.0.0.0/linux-x64.zip
unzip -qq linux-x64.zip
- name: 运行TShock生成Plugins.json
timeout-minutes: 3
run: |
cp ./out/Release/*.dll ./linux-x64/ServerPlugins/
cd linux-x64
chmod +x TShock.Server
./TShock.Server
- name: 移动Plugins.json
run: |
mv linux-x64/Plugins.json ./
- name: 自动更新Plugins.json
continue-on-error: true
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo ${{ github.repository }}
if [ "${{ github.repository }}" = "Controllerdestiny/TShockPlugin" ]; then
git add Plugins.json
if git diff --staged --quiet; then
echo "跳过更新:没有插件版本变化"
else
git commit -m "自动更新Plugins.json [skip ci]"
git pull
git push
fi
else
echo "非Controllerdestiny/TShockPlugin仓库,跳过提交."
fi
- name: 初始化Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 打包
run:
sudo python BuildHelper.py Release
env:
PYTHONIOENCODING: 'utf-8'
- name: 上传临时插件包
uses: actions/upload-artifact@v4
with:
name: Plugins
path: Plugins.zip
LatestRelease:
name: 发布插件
runs-on: ubuntu-latest
needs: Build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 获取更新日志
id: external_changelog_second
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: "Config/Config_Rep.json"
#cache: ${{ steps.external_changelog_collect.outputs.cache }}
- name: 生成更新日志
env:
CHANGELOG: ${{ steps.external_changelog_second.outputs.changelog }}
CHANGELOG_SECOND: ${{ steps.external_changelog_second.outputs.changelog }}
run: |
echo ${{ steps.external_changelog_collect.outputs.cache }}
echo "First:"
echo "$CHANGELOG"
echo "Second:"
echo "$CHANGELOG_SECOND"
- name: 更新发布标签
run: |
git tag -f V1.0.0.0
git push -f origin V1.0.0.0
- name: 下载临时插件包
uses: actions/download-artifact@v4
with:
name: Plugins
path: ./bin
- name: 发布插件包
uses: ncipollo/release-action@v1
with:
tag: V1.0.0.0
name: "最新版本"
body: "# 插件下载和更新日志\n### 📅 每次仓库更新,我们都会在这里发布最新的Release。请注意,这个仓库只有一个Release,所以你总是能在这里找到最新的版本。\n### 📖文档已经以PDF的形式附在插件包中。更推荐你直接在仓库主页中的[插件列表](https://github.com/Controllerdestiny/TShockPlugin?tab=readme-ov-file#%E5%B7%B2%E6%94%B6%E9%9B%86%E6%8F%92%E4%BB%B6),点击插件名跳转到每个插件的详细文档。\n### 📦 你可以在页面的`最底部↓↓↓`找到插件包的下载链接。下载完成后,你需要使用`ZIP压缩工具`进行解压。\n> [!CAUTION]\n>**请你`详细`的看`上面的说明`,不要到处问`插件怎么用`、`ZIP如何解压`、`PDF怎么打开`**\n<details>\n<summary>更新日志</summary>\n\n${{steps.external_changelog_second.outputs.changelog}}</details>"
artifacts: |
./bin/*
allowUpdates: true
removeArtifacts: true
ClearTempArtifacts:
name: 清理临时文件
if: always()
runs-on: ubuntu-latest
needs:
- LatestRelease
permissions:
actions: write
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
Plugins