|
| 1 | +name: Packaging |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 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 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v2 |
| 22 | + - name: Install node |
| 23 | + uses: actions/setup-node@v1 |
| 24 | + with: |
| 25 | + node-version: '14.x' |
| 26 | + - name: Install Python |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: '3.9' |
| 30 | + architecture: 'x64' |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip wheel |
| 34 | + python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4" |
| 35 | + - name: Build pypi distributions |
| 36 | + run: | |
| 37 | + python setup.py sdist bdist_wheel |
| 38 | + - name: Build npm distributions |
| 39 | + run: | |
| 40 | + npm pack |
| 41 | + cp *.tgz dist |
| 42 | + - name: Build checksum file |
| 43 | + run: | |
| 44 | + cd dist |
| 45 | + sha256sum * | tee SHA256SUMS |
| 46 | + - name: Upload distributions |
| 47 | + uses: actions/upload-artifact@v2 |
| 48 | + with: |
| 49 | + name: dist ${{ github.run_number }} |
| 50 | + path: ./dist |
| 51 | + |
| 52 | + install: |
| 53 | + runs-on: ${{ matrix.os }}-latest |
| 54 | + needs: [build] |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + os: [ubuntu, macos, windows] |
| 59 | + python: ['3.6', '3.9'] |
| 60 | + include: |
| 61 | + - python: '3.6' |
| 62 | + dist: 'ipylab*.tar.gz' |
| 63 | + - python: '3.9' |
| 64 | + dist: 'ipylab*.whl' |
| 65 | + - os: windows |
| 66 | + py_cmd: python |
| 67 | + - os: macos |
| 68 | + py_cmd: python3 |
| 69 | + - os: ubuntu |
| 70 | + py_cmd: python |
| 71 | + steps: |
| 72 | + - name: Install Python |
| 73 | + uses: actions/setup-python@v2 |
| 74 | + with: |
| 75 | + python-version: ${{ matrix.python }} |
| 76 | + architecture: 'x64' |
| 77 | + - uses: actions/download-artifact@v2 |
| 78 | + with: |
| 79 | + name: dist ${{ github.run_number }} |
| 80 | + path: ./dist |
| 81 | + - name: Install the prerequisites |
| 82 | + run: | |
| 83 | + ${{ matrix.py_cmd }} -m pip install pip wheel |
| 84 | + - name: Install the package |
| 85 | + run: | |
| 86 | + cd dist |
| 87 | + ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} |
| 88 | + - name: Validate environment |
| 89 | + run: | |
| 90 | + ${{ matrix.py_cmd }} -m pip freeze |
| 91 | + ${{ matrix.py_cmd }} -m pip check |
| 92 | + - name: Validate the install |
| 93 | + run: | |
| 94 | + jupyter labextension list |
| 95 | + jupyter labextension list 2>&1 | grep -ie "ipylab.*enabled.*ok" - |
0 commit comments