-
Notifications
You must be signed in to change notification settings - Fork 1.8k
77 lines (65 loc) · 2.54 KB
/
build-publish-pypi.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
name: Build KeplerGL Python and NPM Packages
on: push
jobs:
build_and_publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
# use Volta to manage yarn/node versions
- uses: volta-cli/action@v4
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine virtualenv
- name: Build KeplerGL
env:
MapboxAccessTokenJupyter: ${{ secrets.mapbox_jupyter_token }}
NODE_OPTIONS: --openssl-legacy-provider
run: |
python -m virtualenv venv
source venv/bin/activate
pip install jupyter jupyterlab jupyter-packaging
cd bindings/kepler.gl-jupyter
python setup.py sdist
- name: Test KeplerGL
run: |
source venv/bin/activate
pip install bindings/kepler.gl-jupyter/dist/*.tar.gz
if [ ! -f "venv/share/jupyter/nbextensions/keplergl-jupyter/index.js" ]; then
venv/bin/jupyter nbextension install --py --sys-prefix keplergl
venv/bin/jupyter nbextension enable --py --sys-prefix keplergl
fi
venv/bin/jupyter nbconvert --execute bindings/kepler.gl-jupyter/notebooks/DataFrame.ipynb --to python
python bindings/kepler.gl-jupyter/notebooks/DataFrame.py
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: keplergl-pypi
path: bindings/kepler.gl-jupyter/dist/
- name: Check Release Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+-jupyter$ ]]; then
echo ::set-output name=publish::true
fi
- name: Publish KeplerGL to Pypi
if: steps.check-tag.outputs.publish == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: |
python -m twine upload bindings/kepler.gl-jupyter/dist/*.tar.gz
- name: Publish kepler-jupyter to NPM
if: steps.check-tag.outputs.publish == 'true'
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
MapboxAccessTokenJupyter: ${{ secrets.mapbox_jupyter_token }}
run: |
source venv/bin/activate
cd bindings/kepler.gl-jupyter/js
npm publish