diff --git a/.github/workflows/build-extension.yml b/.github/workflows/build-extension.yml index d253701..b1db2e9 100644 --- a/.github/workflows/build-extension.yml +++ b/.github/workflows/build-extension.yml @@ -1,20 +1,24 @@ -name: Build Extension - +name: Build and Publish Extension on: push: branches: - main + tags: + - 'v*' jobs: build: - name: Build + name: Build and Publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - uses: astral-sh/setup-uv@v3 - - run: cd client && npm ci - - name: compile and create vsix + + - name: Install Dependencies + run: cd client && npm ci + + - name: Compile and Create VSIX run: | cd client npm install @@ -22,8 +26,15 @@ jobs: npm run compile npm run webpack npm run vscepack - - name: upload vsix as artifact + + - name: Upload VSIX as Artifact uses: actions/upload-artifact@v4 with: name: extension-package - path: client/*.vsix \ No newline at end of file + path: client/*.vsix + + - name: Publish to VS Code Marketplace + if: startsWith(github.ref, 'refs/tags/') + run: | + cd client + vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_PRIVATE_ACCESS_TOKEN }} \ No newline at end of file