Add beta badge to README, managed by workflows
This commit is contained in:
@@ -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="[](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
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user