Skip to content

Commit bcc19ac

Browse files
committed
Add automated GitHub release workflow for the browser extension and bump its version
- [Image] should say `What's changed in VS Code extension:` - is browser extension handled in `.github/workflows/github-release.yml`? note that the browser version is in manifest ├── .github │ └── workflows │ └── github-release.yml └── apps ├── browser │ ├── create-zip-archives.ts │ ├── package.json │ ├── src │ │ └── manifest.json │ └── webpack.config.ts └── editor └── package.json
1 parent 2996230 commit bcc19ac

2 files changed

Lines changed: 75 additions & 3 deletions

File tree

‎.github/workflows/github-release.yml‎

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- master
77
paths:
88
- 'apps/editor/package.json'
9+
- 'apps/browser/src/manifest.json'
910

1011
# Required to allow the workflow to create tags and releases
1112
permissions:
@@ -65,7 +66,7 @@ jobs:
6566
run: |
6667
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
6768
68-
echo "### What's Changed in apps/editor" > release_notes.md
69+
echo "### What's changed in VS Code extension:" > release_notes.md
6970
echo "" >> release_notes.md
7071
7172
if [ -n "$PREV_TAG" ]; then
@@ -82,4 +83,75 @@ jobs:
8283
name: Release ${{ steps.package_version.outputs.version }}
8384
body_path: release_notes.md
8485
# Grab the compiled .vsix generated by 'vsce package'
85-
files: apps/editor/*.vsix
86+
files: apps/editor/*.vsix
87+
88+
release-browser:
89+
runs-on: ubuntu-latest
90+
91+
steps:
92+
- name: Checkout code
93+
uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 0
96+
97+
- name: Get version from manifest.json
98+
id: browser_version
99+
run: |
100+
VERSION=$(jq -r .version apps/browser/src/manifest.json)
101+
echo "version=browser-v$VERSION" >> $GITHUB_OUTPUT
102+
103+
- name: Check if tag exists
104+
id: check_tag
105+
run: |
106+
# Prevent failing if manifest.json was modified but version wasn't bumped
107+
if git ls-remote --tags origin refs/tags/${{ steps.browser_version.outputs.version }} | grep -q 'refs/tags/'; then
108+
echo "exists=true" >> $GITHUB_OUTPUT
109+
else
110+
echo "exists=false" >> $GITHUB_OUTPUT
111+
fi
112+
113+
- name: Setup Node.js
114+
if: steps.check_tag.outputs.exists == 'false'
115+
uses: actions/setup-node@v4
116+
with:
117+
node-version: '20'
118+
119+
- name: Setup PNPM
120+
if: steps.check_tag.outputs.exists == 'false'
121+
uses: pnpm/action-setup@v2
122+
with:
123+
version: 9.6.0
124+
run_install: false
125+
126+
- name: Install dependencies
127+
if: steps.check_tag.outputs.exists == 'false'
128+
run: pnpm i
129+
130+
- name: Build Browser extension
131+
if: steps.check_tag.outputs.exists == 'false'
132+
run: |
133+
cd apps/browser
134+
pnpm build
135+
136+
- name: Generate Release Notes
137+
if: steps.check_tag.outputs.exists == 'false'
138+
run: |
139+
PREV_TAG=$(git describe --tags --match "browser-v*" --abbrev=0 2>/dev/null || echo "")
140+
141+
echo "### What's changed in Browser extension:" > release_notes_browser.md
142+
echo "" >> release_notes_browser.md
143+
144+
if [ -n "$PREV_TAG" ]; then
145+
git log ${PREV_TAG}..HEAD --pretty=format:"* %s (%h)" -- apps/browser >> release_notes_browser.md
146+
else
147+
git log --pretty=format:"* %s (%h)" -- apps/browser >> release_notes_browser.md
148+
fi
149+
150+
- name: Create Release and Upload ZIPs
151+
if: steps.check_tag.outputs.exists == 'false'
152+
uses: softprops/action-gh-release@v2
153+
with:
154+
tag_name: ${{ steps.browser_version.outputs.version }}
155+
name: Browser Extension Release ${{ steps.browser_version.outputs.version }}
156+
body_path: release_notes_browser.md
157+
files: apps/browser/*.zip

‎apps/browser/src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Autofill for Code Web Chat",
55
"short_name": "CWC",
66
"description": "Autofill CWC-constructed markdown prompts in free chatbots.",
7-
"version": "2026.1031.26",
7+
"version": "2026.1031.27",
88
"homepage_url": "https://github.com/robertpiosik/CodeWebChat",
99
"icons": {
1010
"16": "icons/icon-16.png",

0 commit comments

Comments
 (0)