Skip to content

Commit 47498d1

Browse files
chore: reduce local dependencies and update workflows (#5863)
1 parent a144b6b commit 47498d1

File tree

13 files changed

+229
-4257
lines changed

13 files changed

+229
-4257
lines changed

.github/workflows/auto-fix.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: auto-fix
1+
name: Auto Fix
22

33
on:
44
push:
@@ -21,20 +21,15 @@ jobs:
2121

2222
- uses: actions/setup-node@v4
2323
with:
24-
node-version: 22
24+
node-version: 24
2525
cache: pnpm
2626

2727
- run: pnpm install
2828

29-
# lint
30-
- name: Auto-fix
31-
run: npm run lint:fix
29+
- run: npm run lint:fix
3230

33-
# format
34-
- name: Format
35-
run: npm run format
31+
- run: npm run format
3632

37-
# commit
3833
- name: Commit
3934
uses: EndBug/add-and-commit@v9
4035
with:
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Bump Version on Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
bump-version:
9+
if: |
10+
github.event.issue.pull_request &&
11+
(contains(github.event.comment.body, '@bump-patch') ||
12+
contains(github.event.comment.body, '@bump-minor'))
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
issues: write
18+
19+
steps:
20+
- name: Add reaction to comment
21+
uses: peter-evans/create-or-update-comment@v4
22+
with:
23+
comment-id: ${{ github.event.comment.id }}
24+
reactions: eyes
25+
26+
- name: Get PR branch
27+
id: pr
28+
run: |
29+
PR_NUMBER=${{ github.event.issue.number }}
30+
PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRepository)
31+
BRANCH=$(echo "$PR_DATA" | jq -r .headRefName)
32+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
GH_REPO: ${{ github.repository }}
36+
37+
- uses: actions/checkout@v4
38+
with:
39+
ref: ${{ steps.pr.outputs.branch }}
40+
41+
- uses: pnpm/action-setup@v4
42+
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: 24
46+
47+
- name: Install Lerna Lite
48+
run: pnpm add -g @lerna-lite/cli @lerna-lite/version
49+
50+
- name: Bump version
51+
run: |
52+
if [[ "${{ github.event.comment.body }}" == *"@bump-patch"* ]]; then
53+
VERSION_TYPE="patch"
54+
elif [[ "${{ github.event.comment.body }}" == *"@bump-minor"* ]]; then
55+
VERSION_TYPE="minor"
56+
else
57+
echo "No valid version command found."
58+
exit 1
59+
fi
60+
61+
lerna version $VERSION_TYPE --no-push --no-git-tag-version --force-publish --yes
62+
NEW_VERSION=$(node -p "require('./lerna.json').version")
63+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
64+
65+
- name: Generate extension metadata
66+
working-directory: extensions/vscode
67+
run: npm run gen-ext-meta
68+
69+
- name: Commit
70+
uses: EndBug/add-and-commit@v9
71+
with:
72+
message: "ci: bump version to ${{ env.NEW_VERSION }} [skip ci]"
73+
default_author: github_actions

.github/workflows/close-cannot-repoduce-issues.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 22
26+
node-version: 24
2727
cache: pnpm
2828

2929
- run: pnpm install

.github/workflows/extension-release.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
auto-tag:
10+
runs-on: ubuntu-latest
11+
if: startsWith(github.event.head_commit.message, 'v')
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
17+
- name: Check commit message and create tag
18+
run: |
19+
COMMIT_MSG=$(git log -1 --pretty=%B)
20+
21+
if [[ $COMMIT_MSG =~ ^(v[0-9]+\.[0-9]+\.[0-9]+) ]]; then
22+
TAG_NAME="${BASH_REMATCH[1]}"
23+
git config user.name "github-actions[bot]"
24+
git config user.email "github-actions[bot]@users.noreply.github.com"
25+
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
26+
git push origin "$TAG_NAME"
27+
echo "✅ Tag $TAG_NAME created"
28+
else
29+
echo "❌ Invalid version format"
30+
exit 1
31+
fi
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
publish-npm:
36+
runs-on: ubuntu-latest
37+
needs: auto-tag
38+
if: success()
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: pnpm/action-setup@v4
43+
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 24
47+
cache: pnpm
48+
49+
- name: Install Lerna Lite
50+
run: pnpm add -g @lerna-lite/cli @lerna-lite/publish
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
- name: Build
56+
run: npm run build
57+
58+
- name: Publish to NPM
59+
env:
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
run: |
62+
lerna publish from-package --yes
63+
64+
publish-vscode-marketplace:
65+
runs-on: ubuntu-latest
66+
needs: auto-tag
67+
if: success()
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- uses: pnpm/action-setup@v4
72+
73+
- uses: actions/setup-node@v4
74+
with:
75+
node-version: 24
76+
cache: pnpm
77+
78+
- name: Install global tools
79+
run: pnpm install -g @vscode/vsce
80+
81+
- name: Install dependencies
82+
run: pnpm install --frozen-lockfile
83+
84+
- name: Publish to VSCode Marketplace
85+
working-directory: extensions/vscode
86+
env:
87+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
88+
run: vsce publish
89+
90+
publish-open-vsx:
91+
runs-on: ubuntu-latest
92+
needs: auto-tag
93+
if: success()
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- uses: pnpm/action-setup@v4
98+
99+
- uses: actions/setup-node@v4
100+
with:
101+
node-version: 24
102+
cache: pnpm
103+
104+
- name: Install global tools
105+
run: pnpm install -g ovsx
106+
107+
- name: Install dependencies
108+
run: pnpm install --frozen-lockfile
109+
110+
- name: Publish to Open VSX
111+
working-directory: extensions/vscode
112+
env:
113+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
114+
run: ovsx publish

.github/workflows/test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
name: test
1+
name: Test
22

33
on: [push, pull_request]
44

55
jobs:
6-
build:
6+
test:
77
runs-on: ${{ matrix.os }}
88

99
strategy:
1010
matrix:
11-
node-version: [24]
1211
os: [macos-latest, windows-latest, ubuntu-latest]
1312

1413
steps:
1514
- uses: actions/checkout@v4
1615

1716
- uses: pnpm/action-setup@v4
1817

19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v4
2119
with:
22-
node-version: ${{ matrix.node-version }}
20+
node-version: 24
2321
cache: pnpm
2422

2523
- run: pnpm install --frozen-lockfile
24+
2625
- run: npm run test
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: update-html-data
1+
name: Update HTML Data
22

33
on:
4-
push:
5-
branches:
6-
- "master"
74
workflow_dispatch:
85
schedule:
96
- cron: "0 0 * * *"
@@ -15,24 +12,23 @@ jobs:
1512
- uses: actions/checkout@v4
1613

1714
- uses: pnpm/action-setup@v4
15+
with:
16+
node-version: 24
17+
cache: pnpm
18+
19+
- run: pnpm install
1820

1921
- uses: actions/setup-node@v4
2022
with:
2123
node-version: 22
2224
cache: pnpm
2325

24-
- run: pnpm install
25-
26-
# update data
2726
- name: Update HTML Data
2827
run: cd packages/language-service && npm run update-html-data
2928

30-
# commit
3129
- name: Commit
3230
uses: EndBug/add-and-commit@v9
3331
with:
3432
message: "ci(language-service): update html data"
3533
add: "packages/language-service/data"
3634
default_author: github_actions
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

extensions/vscode/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,17 +472,16 @@
472472
}
473473
},
474474
"scripts": {
475+
"vscode:prepublish": "npm run build",
475476
"build": "rolldown --config",
476-
"pack": "npm run build && vsce package",
477-
"release": "npm run build && vsce publish",
477+
"pack": "npx @vscode/vsce package",
478478
"gen-ext-meta": "vscode-ext-gen --scope vue --output src/generated-meta.ts && cd ../.. && npm run format"
479479
},
480480
"devDependencies": {
481481
"@types/node": "^22.10.4",
482482
"@types/vscode": "1.88.0",
483483
"@volar/typescript": "2.4.27",
484484
"@volar/vscode": "2.4.27",
485-
"@vscode/vsce": "latest",
486485
"@vue/language-core": "workspace:*",
487486
"@vue/language-server": "workspace:*",
488487
"@vue/typescript-plugin": "workspace:*",

0 commit comments

Comments
 (0)