From d8813fc1de8f5bafcb72cd3c9fd17f6a5a34c8c9 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 26 Apr 2026 12:50:33 +0200 Subject: [PATCH] Add v prefix to tag in deploy workflow --- .github/workflows/deploy.yaml | 19 +++++++++++++++---- .github/workflows/test.yaml | 7 +++++-- package-lock.json | 4 ++-- package.json | 4 ++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a820006..da02e6b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,6 +6,9 @@ on: types: [completed] branches: [main] +permissions: + contents: write + jobs: publish-extension: name: Publish to marketplace @@ -23,6 +26,7 @@ jobs: uses: actions/setup-node@v6 with: node-version-file: .nvmrc + cache: npm - name: Install dependencies run: npm --color ci @@ -30,12 +34,14 @@ jobs: - name: Read version from package.json run: | VERSION=$(node -p "require('./package.json').version") - echo "version=$VERSION" >> $GITHUB_ENV + echo "version=v$VERSION" >> $GITHUB_ENV - - name: Create Git tag + - name: Check whether this version is already published run: | - git tag ${{ env.version }} - git push origin ${{ env.version }} + if git ls-remote --exit-code --tags origin "refs/tags/${{ env.version }}" > /dev/null; then + echo "Version ${{ env.version }} is already tagged." + exit 1 + fi - name: Publish to Open VSX Registry id: publishToOpenVSX @@ -49,3 +55,8 @@ jobs: pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} registryUrl: https://marketplace.visualstudio.com extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} + + - name: Create Git tag + run: | + git tag "${{ env.version }}" + git push origin "${{ env.version }}" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index beb321a..fddd0d7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,12 +6,14 @@ on: pull_request: types: [opened, synchronize, reopened] +permissions: + contents: read + jobs: run-tests: name: Run tests runs-on: ubuntu-latest - strategy: - fail-fast: false + steps: - name: Checkout repository uses: actions/checkout@v6 @@ -20,6 +22,7 @@ jobs: uses: actions/setup-node@v6 with: node-version-file: .nvmrc + cache: npm - name: Install dependencies run: npm --color ci diff --git a/package-lock.json b/package-lock.json index 6409929..e18eb1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-tree", - "version": "0.54.0", + "version": "0.55.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "parse-tree", - "version": "0.54.0", + "version": "0.55.0", "license": "MIT", "dependencies": { "semver": "^7.7.4", diff --git a/package.json b/package.json index 4faaa75..9a07db5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "parse-tree", "displayName": "Parse tree", "description": "Access document syntax using tree-sitter", - "version": "0.54.0", + "version": "0.55.0", "publisher": "pokey", "repository": { "type": "git", @@ -82,7 +82,7 @@ "scripts": { "clean": "rm -rf ./out && rm -rf parsers", "vscode:prepublish": "npm run build", - "build": "tsc -p ./ && npm run copy-assets", + "build": "tsc -p . && npm run copy-assets", "copy-assets": "sh copy-assets.sh", "lint": "npm run typecheck && npm run lint:ts && npm run lint:fmt", "typecheck": "tsc -p . --noEmit",