Skip to content

Commit 0574d9d

Browse files
authored
Add publish action (#320)
1 parent c641c6d commit 0574d9d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Install node
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: '12.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: Install Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip build twine jupyterlab
24+
- name: Build the federated extension in a separated build environment
25+
run: |
26+
python -m build
27+
- name: Publish the Python package
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: |
32+
twine upload dist/*
33+
- name: Build the source extension
34+
run: |
35+
jlpm
36+
jlpm build
37+
- name: Publish the NPM package
38+
run: |
39+
echo $PRE_RELEASE
40+
if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi
41+
npm publish --tag ${TAG} --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
PRE_RELEASE: ${{ github.event.release.prerelease }}

0 commit comments

Comments
 (0)