Skip to content

Commit 96c9d3c

Browse files
authored
Ease release through Github workflow (#655)
1 parent c1ffae2 commit 96c9d3c

File tree

3 files changed

+48
-7
lines changed

3 files changed

+48
-7
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install node
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: '12.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
- name: Install Python
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: '3.x'
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install jupyterlab packaging setuptools twine wheel
26+
- name: Test version are matching
27+
run: python -c "from release import assertEqualVersion; assertEqualVersion()"
28+
- name: Publish the Python package
29+
env:
30+
TWINE_USERNAME: __token__
31+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
python setup.py sdist bdist_wheel
34+
twine upload dist/*
35+
- name: Publish the NPM package
36+
run: |
37+
npm publish --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

ROADMAP.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
## CI/CD:
2-
- CD: Trigger releases on tags.
3-
- **What?** Add CD capabilities to trigger a release when a tag is pushed.
4-
- **Why?** Save maintainer manual effort on releases. Increase cadence of releases.
5-
- Combining the Python and JS files into one installable package
6-
- **What?** Provide a single installation for both the frontend and the server package
7-
- **Why?** Reduce number of issues from users have different versions of the NPM and Python packages. Easier installation for users
1+
## CI/CD:
82
- Integration Testing
93
- **What?** Test suite that actually exercises UI and API against an actual Git repo without mocking out Git calls.
104
- **Why?** Enables us to better test against an actual Git process. Stepping stone to x-OS testing such as Windows.

release.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22
import argparse as argpar
33
import json
44
import subprocess
5+
from packaging.version import parse
56

67
from setupbase import get_version
78

89
VERSION_PY = 'jupyterlab_git/_version.py'
910

11+
def assertEqualVersion():
12+
serverVersion = parse(serverExtensionVersion())
13+
frontendVersion = parse(labExtensionVersion())
14+
15+
error_msg = "Frontend ({}) and server ({}) version do not match".format(frontendVersion, serverVersion)
16+
assert serverVersion == frontendVersion, error_msg
17+
1018
def prepLabextensionBundle():
1119
subprocess.run(['jlpm', 'clean:slate'])
1220

0 commit comments

Comments
 (0)