Skip to content
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

meta(vscode): Add pipeline to test and build private feature vsix #6427

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/private-vsix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Private vsix build
run-name: Private vsix build - [ ${{ github.ref_name || 'branch' }} ]
on:
workflow_dispatch: # Trigger only manually workflow_dispatch: # Trigger only manually

env:
AI_KEY: 3cf0d6ae-3327-414a-b7c1-12f31ef45eff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a secret? should we be storing it in source?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

especially on open source github

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AI key is not a secret, we already have it in the repo, according to the telemetry package that vscode offers is not sensitive

The AI key is not a secret; it’s already in the repository. According to the telemetry package provided by VS Code, it is not considered sensitive information. For more details, you can refer to the VS Code extension telemetry documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say we should still add this to a variable in case we need to change it in future. Will be handy without changing the code. If it is not a secret, the value can be set as a variable instead of secret


jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
# checkout the repo
- name: 'Checkout Github Action'
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Set up Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v3
with:
version: 9.1.3
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]

- run: pnpm turbo run test:lib --cache-dir=.turbo
- run: pnpm turbo run test:extension-unit --cache-dir=.turbo

build:
name: Build private vsix
runs-on: ubuntu-latest

steps:
# checkout the repo
- name: 'Checkout Github Action'
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Set up Node.js version 20
uses: actions/setup-node@v1
with:
node-version: 20

- uses: pnpm/action-setup@v3
with:
version: 9.1.3
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]

- name: 'Set Designer Extension VSIX aiKey in package.json'
run: echo "`jq '.aiKey="${{ env.AI_KEY }}"' apps/vs-code-designer/src/package.json`" > apps/vs-code-designer/src/package.json

- name: Replace Placeholder with Telemetry Key
run: sed -i 's/setInGitHubBuild/${{ env.AI_KEY }}/g' apps/vs-code-designer/src/main.ts

- name: 'Pack VSCode Designer Extension'
run: pnpm run vscode:designer:pack

- name: Archive VSIX
uses: actions/upload-artifact@v4
with:
path: |
apps/vs-code-designer/dist/*.vsix



Loading