55 tags :
66 - " *"
77
8- permissions :
9- contents : write
10-
118jobs :
129 build-sdist :
1310 runs-on : ubuntu-latest
3128 pip install -U setuptools wheel pip
3229 python setup.py sdist
3330
34- - uses : actions/upload-artifact@v4
31+ - name : Upload sdist artifact
32+ uses : actions/upload-artifact@v4
3533 with :
36- name : dist-sdist
34+ name : dist-sdist
3735 path : dist/*.tar.*
3836
3937 build-wheels-matrix :
@@ -90,121 +88,65 @@ jobs:
9088 env :
9189 CIBW_BUILD_VERBOSITY : 1
9290
93- - uses : actions/upload-artifact@v4
91+ - name : Upload wheel artifacts
92+ uses : actions/upload-artifact@v4
9493 with :
9594 name : dist-wheels-${{ matrix.only }}
9695 path : wheelhouse/*.whl
9796
98- merge-artifacts :
99- runs-on : ubuntu-latest
100- needs : [build-sdist, build-wheels]
101- steps :
102- - name : Merge Artifacts
103- uses : actions/upload-artifact/merge@v4
104- with :
105- name : dist
106- delete-merged : true
107-
108- publish-docs :
109- needs : [build-sdist, build-wheels]
110- runs-on : ubuntu-latest
111-
112- env :
113- PIP_DISABLE_PIP_VERSION_CHECK : 1
114-
115- steps :
116- - name : Checkout source
117- uses : actions/checkout@v4
118- with :
119- fetch-depth : 5
120- submodules : true
121-
122- - name : Set up Python
123- uses : actions/setup-python@v5
124- with :
125- python-version : " 3.x"
126-
127- - name : Build docs
128- run : |
129- pip install -e .[docs]
130- make htmldocs
131-
132- - name : Checkout gh-pages
133- uses : actions/checkout@v4
134- with :
135- fetch-depth : 5
136- ref : gh-pages
137- path : docs/gh-pages
138-
139- - name : Sync docs
140- run : |
141- rsync -a docs/_build/html/ docs/gh-pages/current/
142-
143- - name : Commit and push docs
144- uses : magicstack/gha-commit-and-push@master
145- with :
146- target_branch : gh-pages
147- workdir : docs/gh-pages
148- commit_message : Automatic documentation update
149- github_token : ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
150- ssh_key : ${{ secrets.RELEASE_BOT_SSH_KEY }}
151- gpg_key : ${{ secrets.RELEASE_BOT_GPG_KEY }}
152- gpg_key_id : " 5C468778062D87BF!"
153-
15497 publish :
155- needs : [build-sdist, build-wheels, publish-docs ]
98+ needs : [build-sdist, build-wheels]
15699 runs-on : ubuntu-latest
157100
158101 environment :
159102 name : pypi
160103 url : https://pypi.org/p/async_gaussdb
161- permissions :
162- id-token : write
163- attestations : write
164- contents : write
165- deployments : write
166104
167105 steps :
168106 - uses : actions/checkout@v4
169107 with :
170108 fetch-depth : 5
171109 submodules : false
172110
173- - uses : actions/download-artifact@v4
111+ - name : Download sdist artifact
112+ uses : actions/download-artifact@v4
113+ with :
114+ name : dist-sdist
115+ path : dist/
116+
117+ - name : Download all wheel artifacts
118+ uses : actions/download-artifact@v4
174119 with :
175- name : dist
120+ pattern : dist-wheels-*
176121 path : dist/
177122
178123 - name : Extract Release Version
179124 id : relver
180125 run : |
181126 set -e
182- # 从标签中提取版本
183127 echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
184128
185- - name : Merge and tag the PR
186- uses : edgedb/action-release/merge@master
187- with :
188- github_token : ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
189- ssh_key : ${{ secrets.RELEASE_BOT_SSH_KEY }}
190- gpg_key : ${{ secrets.RELEASE_BOT_GPG_KEY }}
191- gpg_key_id : " 5C468778062D87BF!"
192- tag_name : v${{ steps.relver.outputs.version }}
193-
194- - name : Publish Github Release
195- uses : elprans/gh-action-create-release@master
196- env :
197- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129+ - name : Prepare all_dist directory
130+ run : mkdir all_dist
131+
132+ - name : Move artifacts to all_dist
133+ run : |
134+ ls dist/dist-wheels-cp310-macosx_arm64/
135+ mv dist/**/*.whl all_dist/
136+ mv dist/*.tar.gz all_dist/
137+ ls -l all_dist/
138+
139+ - name : Upload all dist/* to GitHub Release
140+ uses : softprops/action-gh-release@v1
198141 with :
199- tag_name : v${{ steps.relver.outputs.version }}
200- release_name : v${{ steps.relver.outputs.version }}
201- target : ${{ github.ref }} # 使用提交的标签作为目标
202- body : " Release v${{ steps.relver.outputs.version }}"
142+ files : all_dist/*
203143
204- - run : |
205- ls -al dist/
206144
207145 - name : Upload to PyPI
208- uses : pypa/gh-action-pypi-publish@release/v1
209- with :
210- attestations : true
146+ if : startsWith(github.ref, 'refs/tags/')
147+ run : |
148+ pip install --upgrade twine setuptools wheel twine packaging
149+ twine upload all_dist/*
150+ env :
151+ TWINE_USERNAME : __token__
152+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments