Skip to content

Commit 6b0b199

Browse files
committed
Update workflow and release scripts
- Disabled requirement of test status check to pass for the Default Branch Protection ruleset. Signed-off-by: Phillip Sitbon <phillip.sitbon@gmail.com>
1 parent 3a47686 commit 6b0b199

File tree

3 files changed

+38
-41
lines changed

3 files changed

+38
-41
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to PyPI
1+
name: Publish new release version
22

33
on:
44
push:
@@ -80,38 +80,50 @@ jobs:
8080
uv run poe create-publish-commit
8181
8282
# Export values for the release step
83-
echo "VERSION=$(uv run poe -q version)" >> $GITHUB_ENV
84-
echo "COMMIT_SHA=$(uv run poe -q git_commit_sha)" >> $GITHUB_ENV
85-
echo "BUILD_SHA=$(uv run poe -q build-sha)" >> $GITHUB_ENV
86-
87-
- name: Publish to PyPI
88-
env:
89-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
90-
run: |
91-
uv run poe pypi-publish
92-
83+
echo "VERSION=$(uv version --short)" >> $GITHUB_ENV
84+
85+
# Get changelog since last release
86+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
87+
git log magg/latest..${{ github.sha }} >> $GITHUB_ENV
88+
echo "EOF" >> $GITHUB_ENV
89+
90+
# Update the latest tag to point to the current commit
91+
git tag -d magg/latest || true
92+
git tag --no-sign magg/latest
93+
9394
- name: Push changes back to main
94-
if: success()
9595
run: |
9696
git push origin main
9797
git push origin --tags
98+
# Also push the updated latest tag (force in case it exists)
99+
git push origin magg/latest --force
98100
99101
- name: Create GitHub Release
100-
if: success()
101102
uses: softprops/action-gh-release@v2
102103
with:
103104
tag_name: magg/v${{ env.VERSION }}
104-
name: magg v${{ env.VERSION }}
105+
name: Magg v${{ env.VERSION }}
105106
body: |
106-
## Package Info
107-
- Version: ${{ env.VERSION }}
108-
- Commit: ${{ env.COMMIT_SHA }}
109-
- SHA512: ${{ env.BUILD_SHA }}
110-
107+
# 🧲 Magg Release v${{ env.VERSION }}
108+
109+
Automatically generated release triggered by commit `${{ github.sha }}`.
110+
111+
## Changes
112+
```
113+
${{ env.CHANGELOG }}
114+
```
115+
111116
## Installation
112117
```bash
113-
pip install magg==${{ env.VERSION }}
118+
uv add magg==${{ env.VERSION }}
114119
```
115120
files: |
116121
dist/*.tar.gz
117-
dist/*.whl
122+
dist/*.whl
123+
124+
- name: Publish to PyPI
125+
if: success()
126+
env:
127+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
128+
run: |
129+
uv run poe pypi-publish

pyproject.toml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "magg"
3-
version = "0.4.0.30"
3+
version = "0.4.1.30"
44
requires-python = ">=3.13"
55
description = "MCP Aggregator"
66
authors = [{ name = "Phillip Sitbon", email = "phillip.sitbon@gmail.com"}]
@@ -84,39 +84,24 @@ verbosity = -1
8484
[tool.poe.tasks]
8585
fix-whitespace.cmd = "python scripts/fix_whitespace.py"
8686

87-
git_commit_num.cmd = "git rev-list --count HEAD"
88-
git_commit_sha.cmd = "git show --pretty=format:'%H' --no-patch"
89-
version.cmd = "uv version --short"
90-
91-
commit-info.sequence = [
92-
{ ref = "version" },
93-
{ ref = "git_commit_num" },
94-
{ ref = "git_commit_sha" },
95-
]
96-
97-
build-sha.shell = "sha512sum dist/magg-$(poe -q version).tar.gz"
98-
9987
build.sequence = [
100-
{ ref = "commit-info" },
10188
{ cmd = "rm -f dist/*" },
10289
{ cmd = "uv build" },
103-
{ ref = "build-sha" },
10490
]
10591

10692
sync-git-version.shell = """
107-
VERSION=$(echo -n $(poe -q version) | sed 's/\\(\\.\\)[0-9]*$/\\.'"$(poe -q git_commit_num)"'/')
93+
VERSION=$(echo -n $(uv version --short) | sed 's/\\(\\.\\)[0-9]*$/\\.'"$(poe -q git rev-list --count HEAD)"'/')
10894
uv version $VERSION
10995
git add pyproject.toml uv.lock
11096
"""
11197

11298
publish-commit-message.shell = """
113-
echo $(poe -q version) $(poe -q git_commit_sha)
114-
echo $(poe -q build-sha)
99+
echo '[Automatic] Release Version' v$(uv version --short) from $(git show --pretty=format:'%h' --no-patch)
115100
"""
116101

117102
verified-publish-commit.shell = """
118103
git commit -s -S -m "$(poe -q publish-commit-message)"
119-
git tag -s -m "$(poe -q publish-commit-message)" magg/v$(poe -q version)
104+
git tag -s -m "$(poe -q publish-commit-message)" magg/v$(uv version --short)
120105
"""
121106

122107
create-publish-commit.sequence = [

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)