-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Package the extension. #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b08ee36
feat: Package the extension.
Artmann eb50220
Merge branch 'main' into chris/package-the-extension
Artmann d8d45b0
install vsce
Artmann edb179b
add an icon
Artmann fb1fb5f
safe branch
Artmann ed8f811
add vsce
Artmann 016e185
remove duplicate build
Artmann 095adec
move vsce to workflow
Artmann 16998f3
update the filename
Artmann 1a8a3ba
chore: consistency in cicd naming
jamesbhobbs ad65f80
Merge branch 'main' into chris/package-the-extension
jamesbhobbs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: CD | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| NODE_VERSION: 22.x | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| package: | ||
| name: Build & Package Extension | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | ||
| with: | ||
| cache: 'npm' | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| registry-url: 'https://npm.pkg.github.com' | ||
| scope: '@deepnote' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci --prefer-offline --no-audit | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Install vsce | ||
| run: npm install -g @vscode/vsce | ||
|
|
||
| - name: Extract version from package.json | ||
| id: package-version | ||
| run: | | ||
| VERSION=$(node -p "require('./package.json').version") | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Extension version: $VERSION" | ||
|
|
||
| - name: Extract and sanitize branch name | ||
| id: branch-name | ||
| env: | ||
| UNTRUSTED_HEAD_REF: ${{ github.head_ref }} | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| run: | | ||
| # Get branch name from ref (use env vars to avoid direct interpolation) | ||
| if [[ "$EVENT_NAME" == "pull_request" ]]; then | ||
| BRANCH="$UNTRUSTED_HEAD_REF" | ||
| else | ||
| BRANCH="${GITHUB_REF#refs/heads/}" | ||
| fi | ||
| # Sanitize branch name for filename (replace / with -) | ||
| SAFE_BRANCH=$(printf '%s' "$BRANCH" | sed 's/\//-/g') | ||
| printf 'branch=%s\n' "$SAFE_BRANCH" >> "$GITHUB_OUTPUT" | ||
| printf 'Branch name: %s (sanitized: %s)\n' "$BRANCH" "$SAFE_BRANCH" | ||
|
|
||
| - name: Package extension | ||
| run: npm run package | ||
|
|
||
| - name: Rename VSIX file | ||
| run: | | ||
| # The package script creates vscode-deepnote-insiders.vsix | ||
| # Rename it to include version and branch | ||
| mv vscode-deepnote-insiders.vsix "vscode-deepnote-${{ steps.package-version.outputs.version }}-${{ steps.branch-name.outputs.branch }}.vsix" | ||
| ls -lh *.vsix | ||
|
|
||
| - name: Upload VSIX artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vscode-deepnote-${{ steps.package-version.outputs.version }}-${{ steps.branch-name.outputs.branch }} | ||
| path: vscode-deepnote-*.vsix | ||
| retention-days: 30 | ||
| if-no-files-found: error | ||
|
|
||
| - name: Add summary | ||
| run: | | ||
| echo "## 📦 Extension Packaged Successfully" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Version:** ${{ steps.package-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Branch:** ${{ steps.branch-name.outputs.branch }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Installation Instructions" >> $GITHUB_STEP_SUMMARY | ||
| echo "1. Download the artifact from the Actions tab" >> $GITHUB_STEP_SUMMARY | ||
| echo "2. Extract the .vsix file from the zip" >> $GITHUB_STEP_SUMMARY | ||
| echo "3. Install in VS Code:" >> $GITHUB_STEP_SUMMARY | ||
| echo " - Open VS Code" >> $GITHUB_STEP_SUMMARY | ||
| echo " - Go to Extensions view (Ctrl+Shift+X / Cmd+Shift+X)" >> $GITHUB_STEP_SUMMARY | ||
| echo " - Click the '...' menu → 'Install from VSIX...'" >> $GITHUB_STEP_SUMMARY | ||
| echo " - Select the downloaded .vsix file" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Alternatively, use the command line:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | ||
| echo "code --install-extension vscode-deepnote-${{ steps.package-version.outputs.version }}-${{ steps.branch-name.outputs.branch }}.vsix" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.