Skip to content

Commit 658ea42

Browse files
committed
chore(ci): sync workflows from vscode-ext-template
- ci.yml: bump actions/checkout and actions/setup-node v4 → v6, rename job to CI - release.yml: bump actions to v6, add overwrite input, replace softprops/action-gh-release@v2 with gh CLI, read vsix name from package.json - DEVELOPMENT.md: update Node.js prerequisite 18+ → 22+, reorder command table - RELEASE.md: remove package-lock.json from git add, add overwrite usage note
1 parent c5a161d commit 658ea42

File tree

5 files changed

+39
-18
lines changed

5 files changed

+39
-18
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88

99
jobs:
1010
ci:
11-
name: Test and Lint
11+
name: CI
1212
runs-on: ubuntu-latest
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717

1818
- name: Setup Node.js
19-
uses: actions/setup-node@v4
19+
uses: actions/setup-node@v6
2020
with:
2121
node-version: 22
2222

.github/workflows/release.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
overwrite:
7+
description: Overwrite existing release if tag already exists
8+
type: boolean
9+
default: false
510

611
jobs:
712
release:
@@ -12,14 +17,16 @@ jobs:
1217

1318
steps:
1419
- name: Checkout repository
15-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1621

17-
- name: Read version from package.json
18-
id: version
19-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
22+
- name: Read package info
23+
id: pkg
24+
run: |
25+
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
26+
echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT
2027
2128
- name: Setup Node.js
22-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
2330
with:
2431
node-version: 22
2532

@@ -30,12 +37,17 @@ jobs:
3037
run: npm run ci
3138

3239
- name: Package extension
33-
run: npx @vscode/vsce package --no-dependencies -o github-copilot-usage-${{ steps.version.outputs.version }}.vsix
40+
run: npx @vscode/vsce package --no-dependencies -o ${{ steps.pkg.outputs.name }}-${{ steps.pkg.outputs.version }}.vsix
3441

3542
- name: Create GitHub Release
36-
uses: softprops/action-gh-release@v2
37-
with:
38-
tag_name: v${{ steps.version.outputs.version }}
39-
name: v${{ steps.version.outputs.version }}
40-
generate_release_notes: true
41-
files: github-copilot-usage-${{ steps.version.outputs.version }}.vsix
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
TAG="v${{ steps.pkg.outputs.version }}"
47+
if [[ "${{ inputs.overwrite }}" == "true" ]]; then
48+
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
49+
fi
50+
gh release create "$TAG" \
51+
--title "$TAG" \
52+
--generate-notes \
53+
"${{ steps.pkg.outputs.name }}-${{ steps.pkg.outputs.version }}.vsix"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ coverage/
1313
.idea/
1414
*.swp
1515
*.swo
16+
17+
# Environment / secrets
18+
.env*

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Prerequisites
44

5-
- [Node.js](https://nodejs.org/) 18+
5+
- [Node.js](https://nodejs.org/) 22+
66
- [VS Code](https://code.visualstudio.com/) with the Extension Development Host
77

88
## Setup
@@ -21,8 +21,8 @@ Open the project in VS Code and press **F5** to launch the Extension Development
2121

2222
| Command | Description |
2323
| ---------------------- | ------------------------------------- |
24-
| `npm run ci` | Run all checks (test + lint + format) |
2524
| `npm test` | Run tests (Vitest) |
25+
| `npm run ci` | Run all checks (test + lint + format) |
2626
| `npm run lint` | Lint code (ESLint) |
2727
| `npm run lint:fix` | Lint and auto-fix |
2828
| `npm run format` | Format code with Prettier |

RELEASE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
4. Commit and push:
2424

2525
```bash
26-
git add CHANGELOG.md package.json package-lock.json
26+
git add CHANGELOG.md package.json
2727
git commit -m "chore: update version to vX.Y.Z"
2828
git push origin main
2929
```
@@ -36,6 +36,12 @@
3636

3737
This runs tests, packages the extension as `.vsix`, and creates a GitHub Release with the file attached.
3838

39+
To overwrite an existing release for the same version:
40+
41+
```bash
42+
gh workflow run release.yml -f overwrite=true
43+
```
44+
3945
6. Verify the release:
4046

4147
```bash

0 commit comments

Comments
 (0)