Skip to content

Commit 897908b

Browse files
committed
refactor: enhance publish workflow with detailed logging and diagnostics
1 parent 51493e0 commit 897908b

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,30 @@ jobs:
140140
uses: actions/download-artifact@v4
141141
with:
142142
name: extension-v${{ needs.validate.outputs.version }}
143+
144+
- name: Downloaded package
145+
run: |
146+
echo "📦 Downloaded artifact contents:"
147+
ls -lh
148+
echo "Current directory: $(pwd)"
149+
143150
- name: Install vsce
144-
run: npm install -g @vscode/vsce
151+
run: |
152+
echo "🔧 Installing vsce..."
153+
npm install -g @vscode/vsce
154+
echo "VSCE version: $(vsce --version)"
155+
145156
- name: Diagnostic check
146157
run: |
147158
echo "🔍 Environment Information"
148159
echo "Node version: $(node -v)"
149160
echo "NPM version: $(npm -v)"
150161
echo "VSCE version: $(vsce --version)"
151-
echo "Package.json version: $(node -p 'require(\'./package.json\').version')"
162+
echo "Package.json version: $(node -p 'require(\'./package.json\').version' 2>/dev/null || echo 'Not found')"
152163
echo "Current directory: $(pwd)"
153164
ls -la
154-
- name: Diagnostic check
155-
run: echo "Diagnostic check complete."
165+
echo "VSIX files:"
166+
ls -lh *.vsix || echo "No VSIX file found"
156167
157168
- name: Publish to marketplace
158169
id: publish
@@ -164,18 +175,29 @@ jobs:
164175
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.dry_run }}" == "true" ]]; then
165176
DRY_RUN="true"
166177
fi
178+
167179
VERSION="${{ needs.validate.outputs.version }}"
168180
echo "🔍 Publish v${VERSION} (dry=${DRY_RUN})"
181+
echo "VSC_PAT is ${VSC_PAT:+set}" # Will print 'set' if present
182+
169183
if [[ "$DRY_RUN" == "true" ]]; then
170184
echo "✨ Dry run - skipping actual publish"
171185
echo "status=success" >> $GITHUB_OUTPUT
172186
exit 0
173187
fi
188+
174189
echo "🚀 Running vsce publish..."
190+
echo "VSIX files before publish:"
191+
ls -lh *.vsix || echo "No VSIX file found"
192+
echo "Package.json present: $(test -f package.json && echo yes || echo no)"
193+
175194
OUTPUT=$(vsce publish -p "$VSC_PAT" 2>&1)
176195
EXIT_CODE=$?
196+
177197
echo "📝 vsce publish output:"
178198
echo "$OUTPUT"
199+
echo "Exit code: $EXIT_CODE"
200+
179201
if [ $EXIT_CODE -eq 0 ]; then
180202
echo "status=success" >> $GITHUB_OUTPUT
181203
echo "✅ Publish succeeded."
@@ -188,7 +210,8 @@ jobs:
188210
echo "error_detail=$ERROR_DETAIL" >> $GITHUB_OUTPUT
189211
echo "❌ Publish failed: $ERROR_DETAIL"
190212
fi
191-
- name: Publish step
213+
214+
- name: Publish step complete
192215
run: echo "Publish step complete."
193216

194217
- name: Create and push Git tag
@@ -202,3 +225,7 @@ jobs:
202225
git push origin "v${VERSION}"
203226
echo "✅ Git tag pushed."
204227
228+
- name: Tag step complete
229+
if: steps.publish.outputs.status == 'success'
230+
run: echo "Tag step complete."
231+

0 commit comments

Comments
 (0)