Skip to content
56 changes: 56 additions & 0 deletions .github/workflows/nightly-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,62 @@ jobs:
run: |
npx tsx .github/scripts/index.ts ext-github-releases

publish-to-cbweb-marketplace:
name: Publish to CBWeb Internal Marketplace
needs: [package, create-github-releases, calculate-artifact-name]
runs-on: ubuntu-latest
continue-on-error: true
if: needs.package.result == 'success'
steps:
- name: Download VSIX artifacts
uses: actions/download-artifact@v8
with:
name: ${{ needs.calculate-artifact-name.outputs.artifact-name }}
path: ./vsix-artifacts

- name: Find web VSIX
id: find-web-vsix
run: |
VSIX_FILE=$(find ./vsix-artifacts -name "*-web-*.vsix" | head -1)
if [ -z "$VSIX_FILE" ]; then
echo "::error::No web VSIX file found in artifacts"
exit 1
fi

FILE_SIZE=$(stat -c%s "$VSIX_FILE" 2>/dev/null || stat -f%z "$VSIX_FILE" 2>/dev/null || echo "unknown")
echo "Found web VSIX: $VSIX_FILE (${FILE_SIZE} bytes)"
echo "vsix_file=$VSIX_FILE" >> $GITHUB_OUTPUT

- name: Publish web VSIX to CBWeb marketplace
if: inputs.dry-run != 'true' && github.event.inputs.dry-run != 'true'
run: |
echo "Publishing $VSIX_FILE to CBWeb marketplace..."

HTTP_CODE=$(curl -s -o response.json -w '%{http_code}' \
--retry 2 --retry-delay 5 \
-X POST "${MARKETPLACE_URL}/api/internal/publish" \
-H "Authorization: Bearer ${MARKETPLACE_DEPLOY_TOKEN}" \
-F "vsix=@${VSIX_FILE}")

echo "HTTP response code: $HTTP_CODE"
cat response.json

if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "Successfully published to CBWeb marketplace"
else
echo "::warning::Failed to publish to CBWeb marketplace (HTTP $HTTP_CODE)"
exit 1
fi
env:
VSIX_FILE: ${{ steps.find-web-vsix.outputs.vsix_file }}
MARKETPLACE_URL: ${{ vars.MARKETPLACE_URL }}
MARKETPLACE_DEPLOY_TOKEN: ${{ secrets.MARKETPLACE_DEPLOY_TOKEN }}

- name: Dry-run summary
if: inputs.dry-run == 'true' || github.event.inputs.dry-run == 'true'
run: |
echo "🔄 DRY RUN: Would publish ${{ steps.find-web-vsix.outputs.vsix_file }} to CBWeb marketplace"

slack-notify:
name: Slack Notification
needs:
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,35 @@ jobs:
npm run package:packages
fi

- name: Package web-only VSIX
working-directory: packages/apex-lsp-vscode-extension
run: |
if [ "${{ inputs.pre-release }}" = "true" ]; then
npx vsce package --target web --no-dependencies --pre-release
else
npx vsce package --target web --no-dependencies
fi

WEB_VSIX=$(find . -maxdepth 1 -name "*-web-*.vsix" | head -1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this simply results of package:packages.vsix.size() - web.vsix.siae()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just getting the web vsix name. No size calc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line I commented on, ok, but what follows seems relevant to my comment, yes?

Copy link
Copy Markdown
Contributor Author

@kylewalke kylewalke Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I see what you're saying, the calculation in the echo statement. Yes, essentially that is what the difference is. The statement itself is just window dressing so if you want I can remove it as well?

if [ -n "$WEB_VSIX" ]; then
BEFORE_SIZE=$(stat -c%s "$WEB_VSIX" 2>/dev/null || stat -f%z "$WEB_VSIX" 2>/dev/null)
zip -d "$WEB_VSIX" \
"extension/dist/extension.js" \
"extension/dist/server.node.js" \
"extension/dist/*.map" \
"extension/dist/webview/*.map" \
2>/dev/null || true
AFTER_SIZE=$(stat -c%s "$WEB_VSIX" 2>/dev/null || stat -f%z "$WEB_VSIX" 2>/dev/null)
echo "Optimized web VSIX: ${BEFORE_SIZE} -> ${AFTER_SIZE} bytes"
fi

- name: Generate MD5 checksums
id: md5-checksums
run: |
echo "Generating MD5 checksums for VSIX files..."

# Find all VSIX files and generate MD5 checksums
VSIX_FILES=$(find packages -name "*.vsix" -type f)
# Find non-web VSIX files and generate MD5 checksums
VSIX_FILES=$(find packages -name "*.vsix" -type f ! -name "*-web-*")

if [ -z "$VSIX_FILES" ]; then
echo "No VSIX files found to generate checksums for"
Expand Down
Loading