chore: add GitHub Actions workflow for publishing extension #10
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
name: Publish Extension | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm install | |
- name: Start Xvfb | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb | |
export DISPLAY=:99.0 | |
Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & | |
- name: Run Tests | |
run: xvfb-run -a npm test | |
- name: Compile Extension | |
run: npm run compile | |
- name: Install VSCE | |
run: npm install -g @vscode/vsce | |
- name: Publish to VSCode Marketplace | |
run: vsce publish -p ${{ secrets.VSC_TOKEN }} |