Skip to content

Commit c3b4f35

Browse files
author
Drew Yang
committed
fix: 🐛 readme bug and readme badge update
1 parent 1df172d commit c3b4f35

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

.github/workflows/post_draft_release_published.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,17 @@ jobs:
5050
git add datajoint/version.py
5151
git commit -m "Update version.py to $VERSION"
5252
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
53-
echo "VERSION=$VERSION" >> $GITHUB_ENV
53+
- name: Update README.md badge
54+
run: |
55+
# commits since the last release
56+
NEW_HREF="https://github.com/datajoint/datajoint-python/compare/${{ github.event.release.tag_name }}...master"
57+
NEW_SRC="https://img.shields.io/github/commits-since/datajoint/datajoint-python/${{ github.event.release.tag_name }}?color=red"
58+
# Update href in the <a> tag
59+
sed -i 's|\(<a id="commit-since-release-link"[^>]*href="\)[^"]*\(".*\)|\1'"$NEW_HREF"'\2|' README.md
60+
# Update src in the <img> tag
61+
sed -i 's|\(<img id="commit-since-release-img"[^>]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md
62+
git add README.md
63+
git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
5464
- name: Set up Python ${{matrix.py_ver}}
5565
uses: actions/setup-python@v5
5666
with:
@@ -101,7 +111,7 @@ jobs:
101111
with:
102112
upload_url: ${{github.event.release.upload_url}}
103113
asset_path: ${{env.DJ_WHEEL_PATH}}
104-
asset_name: pip-datajoint-${{env.DJ_VERSION}}.whl
114+
asset_name: pip-datajoint-${{ github.event.release.tag_name }}.whl
105115
asset_content_type: application/zip
106116
- name: Upload pip sdist asset to release
107117
uses: actions/upload-release-asset@v1
@@ -110,7 +120,7 @@ jobs:
110120
with:
111121
upload_url: ${{github.event.release.upload_url}}
112122
asset_path: ${{env.DJ_SDIST_PATH}}
113-
asset_name: pip-datajoint-${{env.DJ_VERSION}}.tar.gz
123+
asset_name: pip-datajoint-${{ github.event.release.tag_name }}.tar.gz
114124
asset_content_type: application/gzip
115125
- name: Create Pull Request
116126
env:

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,32 @@
3030
<tr>
3131
<td>Since Release</td>
3232
<td>
33-
<a href="https://github.com/datajoint/datajoint-python/compare/latest...master">
34-
<img src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/latest?color=red" alt="commit since last release" />
33+
<a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/latest...master">
34+
<img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/latest?color=red" alt="commit since last release" />
3535
</a>
3636
</td>
3737
</tr>
3838
<tr>
3939
<td>Test Status</td>
4040
<td>
41-
<a href="https://github.com/datajoint/datajoint-python/actions/workflows/development.yaml">
42-
<img src="https://github.com/datajoint/datajoint-python/actions/workflows/development.yaml/badge.svg" alt="test status" />
41+
<a href="https://github.com/datajoint/datajoint-python/actions/workflows/test.yaml">
42+
<img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/test/badge.svg" alt="test status" />
43+
</a>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td>Release Status</td>
48+
<td>
49+
<a href="https://github.com/datajoint/datajoint-python/actions/workflows/post_draft_release_published.yaml">
50+
<img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/post_draft_release_published/badge.svg" alt="release status" />
51+
</a>
52+
</td>
53+
</tr>
54+
<tr>
55+
<td>Doc Status</td>
56+
<td>
57+
<a href="https://datajoint.com/docs">
58+
<img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/pages-build-deployment/badge.svg" alt="doc status" />
4359
</a>
4460
</td>
4561
</tr>

0 commit comments

Comments
 (0)