Skip to content

Commit 248a0a2

Browse files
fengyikaiclaude
andcommitted
feat: 合并 release 和 publish workflows
将 auto-release 和 python-publish 两个 workflow 合并为一个, 避免 release 事件触发失败的问题。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 73139d8 commit 248a0a2

2 files changed

Lines changed: 27 additions & 43 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Auto Create Release
1+
name: Auto Release and Publish
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
check-version-and-release:
9+
release-and-publish:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
@@ -64,10 +64,33 @@ jobs:
6464
--notes-file release_notes.md \
6565
--latest
6666
67-
- name: Release created
67+
- name: Set up Python
68+
if: steps.check_tag.outputs.exists == 'false'
69+
uses: actions/setup-python@v3
70+
with:
71+
python-version: '3.10'
72+
73+
- name: Install dependencies
74+
if: steps.check_tag.outputs.exists == 'false'
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install build
78+
79+
- name: Build package
80+
if: steps.check_tag.outputs.exists == 'false'
81+
run: python -m build
82+
83+
- name: Publish package to PyPI
84+
if: steps.check_tag.outputs.exists == 'false'
85+
uses: pypa/gh-action-pypi-publish@master
86+
with:
87+
user: __token__
88+
password: ${{ secrets.PYPI_API_TOKEN }}
89+
90+
- name: Success
6891
if: steps.check_tag.outputs.exists == 'false'
6992
run: |
70-
echo "✅ Successfully created release ${{ steps.get_version.outputs.tag }}"
93+
echo "✅ Successfully created release ${{ steps.get_version.outputs.tag }} and published to PyPI"
7194
7295
- name: Skip release
7396
if: steps.check_tag.outputs.exists == 'true'

.github/workflows/python-publish.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)