Add beta badge to README, managed by workflows
This commit is contained in:
@@ -54,10 +54,26 @@ jobs:
|
|||||||
--arg notes "$notes" \
|
--arg notes "$notes" \
|
||||||
'{version: $version, url: $url, notes: $notes}' > version-beta.json
|
'{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: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
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 commit -m "Beta release ${{ github.ref_name }}"
|
||||||
git push origin HEAD:main
|
git push origin HEAD:main
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ jobs:
|
|||||||
sed -i '' \
|
sed -i '' \
|
||||||
's/version-[0-9][^-]*-orange/version-${{ steps.version.outputs.version }}-orange/' \
|
's/version-[0-9][^-]*-orange/version-${{ steps.version.outputs.version }}-orange/' \
|
||||||
README.md
|
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
|
- name: Commit version.json and README
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
[](https://swift.org)
|
[](https://swift.org)
|
||||||
[](https://github.com/superdooper86/claudechecker/releases)
|
[](https://github.com/superdooper86/claudechecker/releases)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
<!-- BETA_BADGE -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user