Commit
·
fa57a43
1
Parent(s):
d1f6d38
add workflow to publish component package on tag push
Browse files
.github/workflows/package-build-and-publish.yml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This workflow will build gradio custom component and upload the package on PyPi using Twine when a tag is created
|
2 |
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
3 |
+
|
4 |
+
# This workflow uses actions that are not certified by GitHub.
|
5 |
+
# They are provided by a third-party and are governed by
|
6 |
+
# separate terms of service, privacy policy, and support
|
7 |
+
# documentation.
|
8 |
+
|
9 |
+
name: Upload Python Package
|
10 |
+
|
11 |
+
on:
|
12 |
+
push:
|
13 |
+
tags:
|
14 |
+
- "*"
|
15 |
+
|
16 |
+
permissions:
|
17 |
+
contents: read
|
18 |
+
|
19 |
+
jobs:
|
20 |
+
deploy:
|
21 |
+
|
22 |
+
runs-on: ubuntu-latest
|
23 |
+
|
24 |
+
steps:
|
25 |
+
- uses: actions/checkout@v4
|
26 |
+
- name: Set up Python
|
27 |
+
uses: actions/setup-python@v3
|
28 |
+
with:
|
29 |
+
python-version: '3.10'
|
30 |
+
- name: Install dependencies
|
31 |
+
run: |
|
32 |
+
python -m pip install --upgrade pip
|
33 |
+
pip install build gradio pyannote.audio
|
34 |
+
- name: Build package
|
35 |
+
run: |
|
36 |
+
cd sourceviewer
|
37 |
+
# build gradio custom component
|
38 |
+
gradio cc install
|
39 |
+
gradio cc build
|
40 |
+
python -m build
|
41 |
+
- name: Publish package
|
42 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
43 |
+
with:
|
44 |
+
user: __token__
|
45 |
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
46 |
+
packages-dir: ./sourceviewer
|