Skip to content

Commit be535d0

Browse files
author
Delega Bot
committed
ci: OIDC trusted publishing, auto-changelog, drift check improvements
- Switch npm publish to OIDC (no NPM_TOKEN needed) - Switch PyPI publish to OIDC trusted publishing - Add auto-generated changelog from git log on tag push - Create GitHub Releases automatically on tag push - Enable MCP Registry publish step (non-fatal if token missing) - Improve drift check: PyPI via JSON API, landing site check, better summary - Add Discord deploy notifications on delega-api
1 parent e564496 commit be535d0

1 file changed

Lines changed: 49 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,41 @@ on:
55
tags:
66
- 'v*'
77

8+
permissions:
9+
contents: write
10+
id-token: write
11+
812
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ['3.9', '3.11', '3.13']
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install and test
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[async]"
29+
pip install pytest
30+
pytest tests/ -v
31+
932
publish:
33+
needs: test
1034
runs-on: ubuntu-latest
1135
environment: pypi
1236
permissions:
13-
contents: read
37+
contents: write
1438
id-token: write
1539
steps:
1640
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
1743

1844
- uses: actions/setup-python@v5
1945
with:
@@ -34,7 +60,28 @@ jobs:
3460
- name: Build package
3561
run: python -m build
3662

37-
- name: Publish to PyPI
63+
- name: Publish to PyPI (OIDC trusted publishing)
3864
uses: pypa/gh-action-pypi-publish@release/v1
3965
with:
4066
attestations: true
67+
68+
- name: Generate changelog
69+
run: |
70+
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
71+
if [ -n "$PREV_TAG" ]; then
72+
echo "## Changes since $PREV_TAG" > /tmp/changelog.md
73+
echo "" >> /tmp/changelog.md
74+
git log "$PREV_TAG"..HEAD --pretty=format:"- %s (%h)" --no-merges >> /tmp/changelog.md
75+
else
76+
echo "## Initial release" > /tmp/changelog.md
77+
echo "" >> /tmp/changelog.md
78+
git log --pretty=format:"- %s (%h)" --no-merges >> /tmp/changelog.md
79+
fi
80+
81+
- name: Create GitHub Release
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
run: |
85+
gh release create "${{ github.ref_name }}" \
86+
--title "${{ github.ref_name }}" \
87+
--notes-file /tmp/changelog.md

0 commit comments

Comments
 (0)