-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating th CI to publish the extension when a branch is merged into …
…main
- Loading branch information
1 parent
00c5506
commit 2768bda
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,37 @@ | ||
# Add this to your existing ci.yml file | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.16.0' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Test ## It's good to double check the tests are passing before publishing | ||
run: npm run test | ||
|
||
# Only run publish step when pushing to main (not on PRs) | ||
- name: Publish to VS Code Marketplace | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
run: | | ||
# Extract version from package.json to use in the vsix filename | ||
VERSION=$(node -p "require('./package.json').version") | ||
npm run build | ||
npx vsce publish -p ${{ secrets.VSCE_PAT }} |
This file contains 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