Skip to content

Commit 9011dea

Browse files
committed
CI & CD: ability to upload GitHub Release to Pypi.
1 parent 5e27583 commit 9011dea

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish wheels(from GH Release)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
8+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Get release info
16+
id: get_release_info
17+
run: |
18+
RELEASE_VERSION=$(sed -n "s/^__version__.*\"\(.*\)\"$/\\1/p" ./pillow_heif/_version.py)
19+
echo "::set-output name=tag::v${RELEASE_VERSION}"
20+
21+
- name: Download Release Assets
22+
id: download_release_assets
23+
uses: i3h/download-release-asset@v1
24+
with:
25+
owner: ${{github.repository_owner}}
26+
repo: ${{ github.event.repository.name }}
27+
tag: ${{ steps.get_release_info.outputs.tag }}
28+
file: '/.*pillow_heif.*/'
29+
path: wheelhouse/
30+
31+
- name: Publish wheels to PyPI
32+
run: |
33+
python3 -m pip install twine
34+
ls -la wheelhouse/
35+
twine upload --verbose --skip-existing wheelhouse/*.whl
36+
twine upload --verbose wheelhouse/*tar.gz

0 commit comments

Comments
 (0)