Skip to content

Commit c386a3f

Browse files
ci: push-model publish to CBWeb internal marketplace W-21525556 (#264)
* feat: update from publish ext push * feat: add web-only VSIX packaging for internal marketplace Build a separate web-targeted VSIX with node bundles and source maps stripped, reducing size from ~45MB to ~8MB for Heroku upload limits. Add dry-run guard to create-github-releases job. Made-with: Cursor * fix: pr feedback --------- Co-authored-by: peternhale <peternhale@users.noreply.github.com>
1 parent 9da8caa commit c386a3f

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

.github/workflows/nightly-extensions.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,62 @@ jobs:
469469
run: |
470470
npx tsx .github/scripts/index.ts ext-github-releases
471471
472+
publish-to-cbweb-marketplace:
473+
name: Publish to CBWeb Internal Marketplace
474+
needs: [package, create-github-releases, calculate-artifact-name]
475+
runs-on: ubuntu-latest
476+
continue-on-error: true
477+
if: needs.package.result == 'success'
478+
steps:
479+
- name: Download VSIX artifacts
480+
uses: actions/download-artifact@v8
481+
with:
482+
name: ${{ needs.calculate-artifact-name.outputs.artifact-name }}
483+
path: ./vsix-artifacts
484+
485+
- name: Find web VSIX
486+
id: find-web-vsix
487+
run: |
488+
VSIX_FILE=$(find ./vsix-artifacts -name "*-web-*.vsix" | head -1)
489+
if [ -z "$VSIX_FILE" ]; then
490+
echo "::error::No web VSIX file found in artifacts"
491+
exit 1
492+
fi
493+
494+
FILE_SIZE=$(stat -c%s "$VSIX_FILE" 2>/dev/null || stat -f%z "$VSIX_FILE" 2>/dev/null || echo "unknown")
495+
echo "Found web VSIX: $VSIX_FILE (${FILE_SIZE} bytes)"
496+
echo "vsix_file=$VSIX_FILE" >> $GITHUB_OUTPUT
497+
498+
- name: Publish web VSIX to CBWeb marketplace
499+
if: inputs.dry-run != 'true' && github.event.inputs.dry-run != 'true'
500+
run: |
501+
echo "Publishing $VSIX_FILE to CBWeb marketplace..."
502+
503+
HTTP_CODE=$(curl -s -o response.json -w '%{http_code}' \
504+
--retry 2 --retry-delay 5 \
505+
-X POST "${MARKETPLACE_URL}/api/internal/publish" \
506+
-H "Authorization: Bearer ${MARKETPLACE_DEPLOY_TOKEN}" \
507+
-F "vsix=@${VSIX_FILE}")
508+
509+
echo "HTTP response code: $HTTP_CODE"
510+
cat response.json
511+
512+
if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
513+
echo "Successfully published to CBWeb marketplace"
514+
else
515+
echo "::warning::Failed to publish to CBWeb marketplace (HTTP $HTTP_CODE)"
516+
exit 1
517+
fi
518+
env:
519+
VSIX_FILE: ${{ steps.find-web-vsix.outputs.vsix_file }}
520+
MARKETPLACE_URL: ${{ vars.MARKETPLACE_URL }}
521+
MARKETPLACE_DEPLOY_TOKEN: ${{ secrets.MARKETPLACE_DEPLOY_TOKEN }}
522+
523+
- name: Dry-run summary
524+
if: inputs.dry-run == 'true' || github.event.inputs.dry-run == 'true'
525+
run: |
526+
echo "🔄 DRY RUN: Would publish ${{ steps.find-web-vsix.outputs.vsix_file }} to CBWeb marketplace"
527+
472528
slack-notify:
473529
name: Slack Notification
474530
needs:

.github/workflows/package.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,35 @@ jobs:
8888
npm run package:packages
8989
fi
9090
91+
- name: Package web-only VSIX
92+
working-directory: packages/apex-lsp-vscode-extension
93+
run: |
94+
if [ "${{ inputs.pre-release }}" = "true" ]; then
95+
npx vsce package --target web --no-dependencies --pre-release
96+
else
97+
npx vsce package --target web --no-dependencies
98+
fi
99+
100+
WEB_VSIX=$(find . -maxdepth 1 -name "*-web-*.vsix" | head -1)
101+
if [ -n "$WEB_VSIX" ]; then
102+
BEFORE_SIZE=$(stat -c%s "$WEB_VSIX" 2>/dev/null || stat -f%z "$WEB_VSIX" 2>/dev/null)
103+
zip -d "$WEB_VSIX" \
104+
"extension/dist/extension.js" \
105+
"extension/dist/server.node.js" \
106+
"extension/dist/*.map" \
107+
"extension/dist/webview/*.map" \
108+
2>/dev/null || true
109+
AFTER_SIZE=$(stat -c%s "$WEB_VSIX" 2>/dev/null || stat -f%z "$WEB_VSIX" 2>/dev/null)
110+
echo "Optimized web VSIX: ${BEFORE_SIZE} -> ${AFTER_SIZE} bytes"
111+
fi
112+
91113
- name: Generate MD5 checksums
92114
id: md5-checksums
93115
run: |
94116
echo "Generating MD5 checksums for VSIX files..."
95117
96-
# Find all VSIX files and generate MD5 checksums
97-
VSIX_FILES=$(find packages -name "*.vsix" -type f)
118+
# Find non-web VSIX files and generate MD5 checksums
119+
VSIX_FILES=$(find packages -name "*.vsix" -type f ! -name "*-web-*")
98120
99121
if [ -z "$VSIX_FILES" ]; then
100122
echo "No VSIX files found to generate checksums for"

0 commit comments

Comments
 (0)