Skip to content

v1.4.3

v1.4.3 #100

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build-wasm:
name: Build WASM
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
- name: Generate parser
run: tree-sitter generate
- name: Build WASM
run: tree-sitter build --wasm
- name: Upload WASM to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: tree-sitter-htmlmustache.wasm
build-vscode-extension:
name: Build VS Code Extension
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
- name: Generate parser
run: tree-sitter generate
- name: Build WASM (needed by extension)
run: tree-sitter build --wasm
# Install root deps so shared modules under `src/core/` can resolve
# their dependencies (e.g. parsel-js) from root node_modules at bundle time.
- name: Install root dependencies
run: pnpm install
- name: Install extension dependencies
working-directory: lsp
run: pnpm install
- name: Build extension
working-directory: lsp
run: pnpm run build
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Package extension
working-directory: lsp
run: vsce package --out htmlmustache-lsp.vsix
- name: Upload extension to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: lsp/htmlmustache-lsp.vsix
- name: Publish to VS Code Marketplace
if: github.event_name == 'release'
working-directory: lsp
# Skip only if this exact version is already published; let any other
# vsce failure (e.g. reserved name/displayName, auth) fail the job.
run: |
read -r EXT VERSION < <(node -p "const p=require('./package.json'); p.publisher+'.'+p.name+' '+p.version")
if vsce show "$EXT" --json 2>/dev/null | node -e "const v=require('fs').readFileSync(0,'utf8'); let j; try{j=JSON.parse(v)}catch{process.exit(1)} process.exit((j.versions||[]).some(x=>x.version===process.argv[1])?0:1)" "$VERSION"; then
echo "::notice::$EXT@$VERSION already on VS Marketplace, skipping publish"
else
vsce publish --packagePath htmlmustache-lsp.vsix
fi
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Install ovsx
run: npm install -g ovsx
- name: Publish to Open VSX Registry
if: github.event_name == 'release'
working-directory: lsp
# Skip only if this exact version is already published (API returns 200);
# let any other ovsx failure (e.g. auth, namespace) fail the job.
run: |
read -r NS NAME VERSION < <(node -p "const p=require('./package.json'); p.publisher+' '+p.name+' '+p.version")
code=$(curl -s -o /dev/null -w '%{http_code}' "https://open-vsx.org/api/$NS/$NAME/$VERSION")
if [ "$code" = "200" ]; then
echo "::notice::$NS.$NAME@$VERSION already on Open VSX, skipping publish"
else
ovsx publish htmlmustache-lsp.vsix
fi
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}