Skip to content

Commit 2ee39fd

Browse files
committed
ci: add auto generated changelog for extester runner extension publish workflow
1 parent ff58f1e commit 2ee39fd

File tree

1 file changed

+59
-3
lines changed

1 file changed

+59
-3
lines changed

.github/workflows/runner-publish.yaml

+59-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: true
99

1010
permissions:
11-
contents: read
11+
contents: write
1212

1313
jobs:
1414
build-and-publish:
@@ -60,6 +60,9 @@ jobs:
6060
- name: 📦 Install vsce
6161
run: npm install -g @vscode/vsce
6262

63+
- name: 📦 Install GitHub CLI
64+
run: sudo apt-get install gh -y
65+
6366
- name: 🔧 Install
6467
run: npm ci
6568

@@ -82,12 +85,65 @@ jobs:
8285
working-directory: packages/extester-runner
8386
run: vsce publish --pat ${{ secrets.VSCODE_TOKEN }} --packagePath extester-runner-${{ steps.version.outputs.VERSION }}.vsix
8487

88+
- name: 📣 Add summary
89+
run: |
90+
echo "### ✅ Published \`extester-runner-${{ steps.version.outputs.VERSION }}.vsix\` to Marketplace" >> $GITHUB_STEP_SUMMARY
91+
8592
- name: 💾 Upload VSIX
8693
uses: actions/upload-artifact@v4
8794
with:
8895
name: extester-runner-${{ steps.version.outputs.VERSION }}.vsix
8996
path: "packages/extester-runner/extester-runner-${{ steps.version.outputs.VERSION }}.vsix"
9097

91-
- name: 📣 Add summary
98+
- name: 📝 Generate changelog
99+
id: changelog
92100
run: |
93-
echo "### ✅ Published \`extester-runner-${{ steps.version.outputs.VERSION }}.vsix\` to Marketplace" >> $GITHUB_STEP_SUMMARY
101+
TAG=${{ github.event.inputs.tag }}
102+
VERSION=${TAG#runner-v}
103+
PREV_TAG=$(git tag --list "runner-v*" --sort=-creatordate | grep -v "$TAG" | head -n 1)
104+
105+
echo "Comparing changes from $PREV_TAG to $TAG in packages/extester-runner"
106+
107+
git fetch --unshallow || true
108+
109+
LOG=$(git log "$PREV_TAG..$TAG" -- packages/extester-runner --pretty=format:'%s (%h)')
110+
111+
format_section() {
112+
local pattern="$1"
113+
local title="$2"
114+
local content=$(echo "$LOG" | grep -iE "^$pattern" || true)
115+
if [[ -n "$content" ]]; then
116+
echo "### $title"
117+
echo "$content"
118+
echo ""
119+
fi
120+
}
121+
122+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
123+
124+
format_section 'feat|feature' "🚀 Features"
125+
format_section 'fix' "🚫 Bugs"
126+
format_section 'test' "🔎 Tests"
127+
format_section 'chore|refactor|internal' "🔧 Maintenance"
128+
format_section 'deps|dependencies' "📦 Dependencies"
129+
130+
# Catch-all for anything else
131+
OTHER=$(echo "$LOG" | grep -vE '^(feat|feature|fix|test|chore|refactor|internal|deps|dependencies)' || true)
132+
if [[ -n "$OTHER" ]]; then
133+
echo "### 🧼 Other Changes"
134+
echo "$OTHER"
135+
echo ""
136+
fi
137+
138+
echo "EOF" >> $GITHUB_OUTPUT
139+
140+
- name: 🚀 Publish GitHub Release with VSIX
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
working-directory: packages/extester-runner
144+
run: |
145+
TAG=${{ github.event.inputs.tag }}
146+
gh release create "$TAG" --clobber \
147+
--title "ExTester Runner v${{ steps.version.outputs.VERSION }}" \
148+
--notes "${{ steps.changelog.outputs.changelog }}" \
149+
"extester-runner-${{ steps.version.outputs.VERSION }}.vsix"

0 commit comments

Comments
 (0)