ci(fix): set pnpm in HOME env #16
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: CI/CD for VSCode Extension | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
jobs: | |
git_check: | |
uses: ./.github/workflows/git_check.yaml | |
package-extension: | |
needs: git_check | |
name: Package VSCode Extension | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Set up pnpm global bin directory | |
run: | | |
pnpm setup | |
export PNPM_HOME="${HOME}/.local/share/pnpm" | |
export PATH="$PNPM_HOME:$PATH" | |
shell: bash | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install VSCE (CLI for managing VS Code extensions) | |
run: pnpm add -g @vscode/vsce | |
- name: Package Extension | |
run: vsce package | |
- name: Upload Release to GitHub | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "*.vsix" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |