Skip to content

Commit 4a83262

Browse files
Add v prefix to tag in deploy workflow (#134)
1 parent 1373201 commit 4a83262

4 files changed

Lines changed: 24 additions & 10 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
types: [completed]
77
branches: [main]
88

9+
permissions:
10+
contents: write
11+
912
jobs:
1013
publish-extension:
1114
name: Publish to marketplace
@@ -23,19 +26,22 @@ jobs:
2326
uses: actions/setup-node@v6
2427
with:
2528
node-version-file: .nvmrc
29+
cache: npm
2630

2731
- name: Install dependencies
2832
run: npm --color ci
2933

3034
- name: Read version from package.json
3135
run: |
3236
VERSION=$(node -p "require('./package.json').version")
33-
echo "version=$VERSION" >> $GITHUB_ENV
37+
echo "version=v$VERSION" >> $GITHUB_ENV
3438
35-
- name: Create Git tag
39+
- name: Check whether this version is already published
3640
run: |
37-
git tag ${{ env.version }}
38-
git push origin ${{ env.version }}
41+
if git ls-remote --exit-code --tags origin "refs/tags/${{ env.version }}" > /dev/null; then
42+
echo "Version ${{ env.version }} is already tagged."
43+
exit 1
44+
fi
3945
4046
- name: Publish to Open VSX Registry
4147
id: publishToOpenVSX
@@ -49,3 +55,8 @@ jobs:
4955
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
5056
registryUrl: https://marketplace.visualstudio.com
5157
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
58+
59+
- name: Create Git tag
60+
run: |
61+
git tag "${{ env.version }}"
62+
git push origin "${{ env.version }}"

.github/workflows/test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ on:
66
pull_request:
77
types: [opened, synchronize, reopened]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
run-tests:
1114
name: Run tests
1215
runs-on: ubuntu-latest
13-
strategy:
14-
fail-fast: false
16+
1517
steps:
1618
- name: Checkout repository
1719
uses: actions/checkout@v6
@@ -20,6 +22,7 @@ jobs:
2022
uses: actions/setup-node@v6
2123
with:
2224
node-version-file: .nvmrc
25+
cache: npm
2326

2427
- name: Install dependencies
2528
run: npm --color ci

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "parse-tree",
33
"displayName": "Parse tree",
44
"description": "Access document syntax using tree-sitter",
5-
"version": "0.54.0",
5+
"version": "0.55.0",
66
"publisher": "pokey",
77
"repository": {
88
"type": "git",
@@ -82,7 +82,7 @@
8282
"scripts": {
8383
"clean": "rm -rf ./out && rm -rf parsers",
8484
"vscode:prepublish": "npm run build",
85-
"build": "tsc -p ./ && npm run copy-assets",
85+
"build": "tsc -p . && npm run copy-assets",
8686
"copy-assets": "sh copy-assets.sh",
8787
"lint": "npm run typecheck && npm run lint:ts && npm run lint:fmt",
8888
"typecheck": "tsc -p . --noEmit",

0 commit comments

Comments
 (0)