Skip to content

Commit 2e2d2ca

Browse files
committed
Prepare VS Code Check release pipeline
1 parent 5e2d12a commit 2e2d2ca

12 files changed

Lines changed: 1160 additions & 1031 deletions

File tree

.github/workflows/ci.yml

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ on:
99
pull_request:
1010

1111
permissions:
12-
contents: write
12+
contents: read
1313

1414
jobs:
1515
build:
1616
name: Type-check, build, and package
1717
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
1820

1921
steps:
2022
- name: Checkout
@@ -32,19 +34,64 @@ jobs:
3234
- name: Type-check and build
3335
run: npm run ci
3436

37+
- name: Read package version
38+
id: package
39+
shell: bash
40+
run: echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
41+
42+
- name: Create artifact directory
43+
run: mkdir -p artifacts
44+
3545
- name: Package VSIX
36-
run: npm run package -- --out vs-code-check-${{ github.ref_name }}.vsix
46+
run: npm run package -- --out artifacts/vs-code-check-${{ steps.package.outputs.version }}.vsix
3747

3848
- name: Upload VSIX artifact
3949
uses: actions/upload-artifact@v4
4050
with:
4151
name: vs-code-check-vsix
42-
path: vs-code-check-${{ github.ref_name }}.vsix
52+
path: artifacts/*.vsix
53+
if-no-files-found: error
54+
55+
release:
56+
name: Publish GitHub Release
57+
if: startsWith(github.ref, 'refs/tags/v')
58+
needs: build
59+
runs-on: ubuntu-latest
60+
permissions:
61+
contents: write
62+
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
with:
67+
persist-credentials: false
68+
69+
- name: Validate release tag
70+
shell: bash
71+
run: |
72+
package_version="$(node -p 'require("./package.json").version')"
73+
test "v${package_version}" = "${GITHUB_REF_NAME}"
74+
75+
- name: Prepare release notes
76+
id: notes
77+
shell: bash
78+
run: |
79+
notes_path=".github/release-notes/${GITHUB_REF_NAME}.md"
80+
if [ ! -f "${notes_path}" ]; then
81+
printf "# VS Code Check %s\n\nAutomated release for commit %s.\n" "${GITHUB_REF_NAME}" "${GITHUB_SHA}" > release-notes.md
82+
notes_path="release-notes.md"
83+
fi
84+
echo "path=${notes_path}" >> "$GITHUB_OUTPUT"
85+
86+
- name: Download VSIX artifact
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: vs-code-check-vsix
90+
path: artifacts
4391

4492
- name: Publish GitHub Release
45-
if: startsWith(github.ref, 'refs/tags/v')
4693
uses: softprops/action-gh-release@v2
4794
with:
4895
name: VS Code Check ${{ github.ref_name }}
49-
body_path: .github/release-notes/${{ github.ref_name }}.md
50-
files: vs-code-check-${{ github.ref_name }}.vsix
96+
body_path: ${{ steps.notes.outputs.path }}
97+
files: artifacts/*.vsix

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# VS Code Check
22

3+
[![CI](https://github.com/sm18lr88/VS_Code_Check/actions/workflows/ci.yml/badge.svg)](https://github.com/sm18lr88/VS_Code_Check/actions/workflows/ci.yml)
4+
35
A concise VS Code extension that refreshes Problems diagnostics by loading lintable workspace files on demand.
46

57
## Features
@@ -68,6 +70,13 @@ Many linters and type checkers in VS Code only analyze open files. This extensio
6870

6971
## Installation
7072

73+
### From GitHub
74+
75+
Download the latest packaged `.vsix` from either:
76+
77+
- The latest successful CI run artifact on the [CI workflow](https://github.com/sm18lr88/VS_Code_Check/actions/workflows/ci.yml)
78+
- A tagged [GitHub release](https://github.com/sm18lr88/VS_Code_Check/releases), when available
79+
7180
### From VSIX (Local)
7281

7382
1. Download or build the `.vsix` file
@@ -84,6 +93,10 @@ npm run ci
8493
npm run package
8594
```
8695

96+
## CI/CD
97+
98+
GitHub Actions runs on pushes to `master`, pull requests, and version tags. The workflow type-checks, builds, packages the extension into a `.vsix`, and uploads it as a downloadable workflow artifact. Tags named like `v1.1.1` also publish a GitHub Release with the VSIX attached.
99+
87100
## License
88101

89102
MIT

icon.png

4.98 KB
Loading

icon.svg

Lines changed: 30 additions & 26 deletions
Loading

0 commit comments

Comments
 (0)