Skip to content

Commit cae1fa1

Browse files
committed
Add release action
1 parent eee90dc commit cae1fa1

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: CD
22
on:
33
push:
4-
branches:
5-
- main
4+
branches: [ 'main' ]
5+
tags: [ '*' ]
66
concurrency:
77
group: ${{ github.workflow }}-${{ github.ref }}
88
cancel-in-progress: true
@@ -237,3 +237,23 @@ jobs:
237237
with:
238238
name: wheels
239239
path: target/wheels
240+
241+
release:
242+
name: Release
243+
runs-on: ubuntu-latest
244+
if: "startsWith(github.ref, 'refs/tags/')"
245+
needs: [ macos, windows, linux, linux-cross, musllinux ]
246+
steps:
247+
- uses: actions/download-artifact@v2
248+
with:
249+
name: wheels
250+
- uses: actions/setup-python@v2
251+
with:
252+
python-version: 3.10
253+
- name: Publish to PyPi
254+
env:
255+
TWINE_USERNAME: __token__
256+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
257+
run: |
258+
pip install --upgrade twine
259+
twine upload --skip-existing *

0 commit comments

Comments
 (0)