Add beta badge to README, managed by workflows

This commit is contained in:
2026-05-07 23:17:02 +02:00
parent ed186af2c6
commit 032951882f
3 changed files with 24 additions and 2 deletions
+18 -2
View File
@@ -54,10 +54,26 @@ jobs:
--arg notes "$notes" \
'{version: $version, url: $url, notes: $notes}' > version-beta.json
- name: Commit version-beta.json
- name: Update beta badge in README
run: |
shields_version=$(echo "${{ steps.version.outputs.version }}" | sed 's/-/--/g')
tag="${{ github.ref_name }}"
badge="[![Beta](https://img.shields.io/badge/beta-${shields_version}-orange?style=flat)](https://github.com/${{ github.repository }}/releases/tag/${tag}) <!-- BETA_BADGE -->"
python3 -c "
lines = open('README.md').readlines()
out = []
for line in lines:
if '<!-- BETA_BADGE -->' in line:
out.append('${badge}\n')
else:
out.append(line)
open('README.md', 'w').writelines(out)
"
- name: Commit version-beta.json and README
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add version-beta.json
git add version-beta.json README.md
git commit -m "Beta release ${{ github.ref_name }}"
git push origin HEAD:main
+5
View File
@@ -70,6 +70,11 @@ jobs:
sed -i '' \
's/version-[0-9][^-]*-orange/version-${{ steps.version.outputs.version }}-orange/' \
README.md
# Remove beta badge now that stable is released
sed -i '' '/<!-- BETA_BADGE -->/d' README.md
# Re-add empty marker so future betas can target it
sed -i '' '/license-MIT-blue/a\
<!-- BETA_BADGE -->' README.md
- name: Commit version.json and README
run: |