Skip to content

Commit 4596756

Browse files
committed
chore: add CI/CD workflows and prepare v0.1.0 release
1 parent a249b33 commit 4596756

File tree

4 files changed

+193
-1
lines changed

4 files changed

+193
-1
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-15]
15+
node-version: [18.x, 20.x]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Compile TypeScript
30+
run: npm run compile
31+
32+
- name: Run tests
33+
run: npm test
34+
35+
- name: Run benchmarks
36+
run: npm run benchmark
37+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
38+
39+
package:
40+
name: Package Extension
41+
runs-on: ubuntu-latest
42+
needs: test
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: '20.x'
50+
cache: 'npm'
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Compile and package
56+
run: |
57+
npm run compile
58+
npm install -g @vscode/vsce
59+
vsce package --no-dependencies
60+
61+
- name: Upload VSIX
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: serilog-syntax-vsix
65+
path: '*.vsix'

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Compile TypeScript
25+
run: npm run compile
26+
27+
- name: Extract version
28+
id: version
29+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
30+
31+
- name: Extract changelog
32+
id: changelog
33+
run: |
34+
VERSION="${{ steps.version.outputs.version }}"
35+
# Extract the section for this version from CHANGELOG.md
36+
sed -n "/^## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '$d' > version_changelog.txt
37+
# If empty, try without brackets
38+
if [ ! -s version_changelog.txt ]; then
39+
sed -n "/^## $VERSION/,/^## /p" CHANGELOG.md | sed '$d' > version_changelog.txt
40+
fi
41+
# Set as output
42+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
43+
cat version_changelog.txt >> $GITHUB_OUTPUT
44+
echo "EOF" >> $GITHUB_OUTPUT
45+
46+
- name: Package Extension
47+
run: |
48+
npm install -g @vscode/vsce
49+
vsce package --no-dependencies
50+
51+
- name: Create GitHub Release
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
name: v${{ steps.version.outputs.version }}
55+
body: |
56+
## Serilog Syntax Highlighting for VS Code v${{ steps.version.outputs.version }}
57+
58+
${{ steps.changelog.outputs.changelog }}
59+
60+
### Installation
61+
62+
**From VS Code Marketplace:**
63+
1. Open VS Code
64+
2. Go to Extensions (Ctrl+Shift+X)
65+
3. Search for "Serilog Syntax"
66+
4. Click Install
67+
68+
**From VSIX file:**
69+
1. Download the `.vsix` file from the assets below
70+
2. In VS Code, go to Extensions (Ctrl+Shift+X)
71+
3. Click the "..." menu → Install from VSIX
72+
4. Select the downloaded file
73+
files: |
74+
*.vsix
75+
draft: false
76+
prerelease: false
77+
78+
publish:
79+
name: Publish to Marketplace
80+
runs-on: ubuntu-latest
81+
needs: release
82+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: '20.x'
90+
cache: 'npm'
91+
92+
- name: Install dependencies
93+
run: npm ci
94+
95+
- name: Compile TypeScript
96+
run: npm run compile
97+
98+
- name: Publish to VS Code Marketplace
99+
env:
100+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
101+
run: |
102+
npm install -g @vscode/vsce
103+
vsce publish -p $VSCE_TOKEN

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
All notable changes to the Serilog Syntax Highlighting extension will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2025-09-16
9+
10+
### Added
11+
- Initial release of Serilog Syntax Highlighting for VS Code
12+
- Template parser for Serilog message templates with property detection
13+
- Expression parser for Serilog.Expressions syntax
14+
- String literal parser supporting regular, verbatim (@"), and raw (""") strings
15+
- Brace matching provider for template property brackets
16+
- Decoration manager using VS Code decoration API for syntax highlighting
17+
- Theme manager with dark/light theme color schemes
18+
- Cache manager with LRU eviction (100 entry limit)
19+
- Debouncer utility for performance optimization
20+
- Serilog method call detector for identifying log statements
21+
- Test infrastructure with Jest
22+
- Webpack bundling configuration
23+
- GitHub CI/CD workflows for automated testing and releases
24+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "serilog-syntax-vscode",
33
"displayName": "Serilog Syntax Highlighting",
44
"description": "Syntax highlighting for Serilog message templates and Serilog.Expressions",
5-
"version": "0.0.1",
5+
"version": "0.1.0",
66
"publisher": "mtlog",
77
"engines": {
88
"vscode": "^1.74.0"

0 commit comments

Comments
 (0)