Skip to content

Commit a46111c

Browse files
committed
ci: update workflows and add extension_release
1 parent 4d599ee commit a46111c

3 files changed

Lines changed: 86 additions & 5 deletions

File tree

.github/workflows/build_release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ jobs:
252252
with:
253253
fetch-depth: 0
254254

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+
255266
- name: Download artifacts
256267
uses: actions/download-artifact@v4
257268
with:
@@ -269,7 +280,7 @@ jobs:
269280
with:
270281
tag_name: ${{ needs.determine_release.outputs.NEW_TAG }}
271282
files: ./artifacts/**/*
272-
body: "Release of Grimoire CSS version ${{ needs.determine_release.outputs.NEW_TAG }}"
283+
body_path: releases/${{ needs.determine_release.outputs.NEW_TAG }}.md
273284
draft: false
274285
prerelease: false
275286
env:

.github/workflows/extension_release.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'extensions/vscode/**'
8+
- "extensions/vscode/**"
99

1010
permissions:
1111
contents: write
@@ -57,9 +57,9 @@ jobs:
5757
- name: Set up Node
5858
uses: actions/setup-node@v4
5959
with:
60-
node-version: '20'
61-
cache: 'npm'
62-
cache-dependency-path: 'extensions/vscode/package-lock.json'
60+
node-version: "20"
61+
cache: "npm"
62+
cache-dependency-path: "extensions/vscode/package-lock.json"
6363

6464
- name: Install
6565
working-directory: extensions/vscode
@@ -122,3 +122,24 @@ jobs:
122122
prerelease: false
123123
env:
124124
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"
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"

0 commit comments

Comments
 (0)