-
Notifications
You must be signed in to change notification settings - Fork 677
86 lines (78 loc) · 2.59 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Publish PyPI
on:
workflow_dispatch:
jobs:
build-js:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: ./app/yarn.lock
- name: Try Compiling
working-directory: ./
run: |
chmod u+x ./scripts/compile.sh
./scripts/compile.sh
- name: Uploading dist
if: ${{ matrix.node-version == '16.x' }}
uses: actions/upload-artifact@v3
with:
name: pygwalker-app
path: ./pygwalker/templates/dist/*
build-py:
needs: [build-js]
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
os-version: [ubuntu-latest]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v3
- name: Download PyGWalkerApp
uses: actions/download-artifact@v3
with:
name: pygwalker-app
path: ./pygwalker/templates/dist
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Try building
working-directory: ./
run: |
pip install build twine
python -m build .
- name: Uploading packages
if: ${{ matrix.python-version == '3.11' && matrix.os-version == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
with:
name: pygwalker
path: ./dist/*
- name: Uploading PyPI
if: ${{ matrix.python-version == '3.11' && matrix.os-version == 'ubuntu-latest' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) }}
uses: pypa/[email protected]
with:
# PyPI user
# Password for your PyPI user or an access token
password: ${{ secrets.PYPI_TOKEN }}
# The target directory for distribution
packages-dir: dist
# Check metadata before uploading
verify-metadata: true
# Do not fail if a Python package distribution exists in the target package index
skip-existing: true
# Show verbose output.
verbose: true
# Show hash values of files to be uploaded
print-hash: true