Fix stable workflow: use if condition to skip beta tags, fix YAML syntax in README step

This commit is contained in:
2026-05-07 23:26:42 +02:00
parent c18054a810
commit d9d65da6b7
+15 -9
View File
@@ -4,10 +4,10 @@ on:
push: push:
tags: tags:
- 'v*' - 'v*'
- '!v*-*'
jobs: jobs:
release: release:
if: ${{ !contains(github.ref_name, '-') }}
runs-on: macos-latest runs-on: macos-latest
permissions: permissions:
contents: write contents: write
@@ -67,14 +67,20 @@ jobs:
- name: Update README badge - name: Update README badge
run: | run: |
sed -i '' \ python3 -c "
's/version-[0-9][^-]*-orange/version-${{ steps.version.outputs.version }}-orange/' \ content = open('README.md').read()
README.md import re
# Remove beta badge now that stable is released content = re.sub(r'version-[0-9][^-]*-orange', 'version-${{ steps.version.outputs.version }}-orange', content)
sed -i '' '/<!-- BETA_BADGE -->/d' README.md lines = content.splitlines(keepends=True)
# Re-add empty marker so future betas can target it out = []
sed -i '' '/license-MIT-blue/a\ for line in lines:
<!-- BETA_BADGE -->' README.md if '<!-- BETA_BADGE -->' in line:
continue
out.append(line)
if 'license-MIT-blue' in line:
out.append('<!-- BETA_BADGE -->\n')
open('README.md', 'w').writelines(out)
"
- name: Commit version.json and README - name: Commit version.json and README
run: | run: |