File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181 with :
8282 generate_release_notes : true
8383 files : artifacts/*
84+
85+ update-readme :
86+ needs : release
87+ runs-on : ubuntu-latest
88+ steps :
89+ - uses : actions/checkout@v4
90+ with :
91+ ref : main
92+ - name : Update README version
93+ run : |
94+ NEW_VERSION="${GITHUB_REF_NAME}"
95+ # Extract old version from README download URL pattern
96+ OLD_VERSION=$(grep -oE 'download/v[0-9]+\.[0-9]+\.[0-9]+/' README.md | head -1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+')
97+ if [ -z "$OLD_VERSION" ] || [ "$OLD_VERSION" = "$NEW_VERSION" ]; then
98+ echo "No version update needed"
99+ exit 0
100+ fi
101+ sed -i "s|${OLD_VERSION}|${NEW_VERSION}|g" README.md README.zh-CN.md
102+ git config user.name "github-actions[bot]"
103+ git config user.email "github-actions[bot]@users.noreply.github.com"
104+ git add README.md README.zh-CN.md
105+ git commit -m "docs: README 下载链接版本号自动更新为 ${NEW_VERSION}"
106+ git push
You can’t perform that action at this time.
0 commit comments