|
| 1 | +name: Packaging |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, main ] |
| 6 | + pull_request: |
| 7 | + branches: '*' |
| 8 | + |
| 9 | +env: |
| 10 | + PIP_DISABLE_PIP_VERSION_CHECK: 1 |
| 11 | + |
| 12 | +defaults: |
| 13 | + run: |
| 14 | + shell: bash -l {0} |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v3 |
| 23 | + |
| 24 | + - name: Base Setup |
| 25 | + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: python -m pip install -U "jupyterlab>=4.0.0,<5" |
| 29 | + |
| 30 | + - name: Package the extension |
| 31 | + run: | |
| 32 | + set -eux |
| 33 | + pip install build |
| 34 | + python -m build |
| 35 | + pip uninstall -y "jupyterlab_github" jupyterlab |
| 36 | +
|
| 37 | + - name: Upload extension packages |
| 38 | + uses: actions/upload-artifact@v3 |
| 39 | + with: |
| 40 | + name: extension-artifacts |
| 41 | + path: ./dist/jupyterlab_github* |
| 42 | + if-no-files-found: error |
| 43 | + |
| 44 | + install: |
| 45 | + runs-on: ${{ matrix.os }}-latest |
| 46 | + needs: [build] |
| 47 | + strategy: |
| 48 | + fail-fast: false |
| 49 | + matrix: |
| 50 | + os: [ubuntu, macos, windows] |
| 51 | + python: ['3.8', '3.11'] |
| 52 | + include: |
| 53 | + - python: '3.8' |
| 54 | + dist: 'jupyterlab_github*.tar.gz' |
| 55 | + - python: '3.11' |
| 56 | + dist: 'jupyterlab_github*.whl' |
| 57 | + - os: windows |
| 58 | + py_cmd: python |
| 59 | + - os: macos |
| 60 | + py_cmd: python3 |
| 61 | + - os: ubuntu |
| 62 | + py_cmd: python |
| 63 | + |
| 64 | + steps: |
| 65 | + - name: Install Python |
| 66 | + uses: actions/setup-python@v4 |
| 67 | + with: |
| 68 | + python-version: ${{ matrix.python }} |
| 69 | + architecture: 'x64' |
| 70 | + |
| 71 | + - uses: actions/download-artifact@v3 |
| 72 | + with: |
| 73 | + name: extension-artifacts |
| 74 | + path: ./dist |
| 75 | + |
| 76 | + - name: Install prerequisites |
| 77 | + run: | |
| 78 | + ${{ matrix.py_cmd }} -m pip install pip wheel |
| 79 | +
|
| 80 | + - name: Install package |
| 81 | + run: | |
| 82 | + cd dist |
| 83 | + ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} |
| 84 | +
|
| 85 | + - name: Validate environment |
| 86 | + run: | |
| 87 | + ${{ matrix.py_cmd }} -m pip freeze |
| 88 | + ${{ matrix.py_cmd }} -m pip check |
| 89 | +
|
| 90 | + - name: Validate install |
| 91 | + run: | |
| 92 | + jupyter labextension list |
| 93 | + jupyter labextension list 2>&1 | grep -ie "@jupyterlab/github.*OK" |
0 commit comments