Skip to content

Commit 23367ba

Browse files
committed
重试发布流程
1 parent 871bd7e commit 23367ba

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,39 @@ jobs:
5353
run: mvn -B verify
5454
working-directory: ./external-coreprotect
5555

56-
# 产物验证(下游特有逻辑保留)
56+
# 设置日期和短 SHA 作为标签名
57+
- name: Set date and short sha as tag name
58+
id: set_tag
59+
run: |
60+
SHORT_SHA=${GITHUB_SHA::7}
61+
DATE=$(date +'%Y-%m-%d')
62+
echo "TAG_NAME=${DATE}-${SHORT_SHA}" >> $GITHUB_ENV
63+
echo "Generated Tag: ${{ env.TAG_NAME }}
64+
65+
# 构建后的验证步骤(精确检查两个文件)
5766
- name: Verify Artifacts
5867
run: |
5968
ls -la ./external-coreprotect/target/
60-
test -f ./external-coreprotect/target/*.jar || (echo "JAR not found" && exit 1)
69+
70+
# 检查核心文件是否存在
71+
if [ ! -f ./external-coreprotect/target/CoreProtect-23.0.jar ]; then
72+
echo "::error::CoreProtect-23.0.jar not found"
73+
exit 1
74+
fi
75+
76+
# 检查原始文件是否存在
77+
if [ ! -f ./external-coreprotect/target/original-CoreProtect-23.0.jar ]; then
78+
echo "::error::original-CoreProtect-23.0.jar not found"
79+
exit 1
80+
fi
81+
82+
echo "Both required JAR files exist"
6183
62-
# 自动发布(下游特有逻辑保留)
84+
# 发布两个文件
6385
- name: Auto Release
6486
uses: marvinpinto/action-automatic-releases@latest
6587
with:
6688
repo_token: ${{ secrets.GITHUB_TOKEN }}
67-
automatic_release_tag: ${{ format('{0}-{1}', github.run_number, github.sha) }}
89+
automatic_release_tag: ${{ env.TAG_NAME }}
6890
prerelease: false
6991
files: ./external-coreprotect/target/*.jar

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ For a detailed description of the plugin, please visit [coreprotect.net](https:/
4848

4949
## 本仓库的 Star History
5050

51-
[![Star History Chart](https://api.star-history.com/svg?repos=Midnight-2004/CoreProtect-AutoBuild&type=Date)](https://star-history.com/#Midnight-2004/CoreProtect-AutoBuild&Date)
51+
[![Star History Chart](https://api.star-history.com/svg?repos=Midnight-2004/CoreProtect-AutoBuild&type=Date)](https://star-history.com/#Midnight-2004/CoreProtect-AutoBuild&Date)

0 commit comments

Comments
 (0)