77 description : " Version tag to publish (runner-vX.X.X)"
88 required : true
99 skipPublish :
10- description : " Skip publish into marketplaces step"
10+ description : " Skip publish into marketplaces"
11+ default : false
12+ type : boolean
13+ skipPackageJsonMatch :
14+ description : " Skip tag validation with package.json (testing)"
1115 default : false
1216 type : boolean
1317
@@ -22,16 +26,10 @@ jobs:
2226 - name : 🔖 Show input tag
2327 run : echo "Publishing version ${{ github.event.inputs.tag }}"
2428
25- - name : ✅ Validate tag format
26- run : |
27- TAG=${{ github.event.inputs.tag }}
28- if [[ ! "$TAG" =~ ^runner-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
29- echo "❌ Invalid tag format: $TAG. Use format like 'runner-v1.2.3'"
30- exit 1
31- fi
32-
3329 - name : 👷🏻 Checkout Repository
3430 uses : actions/checkout@v4
31+ with :
32+ fetch-depth : 0
3533
3634 - name : ✅ Verify Git tag exists
3735 run : |
@@ -41,145 +39,133 @@ jobs:
4139 exit 1
4240 fi
4341
42+ - name : ✅ Validate and extract tag
43+ run : |
44+ TAG=${{ github.event.inputs.tag }}
45+ if [[ ! "$TAG" =~ ^runner-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
46+ echo "❌ Invalid tag format: $TAG. Use format like 'runner-v1.2.3'"
47+ exit 1
48+ fi
49+ echo "TAG=$TAG" >> $GITHUB_ENV
50+ echo "VERSION=${TAG#runner-v}" >> $GITHUB_ENV
51+
4452 - name : ✅ Ensure tag matches package.json version
53+ if : ${{ github.event.inputs.skipPackageJsonMatch != 'true' }}
4554 working-directory : packages/extester-runner
4655 run : |
4756 PKG_VERSION=$(node -p "require('./package.json').version")
48- TAG=${{ github.event.inputs.tag }}
49- TAG_VERSION=${TAG#runner-v}
57+ TAG_VERSION=${VERSION}
5058 echo "Package version: $PKG_VERSION"
5159 echo "Input tag version: $TAG_VERSION"
5260 if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
5361 echo "❌ Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)!"
5462 exit 1
5563 fi
5664
57- - name : 👷🏻 Checkout the tag
58- uses : actions/checkout@v4
59- with :
60- ref : ${{ github.event.inputs.tag }}
61-
62- - name : ⚙️ Setup NodeJS
65+ - name : ⚙️ Set up Node.js
6366 uses : actions/setup-node@v4
6467 with :
6568 node-version : 20
6669
67- - name : 📦 Install vsce
68- run : npm install -g @vscode/vsce
69-
70- - name : 📦 Install ovsx
71- run : npm install -g ovsx
72-
73- - name : 📦 Install GitHub CLI
74- run : sudo apt-get install gh -y
75-
76- - name : 🔧 Install
77- run : npm ci
78-
79- - name : 🔧 Build
80- run : npm run build
70+ - name : 📦 Install tools
71+ run : |
72+ npm install -g @vscode/vsce ovsx
73+ sudo apt-get install -y gh
8174
82- - name : 🛠 Extract version from a tag
83- id : version
75+ - name : 🔧 Install deps and build
8476 run : |
85- TAG=${{ github.event.inputs.tag }}
86- VER=$(echo "$TAG" | sed 's/^runner-v//')
87- echo "VERSION=$VER" >> $GITHUB_OUTPUT
77+ npm ci
78+ npm run build
8879
8980 - name : 🛠 Package extension
9081 working-directory : packages/extester-runner
91- run : vsce package -o extester-runner-${{ steps.version.outputs.VERSION }}.vsix
92-
93- - name : 🧾 Inspect packaged contents
94- working-directory : packages/extester-runner
95- run : vsce ls extester-runner-${{ steps.version.outputs.VERSION }}.vsix
96-
97- - name : 🚀 Publish to VS Code Marketplace
98- if : ${{ github.event.inputs.skipPublish != 'true' }}
99- working-directory : packages/extester-runner
100- run : vsce publish --pat ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath extester-runner-${{ steps.version.outputs.VERSION }}.vsix
101-
102- - name : 🚀 Publish to Open VSX Registry
103- if : ${{ github.event.inputs.skipPublish != 'true' }}
104- working-directory : packages/extester-runner
105- run : ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} extester-runner-${{ steps.version.outputs.VERSION }}.vsix
106-
107- - name : 📣 Add summary
108- if : ${{ github.event.inputs.skipPublish != 'true' }}
10982 run : |
110- echo "#### ✅ Published \`extester-runner-${{ steps.version.outputs.VERSION }}.vsix\` to VS Code Marketplace" >> $GITHUB_STEP_SUMMARY
111- echo "#### ✅ Published \`extester-runner-${{ steps.version.outputs.VERSION }}.vsix\` to Open VSX Registry" >> $GITHUB_STEP_SUMMARY
112-
113- - name : 💾 Upload VSIX
114- uses : actions/upload-artifact@v4
115- with :
116- name : extester-runner-${{ steps.version.outputs.VERSION }}.vsix
117- path : " packages/extester-runner/extester-runner-${{ steps.version.outputs.VERSION }}.vsix"
83+ vsce package -o extester-runner-${VERSION}.vsix
84+ vsce ls extester-runner-${VERSION}.vsix
11885
11986 - name : 📝 Generate changelog
120- id : changelog
12187 working-directory : packages/extester-runner
12288 run : |
123- TAG=${{ github.event.inputs.tag }}
124- VERSION=${TAG#runner-v}
12589 PREV_TAG=$(git tag --list "runner-v*" --sort=-creatordate | grep -v "$TAG" | head -n 1)
126-
127- echo "Comparing changes from $PREV_TAG to $TAG in packages/extester-runner"
128-
129- git fetch --unshallow || true
90+ echo "Comparing changes from $PREV_TAG to $TAG"
13091
13192 if [ -z "$PREV_TAG" ]; then
132- # First tag: include everything reachable from it
133- LOG=$(git log "$TAG" --reverse -- packages/extester-runner --no-merges --pretty=format:'%s (%h)')
134- if [ -z "$LOG" ]; then
135- # Still empty? Fallback to full history
136- LOG=$(git log --reverse -- packages/extester-runner --no-merges --pretty=format:'%s (%h)')
137- fi
93+ LOG=$(git log "$TAG" --reverse --oneline -- .)
94+ [ -z "$LOG" ] && LOG=$(git log --reverse --oneline -- .)
13895 else
139- LOG=$(git log "$PREV_TAG..$TAG" -- packages/extester-runner --no-merges --pretty=format:'%s (%h)' )
96+ LOG=$(git log "$PREV_TAG..$TAG" --oneline -- . )
14097 fi
14198
14299 if [ -z "$LOG" ]; then
143100 LOG="Initial release (first tag)"
144101 fi
145102
146- # Helper to format sections
147103 format_section() {
148- local pattern="$1 "
104+ local pattern="($1)\(runner\) "
149105 local title="$2"
150- local content=$(echo "$LOG" | grep -iE "^ $pattern" || true)
106+ local content=$(echo "$LOG" | grep -iE "$pattern" || true)
151107 if [[ -n "$content" ]]; then
152108 echo "### $title"
153109 echo "$content"
154- echo ""
110+ echo
155111 fi
156112 }
157113
158- {
159- format_section '^feat|^feature' "🚀 Features"
160- format_section '^fix' "🚫 Bugs"
161- format_section '^test' "🔎 Tests"
162- format_section '^chore|^refactor|^internal|^ci|^docs' "🔧 Maintenance"
163- format_section '^deps|^dependencies' "📦 Dependencies"
164-
165- # Other commits not matching any above
166- OTHER=$(echo "$LOG" | grep -vE '^(feat|feature|fix|test|chore|refactor|internal|ci|docs|deps|dependencies)' || true)
167- if [[ -n "$OTHER" ]]; then
168- echo "### 🧼 Other Changes"
169- echo "$OTHER"
170- echo ""
114+ format_other_section() {
115+ local title="🧼 Other Changes"
116+ local content=$(echo "$LOG" | grep -vE "(feat|feature|fix|test|chore|refactor|internal|ci|docs|deps|dependencies)\(runner\)" || true)
117+ if [[ -n "$content" ]]; then
118+ echo "### $title"
119+ echo "$content"
120+ echo
171121 fi
122+ }
123+
124+ {
125+ echo "## What's Changed"
126+ format_section 'break|breaking' "⚠️ Breaking"
127+ format_section 'feat|feature' "🚀 Features"
128+ format_section 'fix' "🚫 Bugs"
129+ format_section 'test' "🔎 Tests"
130+ format_section 'chore|refactor|internal|ci|docs' "🔧 Maintenance"
131+ format_section 'deps|dependencies' "📦 Dependencies"
132+ format_other_section
172133 } > CHANGELOG.md
173134
174- echo "Generated CHANGELOG.md: "
135+ echo "Generated CHANGELOG.md"
175136 cat CHANGELOG.md
176137
177- - name : 🚀 Publish GitHub Release with VSIX
138+ - name : 🚀 Publish to VS Code Marketplace
139+ if : ${{ github.event.inputs.skipPublish != 'true' }}
140+ working-directory : packages/extester-runner
141+ run : |
142+ vsce publish --pat ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} \
143+ --packagePath extester-runner-${VERSION}.vsix
144+
145+ - name : 🚀 Publish to Open VSX Registry
146+ if : ${{ github.event.inputs.skipPublish != 'true' }}
147+ working-directory : packages/extester-runner
148+ run : |
149+ ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} extester-runner-${VERSION}.vsix
150+
151+ - name : 📣 Add summary
152+ if : ${{ github.event.inputs.skipPublish != 'true' }}
153+ run : |
154+ echo "#### ✅ Published \`extester-runner-${VERSION}.vsix\` to VS Code Marketplace" >> $GITHUB_STEP_SUMMARY
155+ echo "#### ✅ Published \`extester-runner-${VERSION}.vsix\` to Open VSX Registry" >> $GITHUB_STEP_SUMMARY
156+
157+ - name : 💾 Upload VSIX
158+ uses : actions/upload-artifact@v4
159+ with :
160+ name : extester-runner-${{ env.VERSION }}.vsix
161+ path : packages/extester-runner/extester-runner-${{ env.VERSION }}.vsix
162+
163+ - name : 🚀 Publish GitHub Release
164+ working-directory : packages/extester-runner
178165 env :
179166 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
180- working-directory : packages/extester-runner
181167 run : |
182- TAG=${{ github.event.inputs.tag }}
183- gh release create "$TAG" --title "ExTester Runner v${{ steps.version.outputs. VERSION }} " \
168+ gh release create "$TAG" \
169+ --title "ExTester Runner - Preview ( v${VERSION}) " \
184170 --notes-file CHANGELOG.md \
185- " extester-runner-${{ steps.version.outputs. VERSION }} .vsix"
171+ extester-runner-${VERSION} .vsix
0 commit comments