feat: setup ci #1
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 to VSCode Marketplace | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Get version from package.json | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Create Git tag | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git tag -a v${{ steps.package-version.outputs.current-version}} -m "Release v${{ steps.package-version.outputs.current-version}}" | |
git push origin v${{ steps.package-version.outputs.current-version}} | |
- name: Install dependencies | |
run: pnpm install | |
- name: Login to VSCode Marketplace | |
run: | | |
vsce login lakphy | |
${{ secrets.VSCODE_TOKEN }} | |
- name: Publish to VSCode Marketplace | |
run: pnpm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |