Skip to content

Add copilot auto login through env vars and restrict inline completio… #3

Add copilot auto login through env vars and restrict inline completio…

Add copilot auto login through env vars and restrict inline completio… #3

name: Upload S3 Staging
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build wheel
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Setup yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
env:
# Increase this value to reset cache
CACHE_NUMBER: 3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
key: ${{ runner.os }}-yarn-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ env.CACHE_NUMBER }}
${{ runner.os }}-yarn-
- name: Install dependencies and make wheels dir
run: python -m pip install -U "jupyter_packaging>=0.10,<2" "jupyterlab>=4.0.0,<5" pip wheel build
- name: Build the extension
run: python -m build
- uses: actions/upload-artifact@v4
if: matrix.python-version == '3.11'
with:
name: extension
path: dist/lab_notebook_intelligence*.whl
if-no-files-found: error
deploy:
name: Upload to Amazon S3
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/download-artifact@v4
with:
name: extension
- name: Copy wheel file to S3 lab-extensions bucket
run: |
aws s3 rm s3://qbraid-lab-extensions/staging/ --recursive --exclude "*" --include "lab_notebook_intelligence*.whl"
aws s3 cp ./ s3://qbraid-lab-extensions/staging/ --recursive --exclude "*" --include "lab_notebook_intelligence*.whl"