Skip to content

Commit 2c1c001

Browse files
authored
Merge pull request #113 from persevie/rc/1.8.0
Release v1.8.0
2 parents 7654000 + 12bbaf8 commit 2c1c001

105 files changed

Lines changed: 16894 additions & 221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_release.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions-rs/toolchain@v1
5353
with:
5454
profile: minimal
55-
toolchain: stable
55+
toolchain: 1.93.0
5656
components: clippy,rustfmt
5757

5858
- name: Print Rust toolchain versions
@@ -113,21 +113,29 @@ jobs:
113113
target: x86_64-unknown-linux-gnu
114114
artifact_name: grimoire_css-linux-x86_64
115115
artifact_path: target/x86_64-unknown-linux-gnu/release/grimoire_css
116+
lsp_asset_name: grimoire_css_lsp-linux-x64
117+
lsp_artifact_path: target/x86_64-unknown-linux-gnu/release/grimoire_css_lsp
116118
- name: macos_x86_64
117119
runs-on: macos-latest
118120
target: x86_64-apple-darwin
119121
artifact_name: grimoire_css-macos-x86_64
120122
artifact_path: target/x86_64-apple-darwin/release/grimoire_css
123+
lsp_asset_name: grimoire_css_lsp-darwin-x64
124+
lsp_artifact_path: target/x86_64-apple-darwin/release/grimoire_css_lsp
121125
- name: macos_arm64
122126
runs-on: macos-latest
123127
target: aarch64-apple-darwin
124128
artifact_name: grimoire_css-macos-arm64
125129
artifact_path: target/aarch64-apple-darwin/release/grimoire_css
130+
lsp_asset_name: grimoire_css_lsp-darwin-arm64
131+
lsp_artifact_path: target/aarch64-apple-darwin/release/grimoire_css_lsp
126132
- name: windows_x86_64
127133
runs-on: windows-latest
128134
target: x86_64-pc-windows-msvc
129135
artifact_name: grimoire_css-windows-x86_64.exe
130136
artifact_path: target/x86_64-pc-windows-msvc/release/grimoire_css.exe
137+
lsp_asset_name: grimoire_css_lsp-win32-x64.exe
138+
lsp_artifact_path: target/x86_64-pc-windows-msvc/release/grimoire_css_lsp.exe
131139

132140
steps:
133141
- name: Checkout Code
@@ -139,7 +147,7 @@ jobs:
139147
uses: actions-rs/toolchain@v1
140148
with:
141149
profile: minimal
142-
toolchain: stable
150+
toolchain: 1.93.0
143151
target: ${{ matrix.target }}
144152
components: clippy,rustfmt
145153

@@ -174,18 +182,19 @@ jobs:
174182
${{ runner.os }}-build-${{ matrix.target }}-
175183
176184
- name: Build project
177-
run: cargo build --release --target ${{ matrix.target }}
185+
run: cargo build --release --target ${{ matrix.target }} --features lsp --bin grimoire_css --bin grimoire_css_lsp
178186

179187
- name: Prepare artifact
180188
run: |
181189
mkdir -p artifacts
182190
cp "${{ matrix.artifact_path }}" "artifacts/${{ matrix.artifact_name }}"
191+
cp "${{ matrix.lsp_artifact_path }}" "artifacts/${{ matrix.lsp_asset_name }}"
183192
184193
- name: Upload artifacts
185194
uses: actions/upload-artifact@v4
186195
with:
187-
name: ${{ matrix.artifact_name }}
188-
path: artifacts/${{ matrix.artifact_name }}
196+
name: ${{ matrix.name }}
197+
path: artifacts/
189198

190199
publish:
191200
name: Publish to crates.io
@@ -200,7 +209,7 @@ jobs:
200209
uses: actions-rs/toolchain@v1
201210
with:
202211
profile: minimal
203-
toolchain: stable
212+
toolchain: 1.93.0
204213
components: clippy,rustfmt
205214

206215
- name: Print Rust toolchain versions
@@ -243,6 +252,17 @@ jobs:
243252
with:
244253
fetch-depth: 0
245254

255+
- name: Verify release notes file exists
256+
shell: bash
257+
run: |
258+
TAG='${{ needs.determine_release.outputs.NEW_TAG }}'
259+
NOTES_FILE="releases/${TAG}.md"
260+
if [[ ! -f "$NOTES_FILE" ]]; then
261+
echo "Missing release notes: $NOTES_FILE" >&2
262+
echo "Add $NOTES_FILE (narrative release notes) before releasing." >&2
263+
exit 1
264+
fi
265+
246266
- name: Download artifacts
247267
uses: actions/download-artifact@v4
248268
with:
@@ -260,7 +280,7 @@ jobs:
260280
with:
261281
tag_name: ${{ needs.determine_release.outputs.NEW_TAG }}
262282
files: ./artifacts/**/*
263-
body: "Release of Grimoire CSS version ${{ needs.determine_release.outputs.NEW_TAG }}"
283+
body_path: releases/${{ needs.determine_release.outputs.NEW_TAG }}.md
264284
draft: false
265285
prerelease: false
266286
env:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Extension (VS Code) Quality
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
- 'rc/**'
8+
paths:
9+
- 'extensions/vscode/**'
10+
11+
jobs:
12+
lint_and_build:
13+
name: PR / Lint and build extension
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
cache-dependency-path: 'extensions/vscode/package-lock.json'
25+
26+
- name: Install
27+
working-directory: extensions/vscode
28+
run: npm ci
29+
30+
- name: Lint (Biome)
31+
working-directory: extensions/vscode
32+
run: npm run lint
33+
34+
- name: Compile (tsc)
35+
working-directory: extensions/vscode
36+
run: npm run compile
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Extension (VS Code) Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "extensions/vscode/**"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
determine_release:
15+
name: Determine if extension release is needed
16+
runs-on: ubuntu-latest
17+
outputs:
18+
SHOULD_RELEASE: ${{ steps.release_check.outputs.SHOULD_RELEASE }}
19+
NEW_TAG: ${{ steps.release_check.outputs.NEW_TAG }}
20+
EXT_VERSION: ${{ steps.release_check.outputs.EXT_VERSION }}
21+
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Determine if release is needed
29+
id: release_check
30+
shell: bash
31+
run: |
32+
git fetch --tags
33+
EXT_VERSION=$(node -p "require('./extensions/vscode/package.json').version")
34+
echo "Extension version: $EXT_VERSION"
35+
TAG="vscode-v$EXT_VERSION"
36+
if git rev-parse "$TAG" >/dev/null 2>&1; then
37+
echo "Tag $TAG already exists. No release needed."
38+
echo "SHOULD_RELEASE=false" >> $GITHUB_OUTPUT
39+
else
40+
echo "No existing tag for version $EXT_VERSION. Release is needed."
41+
echo "SHOULD_RELEASE=true" >> $GITHUB_OUTPUT
42+
echo "NEW_TAG=$TAG" >> $GITHUB_OUTPUT
43+
echo "EXT_VERSION=$EXT_VERSION" >> $GITHUB_OUTPUT
44+
fi
45+
46+
build:
47+
name: Build VSIX
48+
runs-on: ubuntu-latest
49+
needs: determine_release
50+
if: needs.determine_release.outputs.SHOULD_RELEASE == 'true'
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Set up Node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: "20"
61+
cache: "npm"
62+
cache-dependency-path: "extensions/vscode/package-lock.json"
63+
64+
- name: Install
65+
working-directory: extensions/vscode
66+
run: npm ci
67+
68+
- name: Lint (Biome)
69+
working-directory: extensions/vscode
70+
run: npm run lint
71+
72+
- name: Compile (tsc)
73+
working-directory: extensions/vscode
74+
run: npm run compile
75+
76+
- name: Install vsce
77+
run: npm i -g @vscode/vsce
78+
79+
- name: Package VSIX
80+
working-directory: extensions/vscode
81+
run: |
82+
vsce package -o "grimoirecss-vscode-${{ needs.determine_release.outputs.EXT_VERSION }}.vsix"
83+
84+
- name: Upload artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: vsix
88+
path: extensions/vscode/*.vsix
89+
90+
release:
91+
name: Release
92+
runs-on: ubuntu-latest
93+
needs: [determine_release, build]
94+
if: needs.determine_release.outputs.SHOULD_RELEASE == 'true'
95+
96+
steps:
97+
- name: Checkout Code
98+
uses: actions/checkout@v4
99+
with:
100+
fetch-depth: 0
101+
102+
- name: Download artifact
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: vsix
106+
path: ./vsix
107+
108+
- name: Create and push tag
109+
run: |
110+
git config user.name "${{ github.actor }}"
111+
git config user.email "${{ github.actor }}@users.noreply.github.com"
112+
git tag -a "${{ needs.determine_release.outputs.NEW_TAG }}" -m "VS Code extension release ${{ needs.determine_release.outputs.NEW_TAG }}"
113+
git push origin "${{ needs.determine_release.outputs.NEW_TAG }}"
114+
115+
- name: Create GitHub Release
116+
uses: softprops/action-gh-release@v1
117+
with:
118+
tag_name: ${{ needs.determine_release.outputs.NEW_TAG }}
119+
files: ./vsix/*.vsix
120+
body: "Release of GrimoireCSS VS Code extension v${{ needs.determine_release.outputs.EXT_VERSION }}"
121+
draft: false
122+
prerelease: false
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
126+
- name: Set up Node
127+
uses: actions/setup-node@v4
128+
with:
129+
node-version: "20"
130+
131+
- name: Install vsce
132+
run: npm i -g @vscode/vsce
133+
134+
- name: Publish to VS Code Marketplace
135+
env:
136+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
137+
shell: bash
138+
run: |
139+
if [[ -z "$VSCE_PAT" ]]; then
140+
echo "VSCE_PAT is not set; skipping VS Code Marketplace publish."
141+
exit 0
142+
fi
143+
VSIX_PATH=$(ls -1 ./vsix/*.vsix | head -n 1)
144+
echo "Publishing $VSIX_PATH"
145+
vsce publish --packagePath "$VSIX_PATH" -p "$VSCE_PAT"

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions-rs/toolchain@v1
2121
with:
2222
profile: minimal
23-
toolchain: stable
23+
toolchain: 1.93.0
2424
components: clippy,rustfmt
2525

2626
- name: Print Rust toolchain versions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Sync GitHub Release Notes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag name, e.g. v1.7.1"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
sync:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Validate release notes file
24+
shell: bash
25+
run: |
26+
TAG='${{ inputs.tag }}'
27+
NOTES_FILE="releases/${TAG}.md"
28+
if [[ ! -f "$NOTES_FILE" ]]; then
29+
echo "Missing release notes: $NOTES_FILE" >&2
30+
exit 1
31+
fi
32+
33+
- name: Sync GitHub Release body from file
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
shell: bash
37+
run: |
38+
TAG='${{ inputs.tag }}'
39+
NOTES_FILE="releases/${TAG}.md"
40+
41+
# Ensure the release exists (fail with a clear message if not).
42+
if ! gh release view "$TAG" >/dev/null 2>&1; then
43+
echo "GitHub Release for tag $TAG not found." >&2
44+
echo "Create the release first (or ensure the tag exists in the repo)." >&2
45+
exit 1
46+
fi
47+
48+
gh release edit "$TAG" --notes-file "$NOTES_FILE"
49+
echo "Updated GitHub Release notes for $TAG from $NOTES_FILE"

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,30 @@
55
target
66
**/*.rs.bk
77
.idea
8-
.vscode/
8+
.vscode/*
9+
!.vscode/launch.json
10+
!.vscode/tasks.json
911
*.code-workspace
1012
.DS_Store
1113
Thumbs.db
1214
*.bak
1315
*.bk
1416
*.patch
1517

18+
# vscode extension
19+
extensions/vscode/node_modules
20+
extensions/vscode/dist
21+
extensions/vscode/.vscode-test
22+
extensions/vscode/*.vsix
23+
1624
# benchmark
1725
benchmark/input
1826
benchmark/grimoire_css_output
1927
benchmark/tailwind_css_output
2028
benchmark/node_modules
2129

2230
test_app
31+
32+
# repro artifacts
33+
repro/**/.browserslistrc
34+
repro/**/*.css

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run GrimoireCSS Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode",
11+
"${workspaceFolder}"
12+
],
13+
"outFiles": ["${workspaceFolder}/extensions/vscode/dist/**/*.js"],
14+
"preLaunchTask": "GrimoireCSS: dev prep (build lsp + compile)"
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)